Skip to content

Commit 6436634

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): updates to Auth Rules numeric types, new Card Types and Authorization Rule Backtests (#637)
- Specifies numeric types on Auth Rules to be integers - adds `replacement_for` field to Card create requests - improvements to documentation - adds Authorization Rules Backtests
1 parent 78321ef commit 6436634

21 files changed

+196
-151
lines changed

src/lithic/resources/cards/cards.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def with_streaming_response(self) -> CardsWithStreamingResponse:
113113
def create(
114114
self,
115115
*,
116-
type: Literal["MERCHANT_LOCKED", "PHYSICAL", "SINGLE_USE", "VIRTUAL"],
116+
type: Literal["MERCHANT_LOCKED", "PHYSICAL", "SINGLE_USE", "VIRTUAL", "UNLOCKED", "DIGITAL_WALLET"],
117117
account_token: str | NotGiven = NOT_GIVEN,
118118
card_program_token: str | NotGiven = NOT_GIVEN,
119119
carrier: Carrier | NotGiven = NOT_GIVEN,
@@ -157,6 +157,10 @@ def create(
157157
- `SINGLE_USE` - Card is closed upon first successful authorization.
158158
- `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
159159
successfully authorizes the card.
160+
- `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use
161+
VIRTUAL instead.
162+
- `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please
163+
use VIRTUAL instead.
160164
161165
account_token: Globally unique identifier for the account that the card will be associated
162166
with. Required for programs enrolling users using the
@@ -1006,7 +1010,7 @@ def with_streaming_response(self) -> AsyncCardsWithStreamingResponse:
10061010
async def create(
10071011
self,
10081012
*,
1009-
type: Literal["MERCHANT_LOCKED", "PHYSICAL", "SINGLE_USE", "VIRTUAL"],
1013+
type: Literal["MERCHANT_LOCKED", "PHYSICAL", "SINGLE_USE", "VIRTUAL", "UNLOCKED", "DIGITAL_WALLET"],
10101014
account_token: str | NotGiven = NOT_GIVEN,
10111015
card_program_token: str | NotGiven = NOT_GIVEN,
10121016
carrier: Carrier | NotGiven = NOT_GIVEN,
@@ -1050,6 +1054,10 @@ async def create(
10501054
- `SINGLE_USE` - Card is closed upon first successful authorization.
10511055
- `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
10521056
successfully authorizes the card.
1057+
- `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use
1058+
VIRTUAL instead.
1059+
- `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please
1060+
use VIRTUAL instead.
10531061
10541062
account_token: Globally unique identifier for the account that the card will be associated
10551063
with. Required for programs enrolling users using the

src/lithic/resources/transactions/transactions.py

Lines changed: 100 additions & 92 deletions
Large diffs are not rendered by default.

src/lithic/types/auth_rules/v2_apply_response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CurrentVersionParametersConditionalBlockParametersCondition(BaseModel):
7171
] = None
7272
"""The operation to apply to the attribute"""
7373

74-
value: Union[str, float, List[str], None] = None
74+
value: Union[str, int, List[str], None] = None
7575
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7676

7777

@@ -145,7 +145,7 @@ class DraftVersionParametersConditionalBlockParametersCondition(BaseModel):
145145
] = None
146146
"""The operation to apply to the attribute"""
147147

148-
value: Union[str, float, List[str], None] = None
148+
value: Union[str, int, List[str], None] = None
149149
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
150150

151151

@@ -169,6 +169,7 @@ class DraftVersion(BaseModel):
169169

170170
class V2ApplyResponse(BaseModel):
171171
token: str
172+
"""Auth Rule Token"""
172173

173174
account_tokens: List[str]
174175
"""Account tokens to which the Auth Rule applies."""

src/lithic/types/auth_rules/v2_create_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CreateAuthRuleRequestAccountTokensParametersConditionalBlockParametersCond
8383
operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"]
8484
"""The operation to apply to the attribute"""
8585

86-
value: Union[str, float, List[str]]
86+
value: Union[str, int, List[str]]
8787
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
8888

8989

@@ -155,7 +155,7 @@ class CreateAuthRuleRequestCardTokensParametersConditionalBlockParametersConditi
155155
operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"]
156156
"""The operation to apply to the attribute"""
157157

158-
value: Union[str, float, List[str]]
158+
value: Union[str, int, List[str]]
159159
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
160160

161161

@@ -227,7 +227,7 @@ class CreateAuthRuleRequestProgramLevelParametersConditionalBlockParametersCondi
227227
operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"]
228228
"""The operation to apply to the attribute"""
229229

230-
value: Union[str, float, List[str]]
230+
value: Union[str, int, List[str]]
231231
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
232232

233233

src/lithic/types/auth_rules/v2_create_response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CurrentVersionParametersConditionalBlockParametersCondition(BaseModel):
7171
] = None
7272
"""The operation to apply to the attribute"""
7373

74-
value: Union[str, float, List[str], None] = None
74+
value: Union[str, int, List[str], None] = None
7575
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7676

7777

@@ -145,7 +145,7 @@ class DraftVersionParametersConditionalBlockParametersCondition(BaseModel):
145145
] = None
146146
"""The operation to apply to the attribute"""
147147

148-
value: Union[str, float, List[str], None] = None
148+
value: Union[str, int, List[str], None] = None
149149
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
150150

151151

@@ -169,6 +169,7 @@ class DraftVersion(BaseModel):
169169

170170
class V2CreateResponse(BaseModel):
171171
token: str
172+
"""Auth Rule Token"""
172173

173174
account_tokens: List[str]
174175
"""Account tokens to which the Auth Rule applies."""

src/lithic/types/auth_rules/v2_draft_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ParametersConditionalBlockParametersCondition(TypedDict, total=False):
6868
operation: Literal["IS_ONE_OF", "IS_NOT_ONE_OF", "MATCHES", "DOES_NOT_MATCH", "IS_GREATER_THAN", "IS_LESS_THAN"]
6969
"""The operation to apply to the attribute"""
7070

71-
value: Union[str, float, List[str]]
71+
value: Union[str, int, List[str]]
7272
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7373

7474

src/lithic/types/auth_rules/v2_draft_response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CurrentVersionParametersConditionalBlockParametersCondition(BaseModel):
7171
] = None
7272
"""The operation to apply to the attribute"""
7373

74-
value: Union[str, float, List[str], None] = None
74+
value: Union[str, int, List[str], None] = None
7575
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7676

7777

@@ -145,7 +145,7 @@ class DraftVersionParametersConditionalBlockParametersCondition(BaseModel):
145145
] = None
146146
"""The operation to apply to the attribute"""
147147

148-
value: Union[str, float, List[str], None] = None
148+
value: Union[str, int, List[str], None] = None
149149
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
150150

151151

@@ -169,6 +169,7 @@ class DraftVersion(BaseModel):
169169

170170
class V2DraftResponse(BaseModel):
171171
token: str
172+
"""Auth Rule Token"""
172173

173174
account_tokens: List[str]
174175
"""Account tokens to which the Auth Rule applies."""

src/lithic/types/auth_rules/v2_list_response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CurrentVersionParametersConditionalBlockParametersCondition(BaseModel):
7171
] = None
7272
"""The operation to apply to the attribute"""
7373

74-
value: Union[str, float, List[str], None] = None
74+
value: Union[str, int, List[str], None] = None
7575
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7676

7777

@@ -145,7 +145,7 @@ class DraftVersionParametersConditionalBlockParametersCondition(BaseModel):
145145
] = None
146146
"""The operation to apply to the attribute"""
147147

148-
value: Union[str, float, List[str], None] = None
148+
value: Union[str, int, List[str], None] = None
149149
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
150150

151151

@@ -169,6 +169,7 @@ class DraftVersion(BaseModel):
169169

170170
class V2ListResponse(BaseModel):
171171
token: str
172+
"""Auth Rule Token"""
172173

173174
account_tokens: List[str]
174175
"""Account tokens to which the Auth Rule applies."""

src/lithic/types/auth_rules/v2_promote_response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CurrentVersionParametersConditionalBlockParametersCondition(BaseModel):
7171
] = None
7272
"""The operation to apply to the attribute"""
7373

74-
value: Union[str, float, List[str], None] = None
74+
value: Union[str, int, List[str], None] = None
7575
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7676

7777

@@ -145,7 +145,7 @@ class DraftVersionParametersConditionalBlockParametersCondition(BaseModel):
145145
] = None
146146
"""The operation to apply to the attribute"""
147147

148-
value: Union[str, float, List[str], None] = None
148+
value: Union[str, int, List[str], None] = None
149149
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
150150

151151

@@ -169,6 +169,7 @@ class DraftVersion(BaseModel):
169169

170170
class V2PromoteResponse(BaseModel):
171171
token: str
172+
"""Auth Rule Token"""
172173

173174
account_tokens: List[str]
174175
"""Account tokens to which the Auth Rule applies."""

src/lithic/types/auth_rules/v2_retrieve_response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CurrentVersionParametersConditionalBlockParametersCondition(BaseModel):
7171
] = None
7272
"""The operation to apply to the attribute"""
7373

74-
value: Union[str, float, List[str], None] = None
74+
value: Union[str, int, List[str], None] = None
7575
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
7676

7777

@@ -145,7 +145,7 @@ class DraftVersionParametersConditionalBlockParametersCondition(BaseModel):
145145
] = None
146146
"""The operation to apply to the attribute"""
147147

148-
value: Union[str, float, List[str], None] = None
148+
value: Union[str, int, List[str], None] = None
149149
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
150150

151151

@@ -169,6 +169,7 @@ class DraftVersion(BaseModel):
169169

170170
class V2RetrieveResponse(BaseModel):
171171
token: str
172+
"""Auth Rule Token"""
172173

173174
account_tokens: List[str]
174175
"""Account tokens to which the Auth Rule applies."""

0 commit comments

Comments
 (0)