gr4vy 1.1.29__py3-none-any.whl → 1.10.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. gr4vy/_version.py +3 -3
  2. gr4vy/account_updater.py +6 -3
  3. gr4vy/actions.py +307 -0
  4. gr4vy/all.py +4 -2
  5. gr4vy/audit_logs.py +6 -4
  6. gr4vy/balances.py +4 -2
  7. gr4vy/basesdk.py +17 -1
  8. gr4vy/buyers_gift_cards.py +4 -2
  9. gr4vy/buyers_payment_methods.py +4 -2
  10. gr4vy/buyers_sdk.py +43 -25
  11. gr4vy/buyers_shipping_details.py +26 -16
  12. gr4vy/card_scheme_definitions_sdk.py +4 -2
  13. gr4vy/checkout_sessions.py +40 -14
  14. gr4vy/digital_wallets_sdk.py +32 -20
  15. gr4vy/domains.py +14 -10
  16. gr4vy/errors/__init__.py +15 -3
  17. gr4vy/errors/apierror.py +2 -0
  18. gr4vy/errors/error400.py +4 -6
  19. gr4vy/errors/error401.py +4 -6
  20. gr4vy/errors/error403.py +4 -6
  21. gr4vy/errors/error404.py +4 -6
  22. gr4vy/errors/error405.py +4 -6
  23. gr4vy/errors/error409.py +4 -6
  24. gr4vy/errors/error425.py +4 -6
  25. gr4vy/errors/error429.py +4 -6
  26. gr4vy/errors/error500.py +4 -6
  27. gr4vy/errors/error502.py +4 -6
  28. gr4vy/errors/error504.py +4 -6
  29. gr4vy/errors/gr4vyerror.py +11 -7
  30. gr4vy/errors/httpvalidationerror.py +4 -2
  31. gr4vy/errors/no_response_error.py +5 -1
  32. gr4vy/errors/responsevalidationerror.py +2 -0
  33. gr4vy/events.py +54 -7
  34. gr4vy/executions.py +38 -8
  35. gr4vy/gift_cards_sdk.py +29 -19
  36. gr4vy/httpclient.py +0 -1
  37. gr4vy/jobs.py +4 -2
  38. gr4vy/merchant_accounts_sdk.py +30 -10
  39. gr4vy/models/__init__.py +184 -30
  40. gr4vy/models/adyenautorescuesepascenariosenum.py +3 -1
  41. gr4vy/models/adyencardoptions.py +9 -6
  42. gr4vy/models/adyensepaoptions.py +1 -6
  43. gr4vy/models/adyensplitsoptions.py +57 -0
  44. gr4vy/models/airline.py +9 -8
  45. gr4vy/models/airlineleg.py +9 -7
  46. gr4vy/models/airlinepassenger.py +9 -7
  47. gr4vy/models/antifrauddecision.py +9 -1
  48. gr4vy/models/approvaltarget.py +7 -1
  49. gr4vy/models/auditlogaction.py +9 -1
  50. gr4vy/models/auditlogentry.py +3 -3
  51. gr4vy/models/auditlogentryuser.py +3 -3
  52. gr4vy/models/{billingdetails_input.py → billingdetails.py} +2 -2
  53. gr4vy/models/braintreedynamicdatafieldsoptions.py +33 -3
  54. gr4vy/models/browserinfo.py +9 -5
  55. gr4vy/models/buyer.py +3 -3
  56. gr4vy/models/buyercreate.py +3 -3
  57. gr4vy/models/buyerupdate.py +3 -3
  58. gr4vy/models/cancel_transactionop.py +43 -0
  59. gr4vy/models/cancelstatus.py +15 -0
  60. gr4vy/models/capturestatus.py +7 -1
  61. gr4vy/models/cardtype.py +8 -1
  62. gr4vy/models/cartitem.py +53 -8
  63. gr4vy/models/chaseoptions.py +46 -0
  64. gr4vy/models/checkoutsession.py +24 -3
  65. gr4vy/models/checkoutsessioncreate.py +39 -5
  66. gr4vy/models/checkoutsessionpaymentmethod.py +3 -5
  67. gr4vy/models/checkoutsessionpaymentmethoddetails.py +2 -6
  68. gr4vy/models/create_payment_methodop.py +6 -0
  69. gr4vy/models/create_report_execution_urlop.py +16 -1
  70. gr4vy/models/createsession.py +3 -3
  71. gr4vy/models/createsessionstatus.py +7 -1
  72. gr4vy/models/cvvresponsecode.py +7 -1
  73. gr4vy/models/cybersourceoptions.py +7 -0
  74. gr4vy/models/definitionfield.py +1 -6
  75. gr4vy/models/definitionfieldformat.py +8 -1
  76. gr4vy/models/digitalwallet.py +3 -5
  77. gr4vy/models/digitalwalletcreate.py +2 -6
  78. gr4vy/models/digitalwalletprovider.py +6 -1
  79. gr4vy/models/dlocalupioptions.py +50 -0
  80. gr4vy/models/dlocalupirecurringinfooptions.py +47 -0
  81. gr4vy/models/dlocalupiwalletoptions.py +89 -0
  82. gr4vy/models/errordetail.py +2 -4
  83. gr4vy/models/errorlocation.py +8 -1
  84. gr4vy/models/flow.py +16 -0
  85. gr4vy/models/flowaction.py +16 -0
  86. gr4vy/models/forterantifraudoptions.py +8 -8
  87. gr4vy/models/forterantifraudoptionscartitembasicitemdata.py +10 -8
  88. gr4vy/models/forterantifraudoptionscartitemdeliverydetails.py +9 -7
  89. gr4vy/models/giftcardredemption.py +4 -8
  90. gr4vy/models/giftcardredemptionstatus.py +7 -1
  91. gr4vy/models/giftcardservice.py +3 -5
  92. gr4vy/models/giftcardserviceprovider.py +5 -1
  93. gr4vy/models/giftcardsummary.py +3 -5
  94. gr4vy/models/{guestbuyer_input.py → guestbuyer.py} +5 -5
  95. gr4vy/models/instrumenttype.py +1 -0
  96. gr4vy/models/integrationclient.py +16 -0
  97. gr4vy/models/internal/__init__.py +14 -1
  98. gr4vy/models/list_all_report_executionsop.py +2 -14
  99. gr4vy/models/list_audit_logsop.py +2 -10
  100. gr4vy/models/list_buyer_payment_methodsop.py +9 -4
  101. gr4vy/models/list_payment_methodsop.py +2 -14
  102. gr4vy/models/list_payment_servicesop.py +2 -8
  103. gr4vy/models/list_reportsop.py +2 -10
  104. gr4vy/models/list_transaction_actionsop.py +43 -0
  105. gr4vy/models/list_transaction_eventsop.py +12 -1
  106. gr4vy/models/list_transactionsop.py +14 -22
  107. gr4vy/models/merchantaccount.py +9 -5
  108. gr4vy/models/merchantaccountcreate.py +8 -6
  109. gr4vy/models/merchantaccountupdate.py +8 -6
  110. gr4vy/models/merchantprofilescheme.py +7 -7
  111. gr4vy/models/merchantprofileschemesummary.py +7 -7
  112. gr4vy/models/method.py +4 -0
  113. gr4vy/models/mockcardoptions.py +7 -2
  114. gr4vy/models/mode.py +1 -0
  115. gr4vy/models/monatospeioptions.py +15 -0
  116. gr4vy/models/networktoken.py +3 -3
  117. gr4vy/models/networktokenpaymentmethodcreate.py +11 -9
  118. gr4vy/models/networktokenstatus.py +7 -1
  119. gr4vy/models/nuveiidealoptions.py +49 -0
  120. gr4vy/models/nuveipseoptions.py +70 -0
  121. gr4vy/models/paymentlink.py +25 -7
  122. gr4vy/models/paymentlinkcreate.py +23 -28
  123. gr4vy/models/paymentlinkstatus.py +7 -1
  124. gr4vy/models/paymentmethod.py +7 -13
  125. gr4vy/models/paymentmethodcard.py +3 -5
  126. gr4vy/models/paymentmethoddetailscard.py +2 -6
  127. gr4vy/models/paymentmethodstatus.py +7 -1
  128. gr4vy/models/paymentmethodsummary.py +6 -12
  129. gr4vy/models/paymentoption.py +3 -3
  130. gr4vy/models/paymentservice.py +4 -6
  131. gr4vy/models/paymentserviceconfiguration.py +2 -6
  132. gr4vy/models/paymentservicedefinition.py +11 -5
  133. gr4vy/models/paymentservicestatus.py +8 -1
  134. gr4vy/models/paymentservicetoken.py +3 -3
  135. gr4vy/models/payoutcategory.py +1 -1
  136. gr4vy/models/payoutcreate.py +5 -9
  137. gr4vy/models/payoutstatus.py +7 -1
  138. gr4vy/models/payoutsummary.py +4 -6
  139. gr4vy/models/paypaloptions.py +8 -2
  140. gr4vy/models/paypalshippingoptions.py +51 -0
  141. gr4vy/models/paypalshippingoptionsitem.py +89 -0
  142. gr4vy/models/paypalshippingoptionsitemamount.py +20 -0
  143. gr4vy/models/plaidpaymentmethodcreate.py +106 -0
  144. gr4vy/models/redirectpaymentmethodcreate.py +4 -6
  145. gr4vy/models/refund.py +4 -4
  146. gr4vy/models/refundstatus.py +8 -1
  147. gr4vy/models/refundtargettype.py +5 -1
  148. gr4vy/models/report.py +4 -6
  149. gr4vy/models/reportcreate.py +2 -3
  150. gr4vy/models/reportcreatortype.py +7 -1
  151. gr4vy/models/reportexecution.py +3 -3
  152. gr4vy/models/reportexecutionstatus.py +7 -1
  153. gr4vy/models/reportexecutionsummary.py +3 -3
  154. gr4vy/models/reportexecutionurlgenerate.py +16 -0
  155. gr4vy/models/reportschedule.py +9 -1
  156. gr4vy/models/reportspec.py +2 -4
  157. gr4vy/models/reportsummary.py +3 -5
  158. gr4vy/models/settlement.py +32 -32
  159. gr4vy/models/statementdescriptor.py +7 -0
  160. gr4vy/models/stripeconnectoptions.py +7 -0
  161. gr4vy/models/taxid.py +2 -4
  162. gr4vy/models/taxidkind.py +7 -0
  163. gr4vy/models/threedsecuredatav1.py +2 -6
  164. gr4vy/models/threedsecuredatav2.py +2 -6
  165. gr4vy/models/threedsecuremethod.py +7 -1
  166. gr4vy/models/threedsecurestatus.py +7 -1
  167. gr4vy/models/transaction.py +86 -25
  168. gr4vy/models/transactionaction.py +48 -0
  169. gr4vy/models/transactionactions.py +17 -0
  170. gr4vy/models/transactionbuyer.py +3 -3
  171. gr4vy/models/transactioncancel.py +81 -0
  172. gr4vy/models/transactioncapture.py +3 -3
  173. gr4vy/models/transactionconnectionoptions.py +50 -0
  174. gr4vy/models/transactioncreate.py +76 -12
  175. gr4vy/models/transactionevent.py +10 -3
  176. gr4vy/models/transactionintent.py +7 -1
  177. gr4vy/models/transactionintentoutcome.py +6 -1
  178. gr4vy/models/transactionpaymentmethod.py +6 -12
  179. gr4vy/models/transactionpaymentservice.py +3 -3
  180. gr4vy/models/transactionpaymentsource.py +7 -1
  181. gr4vy/models/transactionrefundcreate.py +2 -6
  182. gr4vy/models/transactionsummary.py +11 -10
  183. gr4vy/models/transactionthreedsecuresummary.py +3 -9
  184. gr4vy/models/transactionvoid.py +3 -3
  185. gr4vy/models/userstatus.py +8 -1
  186. gr4vy/models/voidstatus.py +7 -1
  187. gr4vy/network_tokens_cryptogram.py +4 -2
  188. gr4vy/payment_links_sdk.py +36 -16
  189. gr4vy/payment_methods_network_tokens.py +27 -13
  190. gr4vy/payment_methods_payment_service_tokens.py +12 -6
  191. gr4vy/payment_methods_sdk.py +26 -14
  192. gr4vy/payment_options_sdk.py +4 -2
  193. gr4vy/payment_service_definitions_sdk.py +14 -8
  194. gr4vy/payment_services_sdk.py +36 -22
  195. gr4vy/payouts.py +18 -12
  196. gr4vy/refunds_sdk.py +4 -2
  197. gr4vy/report_executions_sdk.py +6 -4
  198. gr4vy/reports_sdk.py +23 -13
  199. gr4vy/sdk.py +17 -4
  200. gr4vy/sessions.py +12 -6
  201. gr4vy/transactions.py +446 -33
  202. gr4vy/transactions_refunds.py +17 -9
  203. gr4vy/transactions_settlements.py +8 -4
  204. gr4vy/types/basemodel.py +41 -3
  205. gr4vy/utils/__init__.py +15 -6
  206. gr4vy/utils/annotations.py +32 -8
  207. gr4vy/utils/enums.py +60 -0
  208. gr4vy/utils/eventstreaming.py +10 -0
  209. gr4vy/utils/forms.py +21 -10
  210. gr4vy/utils/queryparams.py +14 -2
  211. gr4vy/utils/requestbodies.py +1 -1
  212. gr4vy/utils/retries.py +69 -5
  213. gr4vy/utils/serializers.py +0 -20
  214. gr4vy/utils/unmarshal_json_response.py +15 -1
  215. {gr4vy-1.1.29.dist-info → gr4vy-1.10.9.dist-info}/METADATA +43 -41
  216. {gr4vy-1.1.29.dist-info → gr4vy-1.10.9.dist-info}/RECORD +217 -196
  217. {gr4vy-1.1.29.dist-info → gr4vy-1.10.9.dist-info}/WHEEL +1 -1
  218. gr4vy/models/billingdetails_output.py +0 -87
  219. gr4vy/models/guestbuyer_output.py +0 -80
@@ -0,0 +1,89 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .dlocalupirecurringinfooptions import (
5
+ DlocalUPIRecurringInfoOptions,
6
+ DlocalUPIRecurringInfoOptionsTypedDict,
7
+ )
8
+ from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
9
+ from pydantic import model_serializer
10
+ from typing_extensions import NotRequired, TypedDict
11
+
12
+
13
+ class DlocalUPIWalletOptionsTypedDict(TypedDict):
14
+ name: NotRequired[Nullable[str]]
15
+ r"""Passes `wallet.name` to the dLocal API for those connectors that need it."""
16
+ email: NotRequired[Nullable[str]]
17
+ r"""Passes `wallet.email` to the dLocal API for those connectors that need it."""
18
+ token: NotRequired[Nullable[str]]
19
+ r"""Passes `wallet.token` to the dLocal API for those connectors that need it."""
20
+ username: NotRequired[Nullable[str]]
21
+ r"""Passes `wallet.username` to the dLocal API for those connectors that need it."""
22
+ verify: NotRequired[Nullable[bool]]
23
+ r"""Passes `wallet.verify` to the dLocal API for those connectors that need it."""
24
+ recurring_info: NotRequired[Nullable[DlocalUPIRecurringInfoOptionsTypedDict]]
25
+ r"""Passes `wallet.recurring_info` to the dLocal API for those connectors that need it."""
26
+
27
+
28
+ class DlocalUPIWalletOptions(BaseModel):
29
+ name: OptionalNullable[str] = UNSET
30
+ r"""Passes `wallet.name` to the dLocal API for those connectors that need it."""
31
+
32
+ email: OptionalNullable[str] = UNSET
33
+ r"""Passes `wallet.email` to the dLocal API for those connectors that need it."""
34
+
35
+ token: OptionalNullable[str] = UNSET
36
+ r"""Passes `wallet.token` to the dLocal API for those connectors that need it."""
37
+
38
+ username: OptionalNullable[str] = UNSET
39
+ r"""Passes `wallet.username` to the dLocal API for those connectors that need it."""
40
+
41
+ verify: OptionalNullable[bool] = UNSET
42
+ r"""Passes `wallet.verify` to the dLocal API for those connectors that need it."""
43
+
44
+ recurring_info: OptionalNullable[DlocalUPIRecurringInfoOptions] = UNSET
45
+ r"""Passes `wallet.recurring_info` to the dLocal API for those connectors that need it."""
46
+
47
+ @model_serializer(mode="wrap")
48
+ def serialize_model(self, handler):
49
+ optional_fields = [
50
+ "name",
51
+ "email",
52
+ "token",
53
+ "username",
54
+ "verify",
55
+ "recurring_info",
56
+ ]
57
+ nullable_fields = [
58
+ "name",
59
+ "email",
60
+ "token",
61
+ "username",
62
+ "verify",
63
+ "recurring_info",
64
+ ]
65
+ null_default_fields = []
66
+
67
+ serialized = handler(self)
68
+
69
+ m = {}
70
+
71
+ for n, f in type(self).model_fields.items():
72
+ k = f.alias or n
73
+ val = serialized.get(k)
74
+ serialized.pop(k, None)
75
+
76
+ optional_nullable = k in optional_fields and k in nullable_fields
77
+ is_set = (
78
+ self.__pydantic_fields_set__.intersection({n})
79
+ or k in null_default_fields
80
+ ) # pylint: disable=no-member
81
+
82
+ if val is not None and val != UNSET_SENTINEL:
83
+ m[k] = val
84
+ elif val != UNSET_SENTINEL and (
85
+ not k in optional_fields or (optional_nullable and is_set)
86
+ ):
87
+ m[k] = val
88
+
89
+ return m
@@ -3,9 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .errorlocation import ErrorLocation
5
5
  from gr4vy.types import BaseModel
6
- from gr4vy.utils import validate_open_enum
7
- from pydantic.functional_validators import PlainValidator
8
- from typing_extensions import Annotated, TypedDict
6
+ from typing_extensions import TypedDict
9
7
 
10
8
 
11
9
  class ErrorDetailTypedDict(TypedDict):
@@ -19,7 +17,7 @@ class ErrorDetailTypedDict(TypedDict):
19
17
 
20
18
 
21
19
  class ErrorDetail(BaseModel):
22
- location: Annotated[ErrorLocation, PlainValidator(validate_open_enum(False))]
20
+ location: ErrorLocation
23
21
 
24
22
  pointer: str
25
23
  r"""A JSON pointer for the particular property that caused the error."""
@@ -6,5 +6,12 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  ErrorLocation = Union[
9
- Literal["query", "body", "path", "header", "unknown"], UnrecognizedStr
9
+ Literal[
10
+ "query",
11
+ "body",
12
+ "path",
13
+ "header",
14
+ "unknown",
15
+ ],
16
+ UnrecognizedStr,
10
17
  ]
gr4vy/models/flow.py ADDED
@@ -0,0 +1,16 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import UnrecognizedStr
5
+ from typing import Literal, Union
6
+
7
+
8
+ Flow = Union[
9
+ Literal[
10
+ "checkout",
11
+ "card-transaction",
12
+ "non-card-transaction",
13
+ "redirect-transaction",
14
+ ],
15
+ UnrecognizedStr,
16
+ ]
@@ -0,0 +1,16 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import UnrecognizedStr
5
+ from typing import Literal, Union
6
+
7
+
8
+ FlowAction = Union[
9
+ Literal[
10
+ "select-payment-options",
11
+ "route-transaction",
12
+ "decline-early",
13
+ "skip-3ds",
14
+ ],
15
+ UnrecognizedStr,
16
+ ]
@@ -17,15 +17,18 @@ from gr4vy.types import (
17
17
  UNSET_SENTINEL,
18
18
  UnrecognizedStr,
19
19
  )
20
- from gr4vy.utils import validate_open_enum
21
20
  from pydantic import model_serializer
22
- from pydantic.functional_validators import PlainValidator
23
21
  from typing import List, Literal, Union
24
- from typing_extensions import Annotated, NotRequired, TypedDict
22
+ from typing_extensions import NotRequired, TypedDict
25
23
 
26
24
 
27
25
  ForterAntiFraudOptionsDeliveryType = Union[
28
- Literal["DIGITAL", "PHYSICAL", "HYBRID"], UnrecognizedStr
26
+ Literal[
27
+ "DIGITAL",
28
+ "PHYSICAL",
29
+ "HYBRID",
30
+ ],
31
+ UnrecognizedStr,
29
32
  ]
30
33
 
31
34
 
@@ -43,10 +46,7 @@ class ForterAntiFraudOptionsTypedDict(TypedDict):
43
46
 
44
47
 
45
48
  class ForterAntiFraudOptions(BaseModel):
46
- delivery_type: Annotated[
47
- OptionalNullable[ForterAntiFraudOptionsDeliveryType],
48
- PlainValidator(validate_open_enum(False)),
49
- ] = UNSET
49
+ delivery_type: OptionalNullable[ForterAntiFraudOptionsDeliveryType] = UNSET
50
50
  r"""The delivery type"""
51
51
 
52
52
  delivery_method: OptionalNullable[str] = UNSET
@@ -9,25 +9,27 @@ from gr4vy.types import (
9
9
  UNSET_SENTINEL,
10
10
  UnrecognizedStr,
11
11
  )
12
- from gr4vy.utils import validate_open_enum
13
12
  from pydantic import model_serializer
14
- from pydantic.functional_validators import PlainValidator
15
13
  from typing import Literal, Union
16
- from typing_extensions import Annotated, NotRequired, TypedDict
14
+ from typing_extensions import NotRequired, TypedDict
17
15
 
18
16
 
19
- Type = Union[Literal["TANGIBLE", "NON_TANGIBLE"], UnrecognizedStr]
17
+ ForterAntiFraudOptionsCartItemBasicItemDataType = Union[
18
+ Literal[
19
+ "TANGIBLE",
20
+ "NON_TANGIBLE",
21
+ ],
22
+ UnrecognizedStr,
23
+ ]
20
24
 
21
25
 
22
26
  class ForterAntiFraudOptionsCartItemBasicItemDataTypedDict(TypedDict):
23
- type: NotRequired[Nullable[Type]]
27
+ type: NotRequired[Nullable[ForterAntiFraudOptionsCartItemBasicItemDataType]]
24
28
  r"""Indicates whether the item is a physical good or a service/digital item."""
25
29
 
26
30
 
27
31
  class ForterAntiFraudOptionsCartItemBasicItemData(BaseModel):
28
- type: Annotated[
29
- OptionalNullable[Type], PlainValidator(validate_open_enum(False))
30
- ] = UNSET
32
+ type: OptionalNullable[ForterAntiFraudOptionsCartItemBasicItemDataType] = UNSET
31
33
  r"""Indicates whether the item is a physical good or a service/digital item."""
32
34
 
33
35
  @model_serializer(mode="wrap")
@@ -9,15 +9,18 @@ from gr4vy.types import (
9
9
  UNSET_SENTINEL,
10
10
  UnrecognizedStr,
11
11
  )
12
- from gr4vy.utils import validate_open_enum
13
12
  from pydantic import model_serializer
14
- from pydantic.functional_validators import PlainValidator
15
13
  from typing import Literal, Union
16
- from typing_extensions import Annotated, NotRequired, TypedDict
14
+ from typing_extensions import NotRequired, TypedDict
17
15
 
18
16
 
19
17
  ForterAntiFraudOptionsCartItemDeliveryDetailsDeliveryType = Union[
20
- Literal["DIGITAL", "PHYSICAL", "HYBRID"], UnrecognizedStr
18
+ Literal[
19
+ "DIGITAL",
20
+ "PHYSICAL",
21
+ "HYBRID",
22
+ ],
23
+ UnrecognizedStr,
21
24
  ]
22
25
 
23
26
 
@@ -31,9 +34,8 @@ class ForterAntiFraudOptionsCartItemDeliveryDetailsTypedDict(TypedDict):
31
34
 
32
35
 
33
36
  class ForterAntiFraudOptionsCartItemDeliveryDetails(BaseModel):
34
- delivery_type: Annotated[
35
- OptionalNullable[ForterAntiFraudOptionsCartItemDeliveryDetailsDeliveryType],
36
- PlainValidator(validate_open_enum(False)),
37
+ delivery_type: OptionalNullable[
38
+ ForterAntiFraudOptionsCartItemDeliveryDetailsDeliveryType
37
39
  ] = UNSET
38
40
  r"""The type of delivery for this cart item."""
39
41
 
@@ -5,10 +5,10 @@ from .giftcarderrorcode import GiftCardErrorCode
5
5
  from .giftcardredemptionstatus import GiftCardRedemptionStatus
6
6
  from .transactiongiftcard import TransactionGiftCard, TransactionGiftCardTypedDict
7
7
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
8
- from gr4vy.utils import validate_const, validate_open_enum
8
+ from gr4vy.utils import validate_const
9
9
  import pydantic
10
10
  from pydantic import model_serializer
11
- from pydantic.functional_validators import AfterValidator, PlainValidator
11
+ from pydantic.functional_validators import AfterValidator
12
12
  from typing import Literal, Optional
13
13
  from typing_extensions import Annotated, NotRequired, TypedDict
14
14
 
@@ -38,9 +38,7 @@ class GiftCardRedemption(BaseModel):
38
38
  id: str
39
39
  r"""The ID for the gift card redemption."""
40
40
 
41
- status: Annotated[
42
- GiftCardRedemptionStatus, PlainValidator(validate_open_enum(False))
43
- ]
41
+ status: GiftCardRedemptionStatus
44
42
 
45
43
  amount: int
46
44
  r"""The amount redeemed for this gift card."""
@@ -62,9 +60,7 @@ class GiftCardRedemption(BaseModel):
62
60
  gift_card_service_redemption_id: OptionalNullable[str] = UNSET
63
61
  r"""The gift card service's unique ID for the redemption."""
64
62
 
65
- error_code: Annotated[
66
- OptionalNullable[GiftCardErrorCode], PlainValidator(validate_open_enum(False))
67
- ] = UNSET
63
+ error_code: OptionalNullable[GiftCardErrorCode] = UNSET
68
64
  r"""If this gift card redemption resulted in an error, this will contain the internal code for the error."""
69
65
 
70
66
  raw_error_code: OptionalNullable[str] = UNSET
@@ -6,5 +6,11 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  GiftCardRedemptionStatus = Union[
9
- Literal["created", "succeeded", "failed", "skipped"], UnrecognizedStr
9
+ Literal[
10
+ "created",
11
+ "succeeded",
12
+ "failed",
13
+ "skipped",
14
+ ],
15
+ UnrecognizedStr,
10
16
  ]
@@ -3,9 +3,9 @@
3
3
  from __future__ import annotations
4
4
  from .giftcardserviceprovider import GiftCardServiceProvider
5
5
  from gr4vy.types import BaseModel
6
- from gr4vy.utils import validate_const, validate_open_enum
6
+ from gr4vy.utils import validate_const
7
7
  import pydantic
8
- from pydantic.functional_validators import AfterValidator, PlainValidator
8
+ from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional
10
10
  from typing_extensions import Annotated, TypedDict
11
11
 
@@ -24,9 +24,7 @@ class GiftCardService(BaseModel):
24
24
  id: str
25
25
  r"""The ID for the gift card service."""
26
26
 
27
- gift_card_service_definition_id: Annotated[
28
- GiftCardServiceProvider, PlainValidator(validate_open_enum(False))
29
- ]
27
+ gift_card_service_definition_id: GiftCardServiceProvider
30
28
 
31
29
  display_name: str
32
30
  r"""The display name for the gift card service."""
@@ -6,5 +6,9 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  GiftCardServiceProvider = Union[
9
- Literal["mock-gift-card", "qwikcilver-gift-card"], UnrecognizedStr
9
+ Literal[
10
+ "mock-gift-card",
11
+ "qwikcilver-gift-card",
12
+ ],
13
+ UnrecognizedStr,
10
14
  ]
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .giftcarderrorcode import GiftCardErrorCode
5
5
  from datetime import datetime
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import validate_const, validate_open_enum
7
+ from gr4vy.utils import validate_const
8
8
  import pydantic
9
9
  from pydantic import model_serializer
10
- from pydantic.functional_validators import AfterValidator, PlainValidator
10
+ from pydantic.functional_validators import AfterValidator
11
11
  from typing import Literal, Optional
12
12
  from typing_extensions import Annotated, NotRequired, TypedDict
13
13
 
@@ -72,9 +72,7 @@ class GiftCardSummary(BaseModel):
72
72
  balance: OptionalNullable[int] = UNSET
73
73
  r"""The amount remaining on the balance for this gift card according to the gift card service. This may be `null` if the balance could not be fetched."""
74
74
 
75
- balance_error_code: Annotated[
76
- OptionalNullable[GiftCardErrorCode], PlainValidator(validate_open_enum(False))
77
- ] = UNSET
75
+ balance_error_code: OptionalNullable[GiftCardErrorCode] = UNSET
78
76
  r"""If the last balance update failed, this will contain the internal code for this error."""
79
77
 
80
78
  balance_raw_error_code: OptionalNullable[str] = UNSET
@@ -1,19 +1,19 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .billingdetails_input import BillingDetailsInput, BillingDetailsInputTypedDict
4
+ from .billingdetails import BillingDetails, BillingDetailsTypedDict
5
5
  from .shippingdetailscreate import ShippingDetailsCreate, ShippingDetailsCreateTypedDict
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
7
  from pydantic import model_serializer
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- class GuestBuyerInputTypedDict(TypedDict):
11
+ class GuestBuyerTypedDict(TypedDict):
12
12
  display_name: NotRequired[Nullable[str]]
13
13
  r"""The display name for the buyer."""
14
14
  external_identifier: NotRequired[Nullable[str]]
15
15
  r"""The merchant identifier for this buyer."""
16
- billing_details: NotRequired[Nullable[BillingDetailsInputTypedDict]]
16
+ billing_details: NotRequired[Nullable[BillingDetailsTypedDict]]
17
17
  r"""The billing name, address, email, and other fields for this buyer."""
18
18
  account_number: NotRequired[Nullable[str]]
19
19
  r"""The buyer account number"""
@@ -21,14 +21,14 @@ class GuestBuyerInputTypedDict(TypedDict):
21
21
  r"""The optional shipping details for this buyer."""
22
22
 
23
23
 
24
- class GuestBuyerInput(BaseModel):
24
+ class GuestBuyer(BaseModel):
25
25
  display_name: OptionalNullable[str] = UNSET
26
26
  r"""The display name for the buyer."""
27
27
 
28
28
  external_identifier: OptionalNullable[str] = UNSET
29
29
  r"""The merchant identifier for this buyer."""
30
30
 
31
- billing_details: OptionalNullable[BillingDetailsInput] = UNSET
31
+ billing_details: OptionalNullable[BillingDetails] = UNSET
32
32
  r"""The billing name, address, email, and other fields for this buyer."""
33
33
 
34
34
  account_number: OptionalNullable[str] = UNSET
@@ -14,6 +14,7 @@ InstrumentType = Union[
14
14
  "googlepay",
15
15
  "applepay",
16
16
  "network_token",
17
+ "plaid",
17
18
  ],
18
19
  UnrecognizedStr,
19
20
  ]
@@ -0,0 +1,16 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import UnrecognizedStr
5
+ from typing import Literal, Union
6
+
7
+
8
+ IntegrationClient = Union[
9
+ Literal[
10
+ "redirect",
11
+ "web",
12
+ "android",
13
+ "ios",
14
+ ],
15
+ UnrecognizedStr,
16
+ ]
@@ -3,6 +3,7 @@
3
3
  from typing import TYPE_CHECKING
4
4
  from importlib import import_module
5
5
  import builtins
6
+ import sys
6
7
 
7
8
  if TYPE_CHECKING:
8
9
  from .globals import Globals, GlobalsTypedDict
@@ -15,6 +16,18 @@ _dynamic_imports: dict[str, str] = {
15
16
  }
16
17
 
17
18
 
19
+ def dynamic_import(modname, retries=3):
20
+ for attempt in range(retries):
21
+ try:
22
+ return import_module(modname, __package__)
23
+ except KeyError:
24
+ # Clear any half-initialized module and retry
25
+ sys.modules.pop(modname, None)
26
+ if attempt == retries - 1:
27
+ break
28
+ raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
29
+
30
+
18
31
  def __getattr__(attr_name: str) -> object:
19
32
  module_name = _dynamic_imports.get(attr_name)
20
33
  if module_name is None:
@@ -23,7 +36,7 @@ def __getattr__(attr_name: str) -> object:
23
36
  )
24
37
 
25
38
  try:
26
- module = import_module(module_name, __package__)
39
+ module = dynamic_import(module_name)
27
40
  result = getattr(module, attr_name)
28
41
  return result
29
42
  except ImportError as e:
@@ -5,15 +5,9 @@ from .reportexecutions import ReportExecutions, ReportExecutionsTypedDict
5
5
  from .reportexecutionstatus import ReportExecutionStatus
6
6
  from datetime import datetime
7
7
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
8
- from gr4vy.utils import (
9
- FieldMetadata,
10
- HeaderMetadata,
11
- QueryParamMetadata,
12
- validate_open_enum,
13
- )
8
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
14
9
  import pydantic
15
10
  from pydantic import model_serializer
16
- from pydantic.functional_validators import PlainValidator
17
11
  from typing import Callable, List, Optional
18
12
  from typing_extensions import Annotated, NotRequired, TypedDict
19
13
 
@@ -83,13 +77,7 @@ class ListAllReportExecutionsRequest(BaseModel):
83
77
  r"""Filters the results to only reports created after this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. `2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`."""
84
78
 
85
79
  status: Annotated[
86
- OptionalNullable[
87
- List[
88
- Annotated[
89
- ReportExecutionStatus, PlainValidator(validate_open_enum(False))
90
- ]
91
- ]
92
- ],
80
+ OptionalNullable[List[ReportExecutionStatus]],
93
81
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
94
82
  ] = UNSET
95
83
  r"""Filters the results to only the reports that have a `status` that matches with any of the provided status values."""
@@ -4,15 +4,9 @@ from __future__ import annotations
4
4
  from .auditlogaction import AuditLogAction
5
5
  from .auditlogentries import AuditLogEntries, AuditLogEntriesTypedDict
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import (
8
- FieldMetadata,
9
- HeaderMetadata,
10
- QueryParamMetadata,
11
- validate_open_enum,
12
- )
7
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
13
8
  import pydantic
14
9
  from pydantic import model_serializer
15
- from pydantic.functional_validators import PlainValidator
16
10
  from typing import Callable, Optional
17
11
  from typing_extensions import Annotated, NotRequired, TypedDict
18
12
 
@@ -60,9 +54,7 @@ class ListAuditLogsRequest(BaseModel):
60
54
  r"""The maximum number of items that are at returned."""
61
55
 
62
56
  action: Annotated[
63
- Annotated[
64
- OptionalNullable[AuditLogAction], PlainValidator(validate_open_enum(False))
65
- ],
57
+ OptionalNullable[AuditLogAction],
66
58
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
67
59
  ] = UNSET
68
60
  r"""Filters the results to only the items for which the `audit-log` has an `action` that matches this value."""
@@ -14,11 +14,10 @@ from gr4vy.utils import (
14
14
  HeaderMetadata,
15
15
  QueryParamMetadata,
16
16
  validate_const,
17
- validate_open_enum,
18
17
  )
19
18
  import pydantic
20
19
  from pydantic import model_serializer
21
- from pydantic.functional_validators import AfterValidator, PlainValidator
20
+ from pydantic.functional_validators import AfterValidator
22
21
  from typing import Literal, Optional, Union
23
22
  from typing_extensions import Annotated, NotRequired, TypedDict
24
23
 
@@ -37,7 +36,13 @@ class ListBuyerPaymentMethodsGlobals(BaseModel):
37
36
  r"""The ID of the merchant account to use for this request."""
38
37
 
39
38
 
40
- OrderBy = Union[Literal["asc", "desc"], UnrecognizedStr]
39
+ OrderBy = Union[
40
+ Literal[
41
+ "asc",
42
+ "desc",
43
+ ],
44
+ UnrecognizedStr,
45
+ ]
41
46
  r"""The direction to sort the payment methods in."""
42
47
 
43
48
 
@@ -82,7 +87,7 @@ class ListBuyerPaymentMethodsRequest(BaseModel):
82
87
  r"""The field to sort the payment methods by."""
83
88
 
84
89
  order_by: Annotated[
85
- Annotated[Optional[OrderBy], PlainValidator(validate_open_enum(False))],
90
+ Optional[OrderBy],
86
91
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
87
92
  ] = "desc"
88
93
  r"""The direction to sort the payment methods in."""
@@ -4,15 +4,9 @@ from __future__ import annotations
4
4
  from .paymentmethods import PaymentMethods, PaymentMethodsTypedDict
5
5
  from .paymentmethodstatus import PaymentMethodStatus
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import (
8
- FieldMetadata,
9
- HeaderMetadata,
10
- QueryParamMetadata,
11
- validate_open_enum,
12
- )
7
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
13
8
  import pydantic
14
9
  from pydantic import model_serializer
15
- from pydantic.functional_validators import PlainValidator
16
10
  from typing import Callable, List, Optional
17
11
  from typing_extensions import Annotated, NotRequired, TypedDict
18
12
 
@@ -73,13 +67,7 @@ class ListPaymentMethodsRequest(BaseModel):
73
67
  r"""The external identifier of the buyer to filter payment methods by."""
74
68
 
75
69
  status: Annotated[
76
- OptionalNullable[
77
- List[
78
- Annotated[
79
- PaymentMethodStatus, PlainValidator(validate_open_enum(False))
80
- ]
81
- ]
82
- ],
70
+ OptionalNullable[List[PaymentMethodStatus]],
83
71
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
84
72
  ] = UNSET
85
73
 
@@ -4,15 +4,9 @@ from __future__ import annotations
4
4
  from .method import Method
5
5
  from .paymentservices import PaymentServices, PaymentServicesTypedDict
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import (
8
- FieldMetadata,
9
- HeaderMetadata,
10
- QueryParamMetadata,
11
- validate_open_enum,
12
- )
7
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
13
8
  import pydantic
14
9
  from pydantic import model_serializer
15
- from pydantic.functional_validators import PlainValidator
16
10
  from typing import Callable, Optional
17
11
  from typing_extensions import Annotated, NotRequired, TypedDict
18
12
 
@@ -46,7 +40,7 @@ class ListPaymentServicesRequestTypedDict(TypedDict):
46
40
 
47
41
  class ListPaymentServicesRequest(BaseModel):
48
42
  method: Annotated[
49
- Annotated[OptionalNullable[Method], PlainValidator(validate_open_enum(False))],
43
+ OptionalNullable[Method],
50
44
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
51
45
  ] = UNSET
52
46
  r"""Return any payment service for this method."""
@@ -4,15 +4,9 @@ from __future__ import annotations
4
4
  from .reports import Reports, ReportsTypedDict
5
5
  from .reportschedule import ReportSchedule
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import (
8
- FieldMetadata,
9
- HeaderMetadata,
10
- QueryParamMetadata,
11
- validate_open_enum,
12
- )
7
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
13
8
  import pydantic
14
9
  from pydantic import model_serializer
15
- from pydantic.functional_validators import PlainValidator
16
10
  from typing import Callable, List, Optional
17
11
  from typing_extensions import Annotated, NotRequired, TypedDict
18
12
 
@@ -60,9 +54,7 @@ class ListReportsRequest(BaseModel):
60
54
  r"""The maximum number of items that are at returned."""
61
55
 
62
56
  schedule: Annotated[
63
- OptionalNullable[
64
- List[Annotated[ReportSchedule, PlainValidator(validate_open_enum(False))]]
65
- ],
57
+ OptionalNullable[List[ReportSchedule]],
66
58
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
67
59
  ] = UNSET
68
60
  r"""Filters the reports by the type of schedule at which they run."""