gr4vy 1.5.2__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 (169) hide show
  1. gr4vy/_version.py +3 -3
  2. gr4vy/actions.py +307 -0
  3. gr4vy/all.py +4 -2
  4. gr4vy/audit_logs.py +4 -2
  5. gr4vy/balances.py +4 -2
  6. gr4vy/basesdk.py +6 -0
  7. gr4vy/buyers_gift_cards.py +4 -2
  8. gr4vy/buyers_payment_methods.py +4 -2
  9. gr4vy/buyers_sdk.py +28 -18
  10. gr4vy/buyers_shipping_details.py +20 -10
  11. gr4vy/card_scheme_definitions_sdk.py +4 -2
  12. gr4vy/checkout_sessions.py +40 -14
  13. gr4vy/digital_wallets_sdk.py +20 -10
  14. gr4vy/domains.py +8 -4
  15. gr4vy/errors/apierror.py +1 -1
  16. gr4vy/errors/error400.py +1 -5
  17. gr4vy/errors/error401.py +1 -5
  18. gr4vy/errors/error403.py +1 -5
  19. gr4vy/errors/error404.py +1 -5
  20. gr4vy/errors/error405.py +1 -5
  21. gr4vy/errors/error409.py +1 -5
  22. gr4vy/errors/error425.py +1 -5
  23. gr4vy/errors/error429.py +1 -5
  24. gr4vy/errors/error500.py +1 -5
  25. gr4vy/errors/error502.py +1 -5
  26. gr4vy/errors/error504.py +1 -5
  27. gr4vy/errors/gr4vyerror.py +1 -1
  28. gr4vy/errors/httpvalidationerror.py +1 -1
  29. gr4vy/errors/no_response_error.py +1 -1
  30. gr4vy/errors/responsevalidationerror.py +1 -1
  31. gr4vy/events.py +54 -7
  32. gr4vy/executions.py +12 -6
  33. gr4vy/gift_cards_sdk.py +16 -8
  34. gr4vy/jobs.py +4 -2
  35. gr4vy/merchant_accounts_sdk.py +16 -8
  36. gr4vy/models/__init__.py +103 -29
  37. gr4vy/models/adyencardoptions.py +1 -6
  38. gr4vy/models/adyensepaoptions.py +1 -6
  39. gr4vy/models/airline.py +2 -7
  40. gr4vy/models/airlineleg.py +2 -6
  41. gr4vy/models/airlinepassenger.py +2 -6
  42. gr4vy/models/auditlogentry.py +3 -3
  43. gr4vy/models/auditlogentryuser.py +3 -3
  44. gr4vy/models/{billingdetails_input.py → billingdetails.py} +2 -2
  45. gr4vy/models/braintreedynamicdatafieldsoptions.py +2 -7
  46. gr4vy/models/browserinfo.py +2 -4
  47. gr4vy/models/buyer.py +3 -3
  48. gr4vy/models/buyercreate.py +3 -3
  49. gr4vy/models/buyerupdate.py +3 -3
  50. gr4vy/models/cartitem.py +9 -6
  51. gr4vy/models/chaseoptions.py +46 -0
  52. gr4vy/models/checkoutsession.py +24 -3
  53. gr4vy/models/checkoutsessioncreate.py +39 -5
  54. gr4vy/models/checkoutsessionpaymentmethod.py +3 -5
  55. gr4vy/models/checkoutsessionpaymentmethoddetails.py +2 -6
  56. gr4vy/models/create_payment_methodop.py +6 -0
  57. gr4vy/models/createsession.py +3 -3
  58. gr4vy/models/cybersourceoptions.py +7 -0
  59. gr4vy/models/definitionfield.py +1 -6
  60. gr4vy/models/digitalwallet.py +3 -5
  61. gr4vy/models/digitalwalletcreate.py +2 -6
  62. gr4vy/models/dlocalupirecurringinfooptions.py +13 -15
  63. gr4vy/models/errordetail.py +2 -4
  64. gr4vy/models/flow.py +16 -0
  65. gr4vy/models/flowaction.py +16 -0
  66. gr4vy/models/forterantifraudoptions.py +2 -7
  67. gr4vy/models/forterantifraudoptionscartitembasicitemdata.py +4 -8
  68. gr4vy/models/forterantifraudoptionscartitemdeliverydetails.py +3 -6
  69. gr4vy/models/giftcardredemption.py +4 -8
  70. gr4vy/models/giftcardservice.py +3 -5
  71. gr4vy/models/giftcardsummary.py +3 -5
  72. gr4vy/models/{guestbuyer_input.py → guestbuyer.py} +5 -5
  73. gr4vy/models/instrumenttype.py +1 -0
  74. gr4vy/models/integrationclient.py +16 -0
  75. gr4vy/models/list_all_report_executionsop.py +2 -14
  76. gr4vy/models/list_audit_logsop.py +2 -10
  77. gr4vy/models/list_buyer_payment_methodsop.py +2 -3
  78. gr4vy/models/list_payment_methodsop.py +2 -14
  79. gr4vy/models/list_payment_servicesop.py +2 -8
  80. gr4vy/models/list_reportsop.py +2 -10
  81. gr4vy/models/list_transaction_actionsop.py +43 -0
  82. gr4vy/models/list_transaction_eventsop.py +12 -1
  83. gr4vy/models/list_transactionsop.py +4 -22
  84. gr4vy/models/merchantaccount.py +3 -5
  85. gr4vy/models/merchantaccountcreate.py +2 -6
  86. gr4vy/models/merchantaccountupdate.py +2 -6
  87. gr4vy/models/method.py +3 -0
  88. gr4vy/models/mockcardoptions.py +7 -2
  89. gr4vy/models/mode.py +1 -0
  90. gr4vy/models/monatospeioptions.py +15 -0
  91. gr4vy/models/networktoken.py +3 -3
  92. gr4vy/models/networktokenpaymentmethodcreate.py +4 -8
  93. gr4vy/models/nuveiidealoptions.py +49 -0
  94. gr4vy/models/paymentlink.py +18 -7
  95. gr4vy/models/paymentlinkcreate.py +23 -37
  96. gr4vy/models/paymentmethod.py +7 -13
  97. gr4vy/models/paymentmethodcard.py +3 -5
  98. gr4vy/models/paymentmethoddetailscard.py +2 -6
  99. gr4vy/models/paymentmethodsummary.py +6 -12
  100. gr4vy/models/paymentoption.py +3 -3
  101. gr4vy/models/paymentservice.py +4 -6
  102. gr4vy/models/paymentserviceconfiguration.py +2 -6
  103. gr4vy/models/paymentservicedefinition.py +11 -5
  104. gr4vy/models/paymentservicetoken.py +3 -3
  105. gr4vy/models/payoutcreate.py +5 -9
  106. gr4vy/models/payoutsummary.py +4 -6
  107. gr4vy/models/paypaloptions.py +8 -2
  108. gr4vy/models/paypalshippingoptions.py +51 -0
  109. gr4vy/models/paypalshippingoptionsitem.py +89 -0
  110. gr4vy/models/paypalshippingoptionsitemamount.py +20 -0
  111. gr4vy/models/plaidpaymentmethodcreate.py +106 -0
  112. gr4vy/models/redirectpaymentmethodcreate.py +3 -6
  113. gr4vy/models/refund.py +4 -4
  114. gr4vy/models/report.py +4 -6
  115. gr4vy/models/reportcreate.py +2 -3
  116. gr4vy/models/reportexecution.py +3 -3
  117. gr4vy/models/reportexecutionsummary.py +3 -3
  118. gr4vy/models/reportspec.py +2 -4
  119. gr4vy/models/reportsummary.py +3 -5
  120. gr4vy/models/taxid.py +2 -4
  121. gr4vy/models/taxidkind.py +6 -0
  122. gr4vy/models/threedsecuredatav1.py +2 -6
  123. gr4vy/models/threedsecuredatav2.py +2 -6
  124. gr4vy/models/transaction.py +74 -25
  125. gr4vy/models/transactionaction.py +48 -0
  126. gr4vy/models/transactionactions.py +17 -0
  127. gr4vy/models/transactionbuyer.py +3 -3
  128. gr4vy/models/transactioncancel.py +3 -3
  129. gr4vy/models/transactioncapture.py +3 -3
  130. gr4vy/models/transactionconnectionoptions.py +30 -0
  131. gr4vy/models/transactioncreate.py +27 -12
  132. gr4vy/models/transactionevent.py +5 -3
  133. gr4vy/models/transactionpaymentmethod.py +6 -12
  134. gr4vy/models/transactionpaymentservice.py +3 -3
  135. gr4vy/models/transactionrefundcreate.py +2 -6
  136. gr4vy/models/transactionsummary.py +6 -10
  137. gr4vy/models/transactionthreedsecuresummary.py +3 -9
  138. gr4vy/models/transactionvoid.py +3 -3
  139. gr4vy/models/trustlyoptions.py +2 -9
  140. gr4vy/network_tokens_cryptogram.py +4 -2
  141. gr4vy/payment_links_sdk.py +34 -14
  142. gr4vy/payment_methods_network_tokens.py +20 -10
  143. gr4vy/payment_methods_payment_service_tokens.py +12 -6
  144. gr4vy/payment_methods_sdk.py +16 -8
  145. gr4vy/payment_options_sdk.py +4 -2
  146. gr4vy/payment_service_definitions_sdk.py +12 -6
  147. gr4vy/payment_services_sdk.py +28 -14
  148. gr4vy/payouts.py +16 -10
  149. gr4vy/refunds_sdk.py +4 -2
  150. gr4vy/report_executions_sdk.py +4 -2
  151. gr4vy/reports_sdk.py +16 -8
  152. gr4vy/sessions.py +12 -6
  153. gr4vy/transactions.py +99 -28
  154. gr4vy/transactions_refunds.py +12 -6
  155. gr4vy/transactions_settlements.py +8 -4
  156. gr4vy/types/basemodel.py +41 -3
  157. gr4vy/utils/__init__.py +0 -3
  158. gr4vy/utils/enums.py +60 -0
  159. gr4vy/utils/forms.py +21 -10
  160. gr4vy/utils/queryparams.py +14 -2
  161. gr4vy/utils/requestbodies.py +1 -1
  162. gr4vy/utils/retries.py +69 -5
  163. gr4vy/utils/serializers.py +0 -20
  164. gr4vy/utils/unmarshal_json_response.py +15 -1
  165. {gr4vy-1.5.2.dist-info → gr4vy-1.10.9.dist-info}/METADATA +39 -39
  166. {gr4vy-1.5.2.dist-info → gr4vy-1.10.9.dist-info}/RECORD +167 -155
  167. gr4vy/models/billingdetails_output.py +0 -87
  168. gr4vy/models/guestbuyer_output.py +0 -80
  169. {gr4vy-1.5.2.dist-info → gr4vy-1.10.9.dist-info}/WHEEL +0 -0
@@ -10,10 +10,10 @@ from gr4vy.types import (
10
10
  UNSET_SENTINEL,
11
11
  UnrecognizedStr,
12
12
  )
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import Literal, Union
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -71,14 +71,10 @@ class NetworkTokenPaymentMethodCreate(BaseModel):
71
71
  redirect_url: OptionalNullable[str] = UNSET
72
72
  r"""The URL to redirect a user back to after the complete 3DS in browser."""
73
73
 
74
- card_source: Annotated[
75
- OptionalNullable[CardSource], PlainValidator(validate_open_enum(False))
76
- ] = UNSET
74
+ card_source: OptionalNullable[CardSource] = UNSET
77
75
  r"""The optional source of the decrypted device token."""
78
76
 
79
- card_scheme: Annotated[
80
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
81
- ] = UNSET
77
+ card_scheme: OptionalNullable[CardScheme] = UNSET
82
78
  r"""The original card scheme for which the token was generated."""
83
79
 
84
80
  card_suffix: OptionalNullable[str] = UNSET
@@ -0,0 +1,49 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
+ import pydantic
6
+ from pydantic import model_serializer
7
+ from typing_extensions import Annotated, NotRequired, TypedDict
8
+
9
+
10
+ class NuveiIDealOptionsTypedDict(TypedDict):
11
+ custom_data: NotRequired[Nullable[str]]
12
+ r"""Additional data to be sent to Nuvei."""
13
+
14
+
15
+ class NuveiIDealOptions(BaseModel):
16
+ custom_data: Annotated[
17
+ OptionalNullable[str], pydantic.Field(alias="customData")
18
+ ] = UNSET
19
+ r"""Additional data to be sent to Nuvei."""
20
+
21
+ @model_serializer(mode="wrap")
22
+ def serialize_model(self, handler):
23
+ optional_fields = ["customData"]
24
+ nullable_fields = ["customData"]
25
+ null_default_fields = []
26
+
27
+ serialized = handler(self)
28
+
29
+ m = {}
30
+
31
+ for n, f in type(self).model_fields.items():
32
+ k = f.alias or n
33
+ val = serialized.get(k)
34
+ serialized.pop(k, None)
35
+
36
+ optional_nullable = k in optional_fields and k in nullable_fields
37
+ is_set = (
38
+ self.__pydantic_fields_set__.intersection({n})
39
+ or k in null_default_fields
40
+ ) # pylint: disable=no-member
41
+
42
+ if val is not None and val != UNSET_SENTINEL:
43
+ m[k] = val
44
+ elif val != UNSET_SENTINEL and (
45
+ not k in optional_fields or (optional_nullable and is_set)
46
+ ):
47
+ m[k] = val
48
+
49
+ return m
@@ -10,10 +10,10 @@ from .transactionintent import TransactionIntent
10
10
  from .transactionpaymentsource import TransactionPaymentSource
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import Any, Dict, List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -73,6 +73,10 @@ class PaymentLinkTypedDict(TypedDict):
73
73
  r"""The shipping details for the payment link."""
74
74
  connection_options: NotRequired[Nullable[Dict[str, Dict[str, Any]]]]
75
75
  r"""The connection options for the payment link."""
76
+ store: NotRequired[bool]
77
+ r"""Whether the payment method was stored."""
78
+ buyer_id: NotRequired[Nullable[str]]
79
+ r"""The ID of the buyer to associate with the stored payment method."""
76
80
 
77
81
 
78
82
  class PaymentLink(BaseModel):
@@ -91,14 +95,12 @@ class PaymentLink(BaseModel):
91
95
  currency: str
92
96
  r"""The currency code for the payment link."""
93
97
 
94
- intent: Annotated[TransactionIntent, PlainValidator(validate_open_enum(False))]
98
+ intent: TransactionIntent
95
99
 
96
100
  cart_items: Nullable[List[CartItem]]
97
101
  r"""The cart items for the payment link."""
98
102
 
99
- payment_source: Annotated[
100
- TransactionPaymentSource, PlainValidator(validate_open_enum(False))
101
- ]
103
+ payment_source: TransactionPaymentSource
102
104
  r"""The way payment method information made it to this transaction."""
103
105
 
104
106
  created_at: datetime
@@ -107,7 +109,7 @@ class PaymentLink(BaseModel):
107
109
  updated_at: datetime
108
110
  r"""The date and time the payment link was last updated."""
109
111
 
110
- status: Annotated[PaymentLinkStatus, PlainValidator(validate_open_enum(False))]
112
+ status: PaymentLinkStatus
111
113
 
112
114
  TYPE: Annotated[
113
115
  Annotated[
@@ -166,6 +168,12 @@ class PaymentLink(BaseModel):
166
168
  connection_options: OptionalNullable[Dict[str, Dict[str, Any]]] = UNSET
167
169
  r"""The connection options for the payment link."""
168
170
 
171
+ store: Optional[bool] = False
172
+ r"""Whether the payment method was stored."""
173
+
174
+ buyer_id: OptionalNullable[str] = UNSET
175
+ r"""The ID of the buyer to associate with the stored payment method."""
176
+
169
177
  @model_serializer(mode="wrap")
170
178
  def serialize_model(self, handler):
171
179
  optional_fields = [
@@ -186,6 +194,8 @@ class PaymentLink(BaseModel):
186
194
  "buyer",
187
195
  "shipping_details",
188
196
  "connection_options",
197
+ "store",
198
+ "buyer_id",
189
199
  ]
190
200
  nullable_fields = [
191
201
  "expires_at",
@@ -205,6 +215,7 @@ class PaymentLink(BaseModel):
205
215
  "buyer",
206
216
  "shipping_details",
207
217
  "connection_options",
218
+ "buyer_id",
208
219
  ]
209
220
  null_default_fields = []
210
221
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .cartitem import CartItem, CartItemTypedDict
5
- from .guestbuyer_input import GuestBuyerInput, GuestBuyerInputTypedDict
5
+ from .guestbuyer import GuestBuyer, GuestBuyerTypedDict
6
6
  from .statementdescriptor import StatementDescriptor, StatementDescriptorTypedDict
7
7
  from .transactionconnectionoptions import (
8
8
  TransactionConnectionOptions,
@@ -11,31 +11,10 @@ from .transactionconnectionoptions import (
11
11
  from .transactionintent import TransactionIntent
12
12
  from .transactionpaymentsource import TransactionPaymentSource
13
13
  from datetime import datetime
14
- from gr4vy.types import (
15
- BaseModel,
16
- Nullable,
17
- OptionalNullable,
18
- UNSET,
19
- UNSET_SENTINEL,
20
- UnrecognizedStr,
21
- )
22
- from gr4vy.utils import validate_open_enum
14
+ from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
23
15
  from pydantic import model_serializer
24
- from pydantic.functional_validators import PlainValidator
25
- from typing import Any, Dict, List, Literal, Optional, Union
26
- from typing_extensions import Annotated, NotRequired, TypedDict
27
-
28
-
29
- Locale = Union[
30
- Literal[
31
- "en",
32
- "en-GB",
33
- "pt",
34
- "pt-BR",
35
- "es",
36
- ],
37
- UnrecognizedStr,
38
- ]
16
+ from typing import Any, Dict, List, Optional
17
+ from typing_extensions import NotRequired, TypedDict
39
18
 
40
19
 
41
20
  class PaymentLinkCreateTypedDict(TypedDict):
@@ -45,7 +24,7 @@ class PaymentLinkCreateTypedDict(TypedDict):
45
24
  r"""The country code for the payment link."""
46
25
  currency: str
47
26
  r"""The currency code for the payment link."""
48
- buyer: NotRequired[Nullable[GuestBuyerInputTypedDict]]
27
+ buyer: NotRequired[Nullable[GuestBuyerTypedDict]]
49
28
  r"""The guest buyer for the payment link."""
50
29
  expires_at: NotRequired[Nullable[datetime]]
51
30
  r"""The expiration date and time for the payment link."""
@@ -55,7 +34,7 @@ class PaymentLinkCreateTypedDict(TypedDict):
55
34
  r"""The merchant reference for the payment link."""
56
35
  statement_descriptor: NotRequired[Nullable[StatementDescriptorTypedDict]]
57
36
  r"""The statement descriptor for the payment link."""
58
- locale: NotRequired[Nullable[Locale]]
37
+ locale: NotRequired[Nullable[str]]
59
38
  r"""The locale for the payment link."""
60
39
  merchant_name: NotRequired[Nullable[str]]
61
40
  r"""The merchant's display name."""
@@ -80,6 +59,10 @@ class PaymentLinkCreateTypedDict(TypedDict):
80
59
  r"""Arbitrary metadata for the payment link."""
81
60
  payment_source: NotRequired[TransactionPaymentSource]
82
61
  r"""The way payment method information made it to this transaction."""
62
+ store: NotRequired[bool]
63
+ r"""Whether to store the payment method for future use."""
64
+ buyer_id: NotRequired[Nullable[str]]
65
+ r"""The ID of the buyer to associate the payment method with. Note: When `buyer_id` is provided, the payment link should be treated as a secret as it will allow the user to manage payment methods for the associated buyer."""
83
66
 
84
67
 
85
68
  class PaymentLinkCreate(BaseModel):
@@ -92,7 +75,7 @@ class PaymentLinkCreate(BaseModel):
92
75
  currency: str
93
76
  r"""The currency code for the payment link."""
94
77
 
95
- buyer: OptionalNullable[GuestBuyerInput] = UNSET
78
+ buyer: OptionalNullable[GuestBuyer] = UNSET
96
79
  r"""The guest buyer for the payment link."""
97
80
 
98
81
  expires_at: OptionalNullable[datetime] = UNSET
@@ -107,9 +90,7 @@ class PaymentLinkCreate(BaseModel):
107
90
  statement_descriptor: OptionalNullable[StatementDescriptor] = UNSET
108
91
  r"""The statement descriptor for the payment link."""
109
92
 
110
- locale: Annotated[
111
- OptionalNullable[Locale], PlainValidator(validate_open_enum(False))
112
- ] = UNSET
93
+ locale: OptionalNullable[str] = UNSET
113
94
  r"""The locale for the payment link."""
114
95
 
115
96
  merchant_name: OptionalNullable[str] = UNSET
@@ -133,9 +114,7 @@ class PaymentLinkCreate(BaseModel):
133
114
  merchant_favicon_url: OptionalNullable[str] = UNSET
134
115
  r"""URL to the merchant's favicon."""
135
116
 
136
- intent: Annotated[
137
- Optional[TransactionIntent], PlainValidator(validate_open_enum(False))
138
- ] = None
117
+ intent: Optional[TransactionIntent] = None
139
118
 
140
119
  return_url: OptionalNullable[str] = UNSET
141
120
  r"""The return URL after payment completion."""
@@ -146,11 +125,15 @@ class PaymentLinkCreate(BaseModel):
146
125
  metadata: OptionalNullable[Dict[str, Any]] = UNSET
147
126
  r"""Arbitrary metadata for the payment link."""
148
127
 
149
- payment_source: Annotated[
150
- Optional[TransactionPaymentSource], PlainValidator(validate_open_enum(False))
151
- ] = None
128
+ payment_source: Optional[TransactionPaymentSource] = None
152
129
  r"""The way payment method information made it to this transaction."""
153
130
 
131
+ store: Optional[bool] = False
132
+ r"""Whether to store the payment method for future use."""
133
+
134
+ buyer_id: OptionalNullable[str] = UNSET
135
+ r"""The ID of the buyer to associate the payment method with. Note: When `buyer_id` is provided, the payment link should be treated as a secret as it will allow the user to manage payment methods for the associated buyer."""
136
+
154
137
  @model_serializer(mode="wrap")
155
138
  def serialize_model(self, handler):
156
139
  optional_fields = [
@@ -172,6 +155,8 @@ class PaymentLinkCreate(BaseModel):
172
155
  "cart_items",
173
156
  "metadata",
174
157
  "payment_source",
158
+ "store",
159
+ "buyer_id",
175
160
  ]
176
161
  nullable_fields = [
177
162
  "buyer",
@@ -190,6 +175,7 @@ class PaymentLinkCreate(BaseModel):
190
175
  "return_url",
191
176
  "cart_items",
192
177
  "metadata",
178
+ "buyer_id",
193
179
  ]
194
180
  null_default_fields = []
195
181
 
@@ -12,10 +12,10 @@ from .paymentmethoddetailscard import (
12
12
  from .paymentmethodstatus import PaymentMethodStatus
13
13
  from datetime import datetime
14
14
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from gr4vy.utils import validate_const, validate_open_enum
15
+ from gr4vy.utils import validate_const
16
16
  import pydantic
17
17
  from pydantic import model_serializer
18
- from pydantic.functional_validators import AfterValidator, PlainValidator
18
+ from pydantic.functional_validators import AfterValidator
19
19
  from typing import List, Literal, Optional
20
20
  from typing_extensions import Annotated, NotRequired, TypedDict
21
21
 
@@ -82,7 +82,7 @@ class PaymentMethod(BaseModel):
82
82
  A stored payment method.
83
83
  """
84
84
 
85
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
85
+ method: Method
86
86
 
87
87
  id: str
88
88
  r"""The ID for the payment method."""
@@ -99,7 +99,7 @@ class PaymentMethod(BaseModel):
99
99
  usage_count: int
100
100
  r"""The number of times this payment method has been used in transactions."""
101
101
 
102
- status: Annotated[PaymentMethodStatus, PlainValidator(validate_open_enum(False))]
102
+ status: PaymentMethodStatus
103
103
 
104
104
  created_at: datetime
105
105
  r"""The date and time when this payment method was first created in our system."""
@@ -140,19 +140,13 @@ class PaymentMethod(BaseModel):
140
140
  last_replaced_at: OptionalNullable[datetime] = UNSET
141
141
  r"""The date and time when this card was last replaced by the account updater."""
142
142
 
143
- mode: Annotated[
144
- OptionalNullable[Mode], PlainValidator(validate_open_enum(False))
145
- ] = UNSET
143
+ mode: OptionalNullable[Mode] = UNSET
146
144
  r"""The mode to use with this payment method."""
147
145
 
148
- scheme: Annotated[
149
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
150
- ] = UNSET
146
+ scheme: OptionalNullable[CardScheme] = UNSET
151
147
  r"""The scheme of the card. Only applies to card payments."""
152
148
 
153
- additional_schemes: OptionalNullable[
154
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
155
- ] = UNSET
149
+ additional_schemes: OptionalNullable[List[CardScheme]] = UNSET
156
150
  r"""Additional schemes of the card besides the primary scheme. Only applies to card payment methods."""
157
151
 
158
152
  cit_last_used_at: OptionalNullable[datetime] = UNSET
@@ -3,10 +3,10 @@
3
3
  from __future__ import annotations
4
4
  from .cardscheme import CardScheme
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_const, validate_open_enum
6
+ from gr4vy.utils import validate_const
7
7
  import pydantic
8
8
  from pydantic import model_serializer
9
- from pydantic.functional_validators import AfterValidator, PlainValidator
9
+ from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional
11
11
  from typing_extensions import Annotated, NotRequired, TypedDict
12
12
 
@@ -37,9 +37,7 @@ class PaymentMethodCard(BaseModel):
37
37
  ] = "card"
38
38
  r"""Set to `card` to use a new card."""
39
39
 
40
- card_scheme: Annotated[
41
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
42
- ] = UNSET
40
+ card_scheme: OptionalNullable[CardScheme] = UNSET
43
41
  r"""The optional card's network scheme."""
44
42
 
45
43
  external_identifier: OptionalNullable[str] = UNSET
@@ -3,10 +3,8 @@
3
3
  from __future__ import annotations
4
4
  from .cardtype import CardType
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_open_enum
7
6
  from pydantic import model_serializer
8
- from pydantic.functional_validators import PlainValidator
9
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import NotRequired, TypedDict
10
8
 
11
9
 
12
10
  class PaymentMethodDetailsCardTypedDict(TypedDict):
@@ -18,9 +16,7 @@ class PaymentMethodDetailsCardTypedDict(TypedDict):
18
16
  class PaymentMethodDetailsCard(BaseModel):
19
17
  bin: OptionalNullable[str] = UNSET
20
18
 
21
- card_type: Annotated[
22
- OptionalNullable[CardType], PlainValidator(validate_open_enum(False))
23
- ] = UNSET
19
+ card_type: OptionalNullable[CardType] = UNSET
24
20
 
25
21
  card_issuer_name: OptionalNullable[str] = UNSET
26
22
 
@@ -10,10 +10,10 @@ from .paymentmethoddetailscard import (
10
10
  )
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -71,7 +71,7 @@ class PaymentMethodSummary(BaseModel):
71
71
  A summary of a payment method.
72
72
  """
73
73
 
74
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
74
+ method: Method
75
75
 
76
76
  id: str
77
77
  r"""The ID for the payment method."""
@@ -121,19 +121,13 @@ class PaymentMethodSummary(BaseModel):
121
121
  last_replaced_at: OptionalNullable[datetime] = UNSET
122
122
  r"""The date and time when this card was last replaced by the account updater."""
123
123
 
124
- mode: Annotated[
125
- OptionalNullable[Mode], PlainValidator(validate_open_enum(False))
126
- ] = UNSET
124
+ mode: OptionalNullable[Mode] = UNSET
127
125
  r"""The mode to use with this payment method."""
128
126
 
129
- scheme: Annotated[
130
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
131
- ] = UNSET
127
+ scheme: OptionalNullable[CardScheme] = UNSET
132
128
  r"""The scheme of the card. Only applies to card payments."""
133
129
 
134
- additional_schemes: OptionalNullable[
135
- List[Annotated[CardScheme, PlainValidator(validate_open_enum(False))]]
136
- ] = UNSET
130
+ additional_schemes: OptionalNullable[List[CardScheme]] = UNSET
137
131
  r"""Additional schemes of the card besides the primary scheme. Only applies to card payment methods."""
138
132
 
139
133
  cit_last_used_at: OptionalNullable[datetime] = UNSET
@@ -12,10 +12,10 @@ from .walletpaymentoptioncontext import (
12
12
  WalletPaymentOptionContextTypedDict,
13
13
  )
14
14
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from gr4vy.utils import validate_const, validate_open_enum
15
+ from gr4vy.utils import validate_const
16
16
  import pydantic
17
17
  from pydantic import model_serializer
18
- from pydantic.functional_validators import AfterValidator, PlainValidator
18
+ from pydantic.functional_validators import AfterValidator
19
19
  from typing import Literal, Optional, Union
20
20
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
21
21
 
@@ -52,7 +52,7 @@ class PaymentOptionTypedDict(TypedDict):
52
52
  class PaymentOption(BaseModel):
53
53
  method: str
54
54
 
55
- mode: Annotated[Mode, PlainValidator(validate_open_enum(False))]
55
+ mode: Mode
56
56
 
57
57
  can_store_payment_method: bool
58
58
 
@@ -10,10 +10,10 @@ from .method import Method
10
10
  from .paymentservicestatus import PaymentServiceStatus
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import Dict, List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -73,7 +73,7 @@ class PaymentService(BaseModel):
73
73
  payment_service_definition_id: str
74
74
  r"""The definition ID of the service that has been configured."""
75
75
 
76
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
76
+ method: Method
77
77
 
78
78
  display_name: str
79
79
  r"""The display name for the payment service."""
@@ -119,9 +119,7 @@ class PaymentService(BaseModel):
119
119
  active: Optional[bool] = True
120
120
  r"""Defines if this payment service is currently active."""
121
121
 
122
- status: Annotated[
123
- Optional[PaymentServiceStatus], PlainValidator(validate_open_enum(False))
124
- ] = None
122
+ status: Optional[PaymentServiceStatus] = None
125
123
 
126
124
  three_d_secure_enabled: OptionalNullable[bool] = UNSET
127
125
  r"""Defines if this payment service has 3DS enabled."""
@@ -3,9 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .approvaltarget import ApprovalTarget
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 PaymentServiceConfigurationTypedDict(TypedDict):
@@ -23,9 +21,7 @@ class PaymentServiceConfigurationTypedDict(TypedDict):
23
21
 
24
22
 
25
23
  class PaymentServiceConfiguration(BaseModel):
26
- approval_ui_target: Annotated[
27
- ApprovalTarget, PlainValidator(validate_open_enum(False))
28
- ]
24
+ approval_ui_target: ApprovalTarget
29
25
 
30
26
  approval_ui_height: str
31
27
  r"""Height of the approval interface in either pixels or view height (vh)."""
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .definitionfield import DefinitionField, DefinitionFieldTypedDict
5
+ from .integrationclient import IntegrationClient
5
6
  from .method import Method
6
7
  from .mode import Mode
7
8
  from .paymentserviceconfiguration import (
@@ -13,10 +14,10 @@ from .requiredcheckoutfields import (
13
14
  RequiredCheckoutFieldsTypedDict,
14
15
  )
15
16
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
16
- from gr4vy.utils import validate_const, validate_open_enum
17
+ from gr4vy.utils import validate_const
17
18
  import pydantic
18
19
  from pydantic import model_serializer
19
- from pydantic.functional_validators import AfterValidator, PlainValidator
20
+ from pydantic.functional_validators import AfterValidator
20
21
  from typing import Dict, List, Literal, Optional
21
22
  from typing_extensions import Annotated, NotRequired, TypedDict
22
23
 
@@ -41,6 +42,8 @@ class PaymentServiceDefinitionTypedDict(TypedDict):
41
42
  required_checkout_fields: List[RequiredCheckoutFieldsTypedDict]
42
43
  r"""A list of condition that define when some fields must be provided with a transaction request."""
43
44
  configuration: PaymentServiceConfigurationTypedDict
45
+ supported_integration_clients: Nullable[List[IntegrationClient]]
46
+ r"""List of supported integration clients. Defaults to redirect for most redirect connectors."""
44
47
  type: Literal["payment-service-definition"]
45
48
  r"""Always `payment-service-definition`."""
46
49
  icon_url: NotRequired[Nullable[str]]
@@ -54,7 +57,7 @@ class PaymentServiceDefinition(BaseModel):
54
57
  display_name: str
55
58
  r"""A human friendly name for this service."""
56
59
 
57
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
60
+ method: Method
58
61
 
59
62
  fields: List[DefinitionField]
60
63
  r"""A list of credentials and related fields which can be configured for this service."""
@@ -68,7 +71,7 @@ class PaymentServiceDefinition(BaseModel):
68
71
  supported_countries: List[str]
69
72
  r"""A list of two-letter ISO country codes that this service supports."""
70
73
 
71
- mode: Annotated[Mode, PlainValidator(validate_open_enum(False))]
74
+ mode: Mode
72
75
 
73
76
  supported_features: Dict[str, bool]
74
77
  r"""Features supported by the payment service."""
@@ -78,6 +81,9 @@ class PaymentServiceDefinition(BaseModel):
78
81
 
79
82
  configuration: PaymentServiceConfiguration
80
83
 
84
+ supported_integration_clients: Nullable[List[IntegrationClient]]
85
+ r"""List of supported integration clients. Defaults to redirect for most redirect connectors."""
86
+
81
87
  TYPE: Annotated[
82
88
  Annotated[
83
89
  Optional[Literal["payment-service-definition"]],
@@ -93,7 +99,7 @@ class PaymentServiceDefinition(BaseModel):
93
99
  @model_serializer(mode="wrap")
94
100
  def serialize_model(self, handler):
95
101
  optional_fields = ["type", "icon_url"]
96
- nullable_fields = ["icon_url"]
102
+ nullable_fields = ["icon_url", "supported_integration_clients"]
97
103
  null_default_fields = []
98
104
 
99
105
  serialized = handler(self)
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .paymentmethodstatus import PaymentMethodStatus
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
 
@@ -42,7 +42,7 @@ class PaymentServiceToken(BaseModel):
42
42
  payment_service_id: str
43
43
  r"""The ID of the payment method used to generate this token."""
44
44
 
45
- status: Annotated[PaymentMethodStatus, PlainValidator(validate_open_enum(False))]
45
+ status: PaymentMethodStatus
46
46
 
47
47
  created_at: datetime
48
48
  r"""The date and time when this payment service token was first created in our system."""
@@ -1,7 +1,7 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .guestbuyer_input import GuestBuyerInput, GuestBuyerInputTypedDict
4
+ from .guestbuyer import GuestBuyer, GuestBuyerTypedDict
5
5
  from .paymentmethodcard import PaymentMethodCard, PaymentMethodCardTypedDict
6
6
  from .paymentmethodstoredcard import (
7
7
  PaymentMethodStoredCard,
@@ -14,11 +14,9 @@ from .payoutconnectionoptions import (
14
14
  )
15
15
  from .payoutmerchant import PayoutMerchant, PayoutMerchantTypedDict
16
16
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
17
- from gr4vy.utils import validate_open_enum
18
17
  from pydantic import model_serializer
19
- from pydantic.functional_validators import PlainValidator
20
18
  from typing import Union
21
- from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
19
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
22
20
 
23
21
 
24
22
  PayoutCreatePaymentMethodTypedDict = TypeAliasType(
@@ -54,7 +52,7 @@ class PayoutCreateTypedDict(TypedDict):
54
52
  r"""A value that can be used to match the payout against your own records."""
55
53
  buyer_id: NotRequired[Nullable[str]]
56
54
  r"""The `id` of a stored buyer to use for this payout Use this instead of the `buyer` or `buyer_external_identifier`."""
57
- buyer: NotRequired[Nullable[GuestBuyerInputTypedDict]]
55
+ buyer: NotRequired[Nullable[GuestBuyerTypedDict]]
58
56
  r"""Inline buyer details for the payout. Use this instead of the `buyer_id` or `buyer_external_identifier`."""
59
57
  buyer_external_identifier: NotRequired[Nullable[str]]
60
58
  r"""The `external_identifier` of a stored buyer to use for this payout. Use this instead of the `buyer_id` or `buyer`."""
@@ -82,9 +80,7 @@ class PayoutCreate(BaseModel):
82
80
  payment_method: PayoutCreatePaymentMethod
83
81
  r"""The type of payment method to send funds too."""
84
82
 
85
- category: Annotated[
86
- OptionalNullable[PayoutCategory], PlainValidator(validate_open_enum(False))
87
- ] = UNSET
83
+ category: OptionalNullable[PayoutCategory] = UNSET
88
84
  r"""The type of payout to process."""
89
85
 
90
86
  external_identifier: OptionalNullable[str] = UNSET
@@ -93,7 +89,7 @@ class PayoutCreate(BaseModel):
93
89
  buyer_id: OptionalNullable[str] = UNSET
94
90
  r"""The `id` of a stored buyer to use for this payout Use this instead of the `buyer` or `buyer_external_identifier`."""
95
91
 
96
- buyer: OptionalNullable[GuestBuyerInput] = UNSET
92
+ buyer: OptionalNullable[GuestBuyer] = UNSET
97
93
  r"""Inline buyer details for the payout. Use this instead of the `buyer_id` or `buyer_external_identifier`."""
98
94
 
99
95
  buyer_external_identifier: OptionalNullable[str] = UNSET