Skip to content

Commit 75159c4

Browse files
feat(api): add Google WPP to SDKs
docs(api): clarify error 422 for 3DS challenge response feat(api): add IS_AFTER / IS_BEFORE operators to Auth Rule APIs
1 parent d297283 commit 75159c4

13 files changed

+146
-39
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 175
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-3e50857d2b8f4c85922abf83df7b3c6894f5bd500d6226ff589476029bbb258b.yml
3-
openapi_spec_hash: 6bef8b283eb7292ad6f3f62d40fda699
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml
3+
openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f
44
config_hash: ba3fbfc99a1b8635d9e79e9e49d12952

src/lithic/resources/cards/cards.py

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import json
77
import base64
88
import hashlib
9-
from typing import Union
9+
from typing import Any, Union, cast
1010
from datetime import datetime, timezone, timedelta
1111
from typing_extensions import Literal
1212

@@ -1193,7 +1193,10 @@ def web_provision(
11931193
self,
11941194
card_token: str,
11951195
*,
1196-
digital_wallet: Literal["APPLE_PAY"] | Omit = omit,
1196+
client_device_id: str | Omit = omit,
1197+
client_wallet_account_id: str | Omit = omit,
1198+
digital_wallet: Literal["APPLE_PAY", "GOOGLE_PAY"] | Omit = omit,
1199+
server_session_id: str | Omit = omit,
11971200
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11981201
# The extra values given here take precedence over values defined on the client or passed to this method.
11991202
extra_headers: Headers | None = None,
@@ -1210,8 +1213,17 @@ def web_provision(
12101213
for more information.
12111214
12121215
Args:
1216+
client_device_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
1217+
Provisioning device identifier required for the tokenization flow
1218+
1219+
client_wallet_account_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
1220+
Provisioning wallet account identifier required for the tokenization flow
1221+
12131222
digital_wallet: Name of digital wallet provider.
12141223
1224+
server_session_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
1225+
Provisioning session identifier required for the FPAN flow.
1226+
12151227
extra_headers: Send extra headers
12161228
12171229
extra_query: Add additional query parameters to the request
@@ -1222,13 +1234,26 @@ def web_provision(
12221234
"""
12231235
if not card_token:
12241236
raise ValueError(f"Expected a non-empty value for `card_token` but received {card_token!r}")
1225-
return self._post(
1226-
f"/v1/cards/{card_token}/web_provision",
1227-
body=maybe_transform({"digital_wallet": digital_wallet}, card_web_provision_params.CardWebProvisionParams),
1228-
options=make_request_options(
1229-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1237+
return cast(
1238+
CardWebProvisionResponse,
1239+
self._post(
1240+
f"/v1/cards/{card_token}/web_provision",
1241+
body=maybe_transform(
1242+
{
1243+
"client_device_id": client_device_id,
1244+
"client_wallet_account_id": client_wallet_account_id,
1245+
"digital_wallet": digital_wallet,
1246+
"server_session_id": server_session_id,
1247+
},
1248+
card_web_provision_params.CardWebProvisionParams,
1249+
),
1250+
options=make_request_options(
1251+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1252+
),
1253+
cast_to=cast(
1254+
Any, CardWebProvisionResponse
1255+
), # Union types cannot be passed in as arguments in the type system
12301256
),
1231-
cast_to=CardWebProvisionResponse,
12321257
)
12331258

12341259

@@ -2354,7 +2379,10 @@ async def web_provision(
23542379
self,
23552380
card_token: str,
23562381
*,
2357-
digital_wallet: Literal["APPLE_PAY"] | Omit = omit,
2382+
client_device_id: str | Omit = omit,
2383+
client_wallet_account_id: str | Omit = omit,
2384+
digital_wallet: Literal["APPLE_PAY", "GOOGLE_PAY"] | Omit = omit,
2385+
server_session_id: str | Omit = omit,
23582386
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
23592387
# The extra values given here take precedence over values defined on the client or passed to this method.
23602388
extra_headers: Headers | None = None,
@@ -2371,8 +2399,17 @@ async def web_provision(
23712399
for more information.
23722400
23732401
Args:
2402+
client_device_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
2403+
Provisioning device identifier required for the tokenization flow
2404+
2405+
client_wallet_account_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
2406+
Provisioning wallet account identifier required for the tokenization flow
2407+
23742408
digital_wallet: Name of digital wallet provider.
23752409
2410+
server_session_id: Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push
2411+
Provisioning session identifier required for the FPAN flow.
2412+
23762413
extra_headers: Send extra headers
23772414
23782415
extra_query: Add additional query parameters to the request
@@ -2383,15 +2420,26 @@ async def web_provision(
23832420
"""
23842421
if not card_token:
23852422
raise ValueError(f"Expected a non-empty value for `card_token` but received {card_token!r}")
2386-
return await self._post(
2387-
f"/v1/cards/{card_token}/web_provision",
2388-
body=await async_maybe_transform(
2389-
{"digital_wallet": digital_wallet}, card_web_provision_params.CardWebProvisionParams
2390-
),
2391-
options=make_request_options(
2392-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
2423+
return cast(
2424+
CardWebProvisionResponse,
2425+
await self._post(
2426+
f"/v1/cards/{card_token}/web_provision",
2427+
body=await async_maybe_transform(
2428+
{
2429+
"client_device_id": client_device_id,
2430+
"client_wallet_account_id": client_wallet_account_id,
2431+
"digital_wallet": digital_wallet,
2432+
"server_session_id": server_session_id,
2433+
},
2434+
card_web_provision_params.CardWebProvisionParams,
2435+
),
2436+
options=make_request_options(
2437+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
2438+
),
2439+
cast_to=cast(
2440+
Any, CardWebProvisionResponse
2441+
), # Union types cannot be passed in as arguments in the type system
23932442
),
2394-
cast_to=CardWebProvisionResponse,
23952443
)
23962444

23972445

src/lithic/types/auth_rules/auth_rule_condition_param.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Required, Annotated, TypedDict
66

7+
from ..._utils import PropertyInfo
78
from .conditional_attribute import ConditionalAttribute
89
from .conditional_operation import ConditionalOperation
910
from .conditional_value_param import ConditionalValueParam
@@ -68,5 +69,5 @@ class AuthRuleConditionParam(TypedDict, total=False):
6869
operation: Required[ConditionalOperation]
6970
"""The operation to apply to the attribute"""
7071

71-
value: Required[ConditionalValueParam]
72+
value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]]
7273
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""

src/lithic/types/auth_rules/conditional_3ds_action_parameters_param.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from __future__ import annotations
44

55
from typing import Iterable
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypedDict
77

8+
from ..._utils import PropertyInfo
89
from .conditional_operation import ConditionalOperation
910
from .conditional_value_param import ConditionalValueParam
1011

@@ -54,7 +55,7 @@ class Condition(TypedDict, total=False):
5455
operation: Required[ConditionalOperation]
5556
"""The operation to apply to the attribute"""
5657

57-
value: Required[ConditionalValueParam]
58+
value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]]
5859
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
5960

6061

src/lithic/types/auth_rules/conditional_ach_action_parameters_param.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from __future__ import annotations
44

55
from typing import Union, Iterable
6-
from typing_extensions import Literal, Required, TypeAlias, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

8+
from ..._utils import PropertyInfo
89
from .conditional_operation import ConditionalOperation
910
from .conditional_value_param import ConditionalValueParam
1011

@@ -126,7 +127,7 @@ class Condition(TypedDict, total=False):
126127
operation: Required[ConditionalOperation]
127128
"""The operation to apply to the attribute"""
128129

129-
value: Required[ConditionalValueParam]
130+
value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]]
130131
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
131132

132133

src/lithic/types/auth_rules/conditional_authorization_action_parameters_param.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from __future__ import annotations
44

55
from typing import Iterable
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypedDict
77

8+
from ..._utils import PropertyInfo
89
from .conditional_operation import ConditionalOperation
910
from .conditional_value_param import ConditionalValueParam
1011

@@ -94,7 +95,7 @@ class Condition(TypedDict, total=False):
9495
operation: Required[ConditionalOperation]
9596
"""The operation to apply to the attribute"""
9697

97-
value: Required[ConditionalValueParam]
98+
value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]]
9899
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
99100

100101

src/lithic/types/auth_rules/conditional_operation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"IS_GREATER_THAN_OR_EQUAL_TO",
1616
"IS_LESS_THAN",
1717
"IS_LESS_THAN_OR_EQUAL_TO",
18+
"IS_AFTER",
19+
"IS_BEFORE",
1820
"CONTAINS_ANY",
1921
"CONTAINS_ALL",
2022
"CONTAINS_NONE",

src/lithic/types/auth_rules/conditional_tokenization_action_parameters_param.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from __future__ import annotations
44

55
from typing import Union, Iterable
6-
from typing_extensions import Literal, Required, TypeAlias, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

8+
from ..._utils import PropertyInfo
89
from .conditional_operation import ConditionalOperation
910
from .conditional_value_param import ConditionalValueParam
1011

@@ -118,7 +119,7 @@ class Condition(TypedDict, total=False):
118119
operation: Required[ConditionalOperation]
119120
"""The operation to apply to the attribute"""
120121

121-
value: Required[ConditionalValueParam]
122+
value: Required[Annotated[ConditionalValueParam, PropertyInfo(format="iso8601")]]
122123
"""A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
123124

124125

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import List, Union
4+
from datetime import datetime
45
from typing_extensions import TypeAlias
56

67
__all__ = ["ConditionalValue"]
78

8-
ConditionalValue: TypeAlias = Union[str, int, List[str]]
9+
ConditionalValue: TypeAlias = Union[str, int, List[str], datetime]

src/lithic/types/auth_rules/conditional_value_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from __future__ import annotations
44

55
from typing import Union
6+
from datetime import datetime
67
from typing_extensions import TypeAlias
78

89
from ..._types import SequenceNotStr
910

1011
__all__ = ["ConditionalValueParam"]
1112

12-
ConditionalValueParam: TypeAlias = Union[str, int, SequenceNotStr[str]]
13+
ConditionalValueParam: TypeAlias = Union[str, int, SequenceNotStr[str], Union[str, datetime]]

0 commit comments

Comments
 (0)