Skip to content

Commit 9a13e1d

Browse files
feat(api): add excluded_account_tokens parameter to auth_rules v2 create/update
1 parent 5c64610 commit 9a13e1d

6 files changed

Lines changed: 86 additions & 20 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 188
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6eebc524f3f5b6499a79ef544e150cc49ea1dc1e1c76a5392079ca5a83e78100.yml
3-
openapi_spec_hash: 500c46c1194a128c404e17f7a5bff676
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-c5b3750e5a69b58f465c8bc61065c0ddd2fd3fec8fef2fa5703fcb10d7ba6a1c.yml
3+
openapi_spec_hash: 3a4cfae4d14318c5e3dfe8bcc751497f
44
config_hash: 7daa8d0d03697920c0c1ca18ce6d4594

src/lithic/resources/auth_rules/v2/v2.py

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ def create(
182182
program_level: bool,
183183
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION", "TYPESCRIPT_CODE"],
184184
event_stream: EventStream | Omit = omit,
185+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
186+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
185187
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
186188
name: Optional[str] | Omit = omit,
187189
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -215,6 +217,10 @@ def create(
215217
216218
event_stream: The event stream during which the rule will be evaluated.
217219
220+
excluded_account_tokens: Account tokens to which the Auth Rule does not apply.
221+
222+
excluded_business_account_tokens: Business account tokens to which the Auth Rule does not apply.
223+
218224
excluded_card_tokens: Card tokens to which the Auth Rule does not apply.
219225
220226
name: Auth Rule Name
@@ -245,6 +251,8 @@ def create(
245251
name: Optional[str] | Omit = omit,
246252
card_tokens: SequenceNotStr[str] | Omit = omit,
247253
program_level: bool | Omit = omit,
254+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
255+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
248256
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
249257
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
250258
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -265,6 +273,8 @@ def create(
265273
"name": name,
266274
"card_tokens": card_tokens,
267275
"program_level": program_level,
276+
"excluded_account_tokens": excluded_account_tokens,
277+
"excluded_business_account_tokens": excluded_business_account_tokens,
268278
"excluded_card_tokens": excluded_card_tokens,
269279
},
270280
v2_create_params.V2CreateParams,
@@ -327,9 +337,9 @@ def update(
327337
"""
328338
Updates a V2 Auth rule's properties
329339
330-
If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
331-
is provided, this will replace existing associations with the provided list of
332-
entities.
340+
If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
341+
`excluded_account_tokens`, or `excluded_business_account_tokens` is provided,
342+
this will replace existing associations with the provided list of entities.
333343
334344
Args:
335345
account_tokens: Account tokens to which the Auth Rule applies.
@@ -372,9 +382,9 @@ def update(
372382
"""
373383
Updates a V2 Auth rule's properties
374384
375-
If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
376-
is provided, this will replace existing associations with the provided list of
377-
entities.
385+
If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
386+
`excluded_account_tokens`, or `excluded_business_account_tokens` is provided,
387+
this will replace existing associations with the provided list of entities.
378388
379389
Args:
380390
card_tokens: Card tokens to which the Auth Rule applies.
@@ -402,6 +412,8 @@ def update(
402412
self,
403413
auth_rule_token: str,
404414
*,
415+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
416+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
405417
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
406418
name: Optional[str] | Omit = omit,
407419
program_level: bool | Omit = omit,
@@ -416,11 +428,15 @@ def update(
416428
"""
417429
Updates a V2 Auth rule's properties
418430
419-
If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
420-
is provided, this will replace existing associations with the provided list of
421-
entities.
431+
If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
432+
`excluded_account_tokens`, or `excluded_business_account_tokens` is provided,
433+
this will replace existing associations with the provided list of entities.
422434
423435
Args:
436+
excluded_account_tokens: Account tokens to which the Auth Rule does not apply.
437+
438+
excluded_business_account_tokens: Business account tokens to which the Auth Rule does not apply.
439+
424440
excluded_card_tokens: Card tokens to which the Auth Rule does not apply.
425441
426442
name: Auth Rule Name
@@ -452,6 +468,8 @@ def update(
452468
name: Optional[str] | Omit = omit,
453469
state: Literal["INACTIVE"] | Omit = omit,
454470
card_tokens: SequenceNotStr[str] | Omit = omit,
471+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
472+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
455473
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
456474
program_level: bool | Omit = omit,
457475
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -472,6 +490,8 @@ def update(
472490
"name": name,
473491
"state": state,
474492
"card_tokens": card_tokens,
493+
"excluded_account_tokens": excluded_account_tokens,
494+
"excluded_business_account_tokens": excluded_business_account_tokens,
475495
"excluded_card_tokens": excluded_card_tokens,
476496
"program_level": program_level,
477497
},
@@ -1006,6 +1026,8 @@ async def create(
10061026
program_level: bool,
10071027
type: Literal["CONDITIONAL_BLOCK", "VELOCITY_LIMIT", "MERCHANT_LOCK", "CONDITIONAL_ACTION", "TYPESCRIPT_CODE"],
10081028
event_stream: EventStream | Omit = omit,
1029+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
1030+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
10091031
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
10101032
name: Optional[str] | Omit = omit,
10111033
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1039,6 +1061,10 @@ async def create(
10391061
10401062
event_stream: The event stream during which the rule will be evaluated.
10411063
1064+
excluded_account_tokens: Account tokens to which the Auth Rule does not apply.
1065+
1066+
excluded_business_account_tokens: Business account tokens to which the Auth Rule does not apply.
1067+
10421068
excluded_card_tokens: Card tokens to which the Auth Rule does not apply.
10431069
10441070
name: Auth Rule Name
@@ -1069,6 +1095,8 @@ async def create(
10691095
name: Optional[str] | Omit = omit,
10701096
card_tokens: SequenceNotStr[str] | Omit = omit,
10711097
program_level: bool | Omit = omit,
1098+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
1099+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
10721100
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
10731101
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10741102
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1089,6 +1117,8 @@ async def create(
10891117
"name": name,
10901118
"card_tokens": card_tokens,
10911119
"program_level": program_level,
1120+
"excluded_account_tokens": excluded_account_tokens,
1121+
"excluded_business_account_tokens": excluded_business_account_tokens,
10921122
"excluded_card_tokens": excluded_card_tokens,
10931123
},
10941124
v2_create_params.V2CreateParams,
@@ -1151,9 +1181,9 @@ async def update(
11511181
"""
11521182
Updates a V2 Auth rule's properties
11531183
1154-
If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
1155-
is provided, this will replace existing associations with the provided list of
1156-
entities.
1184+
If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
1185+
`excluded_account_tokens`, or `excluded_business_account_tokens` is provided,
1186+
this will replace existing associations with the provided list of entities.
11571187
11581188
Args:
11591189
account_tokens: Account tokens to which the Auth Rule applies.
@@ -1196,9 +1226,9 @@ async def update(
11961226
"""
11971227
Updates a V2 Auth rule's properties
11981228
1199-
If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
1200-
is provided, this will replace existing associations with the provided list of
1201-
entities.
1229+
If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
1230+
`excluded_account_tokens`, or `excluded_business_account_tokens` is provided,
1231+
this will replace existing associations with the provided list of entities.
12021232
12031233
Args:
12041234
card_tokens: Card tokens to which the Auth Rule applies.
@@ -1226,6 +1256,8 @@ async def update(
12261256
self,
12271257
auth_rule_token: str,
12281258
*,
1259+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
1260+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
12291261
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
12301262
name: Optional[str] | Omit = omit,
12311263
program_level: bool | Omit = omit,
@@ -1240,11 +1272,15 @@ async def update(
12401272
"""
12411273
Updates a V2 Auth rule's properties
12421274
1243-
If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
1244-
is provided, this will replace existing associations with the provided list of
1245-
entities.
1275+
If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`,
1276+
`excluded_account_tokens`, or `excluded_business_account_tokens` is provided,
1277+
this will replace existing associations with the provided list of entities.
12461278
12471279
Args:
1280+
excluded_account_tokens: Account tokens to which the Auth Rule does not apply.
1281+
1282+
excluded_business_account_tokens: Business account tokens to which the Auth Rule does not apply.
1283+
12481284
excluded_card_tokens: Card tokens to which the Auth Rule does not apply.
12491285
12501286
name: Auth Rule Name
@@ -1276,6 +1312,8 @@ async def update(
12761312
name: Optional[str] | Omit = omit,
12771313
state: Literal["INACTIVE"] | Omit = omit,
12781314
card_tokens: SequenceNotStr[str] | Omit = omit,
1315+
excluded_account_tokens: SequenceNotStr[str] | Omit = omit,
1316+
excluded_business_account_tokens: SequenceNotStr[str] | Omit = omit,
12791317
excluded_card_tokens: SequenceNotStr[str] | Omit = omit,
12801318
program_level: bool | Omit = omit,
12811319
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1296,6 +1334,8 @@ async def update(
12961334
"name": name,
12971335
"state": state,
12981336
"card_tokens": card_tokens,
1337+
"excluded_account_tokens": excluded_account_tokens,
1338+
"excluded_business_account_tokens": excluded_business_account_tokens,
12991339
"excluded_card_tokens": excluded_card_tokens,
13001340
"program_level": program_level,
13011341
},

src/lithic/types/auth_rules/auth_rule.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,11 @@ class AuthRule(BaseModel):
134134
ACH_CREDIT_RECEIPT, or ACH_DEBIT_RECEIPT event stream.
135135
"""
136136

137+
excluded_account_tokens: Optional[List[str]] = None
138+
"""Account tokens to which the Auth Rule does not apply."""
139+
140+
excluded_business_account_tokens: Optional[List[str]] = None
141+
"""Business account tokens to which the Auth Rule does not apply."""
142+
137143
excluded_card_tokens: Optional[List[str]] = None
138144
"""Card tokens to which the Auth Rule does not apply."""

src/lithic/types/auth_rules/v2_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ class ProgramLevelRule(TypedDict, total=False):
149149
event_stream: EventStream
150150
"""The event stream during which the rule will be evaluated."""
151151

152+
excluded_account_tokens: SequenceNotStr[str]
153+
"""Account tokens to which the Auth Rule does not apply."""
154+
155+
excluded_business_account_tokens: SequenceNotStr[str]
156+
"""Business account tokens to which the Auth Rule does not apply."""
157+
152158
excluded_card_tokens: SequenceNotStr[str]
153159
"""Card tokens to which the Auth Rule does not apply."""
154160

src/lithic/types/auth_rules/v2_update_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class CardLevelRule(TypedDict, total=False):
4646

4747

4848
class ProgramLevelRule(TypedDict, total=False):
49+
excluded_account_tokens: SequenceNotStr[str]
50+
"""Account tokens to which the Auth Rule does not apply."""
51+
52+
excluded_business_account_tokens: SequenceNotStr[str]
53+
"""Business account tokens to which the Auth Rule does not apply."""
54+
4955
excluded_card_tokens: SequenceNotStr[str]
5056
"""Card tokens to which the Auth Rule does not apply."""
5157

tests/api_resources/auth_rules/test_v2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def test_method_create_with_all_params_overload_3(self, client: Lithic) -> None:
214214
program_level=True,
215215
type="CONDITIONAL_BLOCK",
216216
event_stream="AUTHORIZATION",
217+
excluded_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
218+
excluded_business_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
217219
excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
218220
name="name",
219221
)
@@ -409,6 +411,8 @@ def test_method_update_overload_3(self, client: Lithic) -> None:
409411
def test_method_update_with_all_params_overload_3(self, client: Lithic) -> None:
410412
v2 = client.auth_rules.v2.update(
411413
auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
414+
excluded_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
415+
excluded_business_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
412416
excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
413417
name="name",
414418
program_level=True,
@@ -945,6 +949,8 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn
945949
program_level=True,
946950
type="CONDITIONAL_BLOCK",
947951
event_stream="AUTHORIZATION",
952+
excluded_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
953+
excluded_business_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
948954
excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
949955
name="name",
950956
)
@@ -1140,6 +1146,8 @@ async def test_method_update_overload_3(self, async_client: AsyncLithic) -> None
11401146
async def test_method_update_with_all_params_overload_3(self, async_client: AsyncLithic) -> None:
11411147
v2 = await async_client.auth_rules.v2.update(
11421148
auth_rule_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
1149+
excluded_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
1150+
excluded_business_account_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
11431151
excluded_card_tokens=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
11441152
name="name",
11451153
program_level=True,

0 commit comments

Comments
 (0)