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,57 @@
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
+ from pydantic import model_serializer
6
+ from typing import Any, Dict, List
7
+ from typing_extensions import NotRequired, TypedDict
8
+
9
+
10
+ class AdyenSplitsOptionsTypedDict(TypedDict):
11
+ authorization: NotRequired[Nullable[List[Dict[str, Any]]]]
12
+ r"""Split payment values to pass to the Adyen API on payment authorization. See [the Adyen docs](https://docs.adyen.com/platforms/online-payments/split-transactions/split-payments-at-authorization/) for details on the format and contents of the list."""
13
+ capture: NotRequired[Nullable[List[Dict[str, Any]]]]
14
+ r"""Split payment values to pass to the Adyen API on payment capture. See [the Adyen docs](https://docs.adyen.com/platforms/online-payments/split-transactions/split-payments-at-capture/) for details on the format and contents of the list."""
15
+ refund: NotRequired[Nullable[List[Dict[str, Any]]]]
16
+ r"""Split payment values to pass to the Adyen API on payment refund. See [the Adyen docs](https://docs.adyen.com/platforms/online-payments/split-transactions/split-refunds/) for details on the format and contents of the list."""
17
+
18
+
19
+ class AdyenSplitsOptions(BaseModel):
20
+ authorization: OptionalNullable[List[Dict[str, Any]]] = UNSET
21
+ r"""Split payment values to pass to the Adyen API on payment authorization. See [the Adyen docs](https://docs.adyen.com/platforms/online-payments/split-transactions/split-payments-at-authorization/) for details on the format and contents of the list."""
22
+
23
+ capture: OptionalNullable[List[Dict[str, Any]]] = UNSET
24
+ r"""Split payment values to pass to the Adyen API on payment capture. See [the Adyen docs](https://docs.adyen.com/platforms/online-payments/split-transactions/split-payments-at-capture/) for details on the format and contents of the list."""
25
+
26
+ refund: OptionalNullable[List[Dict[str, Any]]] = UNSET
27
+ r"""Split payment values to pass to the Adyen API on payment refund. See [the Adyen docs](https://docs.adyen.com/platforms/online-payments/split-transactions/split-refunds/) for details on the format and contents of the list."""
28
+
29
+ @model_serializer(mode="wrap")
30
+ def serialize_model(self, handler):
31
+ optional_fields = ["authorization", "capture", "refund"]
32
+ nullable_fields = ["authorization", "capture", "refund"]
33
+ null_default_fields = []
34
+
35
+ serialized = handler(self)
36
+
37
+ m = {}
38
+
39
+ for n, f in type(self).model_fields.items():
40
+ k = f.alias or n
41
+ val = serialized.get(k)
42
+ serialized.pop(k, None)
43
+
44
+ optional_nullable = k in optional_fields and k in nullable_fields
45
+ is_set = (
46
+ self.__pydantic_fields_set__.intersection({n})
47
+ or k in null_default_fields
48
+ ) # pylint: disable=no-member
49
+
50
+ if val is not None and val != UNSET_SENTINEL:
51
+ m[k] = val
52
+ elif val != UNSET_SENTINEL and (
53
+ not k in optional_fields or (optional_nullable and is_set)
54
+ ):
55
+ m[k] = val
56
+
57
+ return m
gr4vy/models/airline.py CHANGED
@@ -12,14 +12,18 @@ from gr4vy.types import (
12
12
  UNSET_SENTINEL,
13
13
  UnrecognizedStr,
14
14
  )
15
- from gr4vy.utils import validate_open_enum
16
15
  from pydantic import model_serializer
17
- from pydantic.functional_validators import PlainValidator
18
16
  from typing import List, Literal, Union
19
- from typing_extensions import Annotated, NotRequired, TypedDict
17
+ from typing_extensions import NotRequired, TypedDict
20
18
 
21
19
 
22
- TicketDeliveryMethod = Union[Literal["electronic", "other"], UnrecognizedStr]
20
+ TicketDeliveryMethod = Union[
21
+ Literal[
22
+ "electronic",
23
+ "other",
24
+ ],
25
+ UnrecognizedStr,
26
+ ]
23
27
 
24
28
 
25
29
  class AirlineTypedDict(TypedDict):
@@ -107,10 +111,7 @@ class Airline(BaseModel):
107
111
  restricted_ticket: OptionalNullable[bool] = UNSET
108
112
  r"""Indicates whether the ticket is restricted (refundable)."""
109
113
 
110
- ticket_delivery_method: Annotated[
111
- OptionalNullable[TicketDeliveryMethod],
112
- PlainValidator(validate_open_enum(False)),
113
- ] = UNSET
114
+ ticket_delivery_method: OptionalNullable[TicketDeliveryMethod] = UNSET
114
115
  r"""The delivery method of the ticket."""
115
116
 
116
117
  ticket_number: OptionalNullable[str] = UNSET
@@ -10,14 +10,18 @@ from gr4vy.types import (
10
10
  UNSET_SENTINEL,
11
11
  UnrecognizedStr,
12
12
  )
13
- from gr4vy.utils import validate_open_enum
14
13
  from pydantic import model_serializer
15
- from pydantic.functional_validators import PlainValidator
16
14
  from typing import Literal, Union
17
- from typing_extensions import Annotated, NotRequired, TypedDict
15
+ from typing_extensions import NotRequired, TypedDict
18
16
 
19
17
 
20
- RouteType = Union[Literal["round_trip", "one_way"], UnrecognizedStr]
18
+ RouteType = Union[
19
+ Literal[
20
+ "round_trip",
21
+ "one_way",
22
+ ],
23
+ UnrecognizedStr,
24
+ ]
21
25
 
22
26
 
23
27
  class AirlineLegTypedDict(TypedDict):
@@ -127,9 +131,7 @@ class AirlineLeg(BaseModel):
127
131
  flight_number: OptionalNullable[str] = UNSET
128
132
  r"""Unique identifier of the flight number."""
129
133
 
130
- route_type: Annotated[
131
- OptionalNullable[RouteType], PlainValidator(validate_open_enum(False))
132
- ] = UNSET
134
+ route_type: OptionalNullable[RouteType] = UNSET
133
135
  r"""The route type of the flight."""
134
136
 
135
137
  seat_class: OptionalNullable[str] = UNSET
@@ -10,14 +10,18 @@ from gr4vy.types import (
10
10
  UNSET_SENTINEL,
11
11
  UnrecognizedStr,
12
12
  )
13
- from gr4vy.utils import validate_open_enum
14
13
  from pydantic import model_serializer
15
- from pydantic.functional_validators import PlainValidator
16
14
  from typing import Literal, Union
17
- from typing_extensions import Annotated, NotRequired, TypedDict
15
+ from typing_extensions import NotRequired, TypedDict
18
16
 
19
17
 
20
- AgeGroup = Union[Literal["adult", "infant"], UnrecognizedStr]
18
+ AgeGroup = Union[
19
+ Literal[
20
+ "adult",
21
+ "infant",
22
+ ],
23
+ UnrecognizedStr,
24
+ ]
21
25
 
22
26
 
23
27
  class AirlinePassengerTypedDict(TypedDict):
@@ -46,9 +50,7 @@ class AirlinePassengerTypedDict(TypedDict):
46
50
 
47
51
 
48
52
  class AirlinePassenger(BaseModel):
49
- age_group: Annotated[
50
- OptionalNullable[AgeGroup], PlainValidator(validate_open_enum(False))
51
- ] = UNSET
53
+ age_group: OptionalNullable[AgeGroup] = UNSET
52
54
  r"""The age group for the passenger."""
53
55
 
54
56
  date_of_birth: OptionalNullable[date] = UNSET
@@ -6,6 +6,14 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  AntiFraudDecision = Union[
9
- Literal["accept", "error", "exception", "reject", "review", "skipped"],
9
+ Literal[
10
+ "accept",
11
+ "error",
12
+ "exception",
13
+ "reject",
14
+ "review",
15
+ "skipped",
16
+ "pending",
17
+ ],
10
18
  UnrecognizedStr,
11
19
  ]
@@ -5,4 +5,10 @@ from gr4vy.types import UnrecognizedStr
5
5
  from typing import Literal, Union
6
6
 
7
7
 
8
- ApprovalTarget = Union[Literal["new_window", "any"], UnrecognizedStr]
8
+ ApprovalTarget = Union[
9
+ Literal[
10
+ "new_window",
11
+ "any",
12
+ ],
13
+ UnrecognizedStr,
14
+ ]
@@ -6,5 +6,13 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  AuditLogAction = Union[
9
- Literal["created", "updated", "deleted", "voided", "captured"], UnrecognizedStr
9
+ Literal[
10
+ "created",
11
+ "updated",
12
+ "deleted",
13
+ "voided",
14
+ "canceled",
15
+ "captured",
16
+ ],
17
+ UnrecognizedStr,
10
18
  ]
@@ -6,10 +6,10 @@ from .auditlogentryresource import AuditLogEntryResource, AuditLogEntryResourceT
6
6
  from .auditlogentryuser import AuditLogEntryUser, AuditLogEntryUserTypedDict
7
7
  from datetime import datetime
8
8
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
9
- from gr4vy.utils import validate_const, validate_open_enum
9
+ from gr4vy.utils import validate_const
10
10
  import pydantic
11
11
  from pydantic import model_serializer
12
- from pydantic.functional_validators import AfterValidator, PlainValidator
12
+ from pydantic.functional_validators import AfterValidator
13
13
  from typing import Literal, Optional
14
14
  from typing_extensions import Annotated, NotRequired, TypedDict
15
15
 
@@ -31,7 +31,7 @@ class AuditLogEntryTypedDict(TypedDict):
31
31
  class AuditLogEntry(BaseModel):
32
32
  resource: AuditLogEntryResource
33
33
 
34
- action: Annotated[AuditLogAction, PlainValidator(validate_open_enum(False))]
34
+ action: AuditLogAction
35
35
 
36
36
  user: AuditLogEntryUser
37
37
 
@@ -3,10 +3,10 @@
3
3
  from __future__ import annotations
4
4
  from .userstatus import UserStatus
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
 
@@ -32,7 +32,7 @@ class AuditLogEntryUser(BaseModel):
32
32
  is_staff: bool
33
33
  r"""Whether this is a Gr4vy staff user."""
34
34
 
35
- status: Annotated[UserStatus, PlainValidator(validate_open_enum(False))]
35
+ status: UserStatus
36
36
 
37
37
  TYPE: Annotated[
38
38
  Annotated[Optional[Literal["user"]], AfterValidator(validate_const("user"))],
@@ -8,7 +8,7 @@ from pydantic import model_serializer
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- class BillingDetailsInputTypedDict(TypedDict):
11
+ class BillingDetailsTypedDict(TypedDict):
12
12
  first_name: NotRequired[Nullable[str]]
13
13
  r"""The first name(s) or given name for the buyer."""
14
14
  last_name: NotRequired[Nullable[str]]
@@ -23,7 +23,7 @@ class BillingDetailsInputTypedDict(TypedDict):
23
23
  r"""The tax ID information associated with the billing details."""
24
24
 
25
25
 
26
- class BillingDetailsInput(BaseModel):
26
+ class BillingDetails(BaseModel):
27
27
  first_name: OptionalNullable[str] = UNSET
28
28
  r"""The first name(s) or given name for the buyer."""
29
29
 
@@ -1,16 +1,35 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
4
+ from gr4vy.types import (
5
+ BaseModel,
6
+ Nullable,
7
+ OptionalNullable,
8
+ UNSET,
9
+ UNSET_SENTINEL,
10
+ UnrecognizedStr,
11
+ )
5
12
  from pydantic import model_serializer
13
+ from typing import Literal, Union
6
14
  from typing_extensions import NotRequired, TypedDict
7
15
 
8
16
 
17
+ VaultPaymentMethodCriteria = Union[
18
+ Literal[
19
+ "ALWAYS",
20
+ "ON_SUCCESSFUL_TRANSACTION",
21
+ ],
22
+ UnrecognizedStr,
23
+ ]
24
+
25
+
9
26
  class BraintreeDynamicDataFieldsOptionsTypedDict(TypedDict):
10
27
  three_ds_auth_status: NotRequired[Nullable[str]]
11
28
  r"""Passes the 3DS status to the Braintree API using `customFields` with the key set to the value of `three_ds_auth_status`"""
12
29
  purchase_order_number: NotRequired[Nullable[str]]
13
30
  r"""Passes the `transaction.purchaseOrderNumber` field when creating a new transaction."""
31
+ vault_payment_method_criteria: NotRequired[Nullable[VaultPaymentMethodCriteria]]
32
+ r"""Passes the `vaultPaymentMethodCriteria` field when creating a new transaction."""
14
33
 
15
34
 
16
35
  class BraintreeDynamicDataFieldsOptions(BaseModel):
@@ -20,10 +39,21 @@ class BraintreeDynamicDataFieldsOptions(BaseModel):
20
39
  purchase_order_number: OptionalNullable[str] = UNSET
21
40
  r"""Passes the `transaction.purchaseOrderNumber` field when creating a new transaction."""
22
41
 
42
+ vault_payment_method_criteria: OptionalNullable[VaultPaymentMethodCriteria] = UNSET
43
+ r"""Passes the `vaultPaymentMethodCriteria` field when creating a new transaction."""
44
+
23
45
  @model_serializer(mode="wrap")
24
46
  def serialize_model(self, handler):
25
- optional_fields = ["three_ds_auth_status", "purchase_order_number"]
26
- nullable_fields = ["three_ds_auth_status", "purchase_order_number"]
47
+ optional_fields = [
48
+ "three_ds_auth_status",
49
+ "purchase_order_number",
50
+ "vault_payment_method_criteria",
51
+ ]
52
+ nullable_fields = [
53
+ "three_ds_auth_status",
54
+ "purchase_order_number",
55
+ "vault_payment_method_criteria",
56
+ ]
27
57
  null_default_fields = []
28
58
 
29
59
  serialized = handler(self)
@@ -9,14 +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
- UserDevice = Union[Literal["desktop", "mobile"], UnrecognizedStr]
17
+ UserDevice = Union[
18
+ Literal[
19
+ "desktop",
20
+ "mobile",
21
+ ],
22
+ UnrecognizedStr,
23
+ ]
20
24
  r"""The platform that is being used to access the website."""
21
25
 
22
26
 
@@ -58,7 +62,7 @@ class BrowserInfo(BaseModel):
58
62
  user_agent: str
59
63
  r"""Exact content of the HTTP user-agent header."""
60
64
 
61
- user_device: Annotated[UserDevice, PlainValidator(validate_open_enum(False))]
65
+ user_device: UserDevice
62
66
  r"""The platform that is being used to access the website."""
63
67
 
64
68
  accept_header: OptionalNullable[str] = UNSET
gr4vy/models/buyer.py CHANGED
@@ -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 .billingdetails_output import BillingDetailsOutput, BillingDetailsOutputTypedDict
4
+ from .billingdetails import BillingDetails, BillingDetailsTypedDict
5
5
  from datetime import datetime
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
7
  from gr4vy.utils import validate_const
@@ -27,7 +27,7 @@ class BuyerTypedDict(TypedDict):
27
27
  r"""The display name for the buyer."""
28
28
  external_identifier: NotRequired[Nullable[str]]
29
29
  r"""The merchant identifier for this buyer."""
30
- billing_details: NotRequired[Nullable[BillingDetailsOutputTypedDict]]
30
+ billing_details: NotRequired[Nullable[BillingDetailsTypedDict]]
31
31
  r"""The billing name, address, email, and other fields for this buyer."""
32
32
  account_number: NotRequired[Nullable[str]]
33
33
  r"""The buyer account number"""
@@ -58,7 +58,7 @@ class Buyer(BaseModel):
58
58
  external_identifier: OptionalNullable[str] = UNSET
59
59
  r"""The merchant identifier for this buyer."""
60
60
 
61
- billing_details: OptionalNullable[BillingDetailsOutput] = UNSET
61
+ billing_details: OptionalNullable[BillingDetails] = UNSET
62
62
  r"""The billing name, address, email, and other fields for this buyer."""
63
63
 
64
64
  account_number: OptionalNullable[str] = UNSET
@@ -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 .billingdetails_input import BillingDetailsInput, BillingDetailsInputTypedDict
4
+ from .billingdetails import BillingDetails, BillingDetailsTypedDict
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from pydantic import model_serializer
7
7
  from typing_extensions import NotRequired, TypedDict
@@ -14,7 +14,7 @@ class BuyerCreateTypedDict(TypedDict):
14
14
  r"""The display name for the buyer."""
15
15
  external_identifier: NotRequired[Nullable[str]]
16
16
  r"""The merchant identifier for this buyer."""
17
- billing_details: NotRequired[Nullable[BillingDetailsInputTypedDict]]
17
+ billing_details: NotRequired[Nullable[BillingDetailsTypedDict]]
18
18
  r"""The billing name, address, email, and other fields for this buyer."""
19
19
  account_number: NotRequired[Nullable[str]]
20
20
  r"""The buyer account number"""
@@ -29,7 +29,7 @@ class BuyerCreate(BaseModel):
29
29
  external_identifier: OptionalNullable[str] = UNSET
30
30
  r"""The merchant identifier for this buyer."""
31
31
 
32
- billing_details: OptionalNullable[BillingDetailsInput] = UNSET
32
+ billing_details: OptionalNullable[BillingDetails] = UNSET
33
33
  r"""The billing name, address, email, and other fields for this buyer."""
34
34
 
35
35
  account_number: OptionalNullable[str] = UNSET
@@ -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 .billingdetails_input import BillingDetailsInput, BillingDetailsInputTypedDict
4
+ from .billingdetails import BillingDetails, BillingDetailsTypedDict
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from pydantic import model_serializer
7
7
  from typing_extensions import NotRequired, TypedDict
@@ -16,7 +16,7 @@ class BuyerUpdateTypedDict(TypedDict):
16
16
  r"""The merchant identifier for this buyer."""
17
17
  account_number: NotRequired[Nullable[str]]
18
18
  r"""The buyer account number"""
19
- billing_details: NotRequired[Nullable[BillingDetailsInputTypedDict]]
19
+ billing_details: NotRequired[Nullable[BillingDetailsTypedDict]]
20
20
  r"""The billing name, address, email, and other fields for this buyer."""
21
21
 
22
22
 
@@ -32,7 +32,7 @@ class BuyerUpdate(BaseModel):
32
32
  account_number: OptionalNullable[str] = UNSET
33
33
  r"""The buyer account number"""
34
34
 
35
- billing_details: OptionalNullable[BillingDetailsInput] = UNSET
35
+ billing_details: OptionalNullable[BillingDetails] = UNSET
36
36
  r"""The billing name, address, email, and other fields for this buyer."""
37
37
 
38
38
  @model_serializer(mode="wrap")
@@ -0,0 +1,43 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from gr4vy.types import BaseModel
5
+ from gr4vy.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
6
+ import pydantic
7
+ from typing import Optional
8
+ from typing_extensions import Annotated, NotRequired, TypedDict
9
+
10
+
11
+ class CancelTransactionGlobalsTypedDict(TypedDict):
12
+ merchant_account_id: NotRequired[str]
13
+ r"""The ID of the merchant account to use for this request."""
14
+
15
+
16
+ class CancelTransactionGlobals(BaseModel):
17
+ merchant_account_id: Annotated[
18
+ Optional[str],
19
+ pydantic.Field(alias="x-gr4vy-merchant-account-id"),
20
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
21
+ ] = None
22
+ r"""The ID of the merchant account to use for this request."""
23
+
24
+
25
+ class CancelTransactionRequestTypedDict(TypedDict):
26
+ transaction_id: str
27
+ r"""The ID of the transaction"""
28
+ merchant_account_id: NotRequired[str]
29
+ r"""The ID of the merchant account to use for this request."""
30
+
31
+
32
+ class CancelTransactionRequest(BaseModel):
33
+ transaction_id: Annotated[
34
+ str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
35
+ ]
36
+ r"""The ID of the transaction"""
37
+
38
+ merchant_account_id: Annotated[
39
+ Optional[str],
40
+ pydantic.Field(alias="x-gr4vy-merchant-account-id"),
41
+ FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
42
+ ] = None
43
+ r"""The ID of the merchant account to use for this request."""
@@ -0,0 +1,15 @@
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
+ CancelStatus = Union[
9
+ Literal[
10
+ "succeeded",
11
+ "pending",
12
+ "failed",
13
+ ],
14
+ UnrecognizedStr,
15
+ ]
@@ -6,5 +6,11 @@ from typing import Literal, Union
6
6
 
7
7
 
8
8
  CaptureStatus = Union[
9
- Literal["succeeded", "pending", "declined", "failed"], UnrecognizedStr
9
+ Literal[
10
+ "succeeded",
11
+ "pending",
12
+ "declined",
13
+ "failed",
14
+ ],
15
+ UnrecognizedStr,
10
16
  ]
gr4vy/models/cardtype.py CHANGED
@@ -5,4 +5,11 @@ from gr4vy.types import UnrecognizedStr
5
5
  from typing import Literal, Union
6
6
 
7
7
 
8
- CardType = Union[Literal["credit", "debit", "prepaid"], UnrecognizedStr]
8
+ CardType = Union[
9
+ Literal[
10
+ "credit",
11
+ "debit",
12
+ "prepaid",
13
+ ],
14
+ UnrecognizedStr,
15
+ ]
gr4vy/models/cartitem.py CHANGED
@@ -3,11 +3,9 @@
3
3
  from __future__ import annotations
4
4
  from .producttype import ProductType
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
7
  from typing import List
10
- from typing_extensions import Annotated, NotRequired, TypedDict
8
+ from typing_extensions import NotRequired, TypedDict
11
9
 
12
10
 
13
11
  class CartItemTypedDict(TypedDict):
@@ -24,7 +22,9 @@ class CartItemTypedDict(TypedDict):
24
22
  external_identifier: NotRequired[Nullable[str]]
25
23
  r"""An external identifier for the cart item. This can be set to any value and is not sent to the payment service."""
26
24
  sku: NotRequired[Nullable[str]]
27
- r"""The SKU for the item."""
25
+ r"""The SKU or product code for the item."""
26
+ upc: NotRequired[Nullable[str]]
27
+ r"""The UPC for the item."""
28
28
  product_url: NotRequired[Nullable[str]]
29
29
  r"""The product URL for the item."""
30
30
  image_url: NotRequired[Nullable[str]]
@@ -35,6 +35,18 @@ class CartItemTypedDict(TypedDict):
35
35
  r"""The product type of the cart item."""
36
36
  seller_country: NotRequired[Nullable[str]]
37
37
  r"""The seller country of the cart item."""
38
+ tax_exempt: NotRequired[Nullable[bool]]
39
+ r"""Whether the item is exempt of tax."""
40
+ unit_of_measure: NotRequired[Nullable[str]]
41
+ r"""The unit of measure or the unit of measure code."""
42
+ commodity_code: NotRequired[Nullable[str]]
43
+ r"""Item commodity code. Generally a UNSPSC code."""
44
+ description: NotRequired[Nullable[str]]
45
+ r"""Brief item description."""
46
+ duty_amount: NotRequired[Nullable[int]]
47
+ r"""Item import or export duties represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`"""
48
+ shipping_amount: NotRequired[Nullable[int]]
49
+ r"""Freight/shipping amount represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`"""
38
50
 
39
51
 
40
52
  class CartItem(BaseModel):
@@ -57,7 +69,10 @@ class CartItem(BaseModel):
57
69
  r"""An external identifier for the cart item. This can be set to any value and is not sent to the payment service."""
58
70
 
59
71
  sku: OptionalNullable[str] = UNSET
60
- r"""The SKU for the item."""
72
+ r"""The SKU or product code for the item."""
73
+
74
+ upc: OptionalNullable[str] = UNSET
75
+ r"""The UPC for the item."""
61
76
 
62
77
  product_url: OptionalNullable[str] = UNSET
63
78
  r"""The product URL for the item."""
@@ -68,14 +83,30 @@ class CartItem(BaseModel):
68
83
  categories: OptionalNullable[List[str]] = UNSET
69
84
  r"""A list of strings containing product categories for the item."""
70
85
 
71
- product_type: Annotated[
72
- OptionalNullable[ProductType], PlainValidator(validate_open_enum(False))
73
- ] = UNSET
86
+ product_type: OptionalNullable[ProductType] = UNSET
74
87
  r"""The product type of the cart item."""
75
88
 
76
89
  seller_country: OptionalNullable[str] = UNSET
77
90
  r"""The seller country of the cart item."""
78
91
 
92
+ tax_exempt: OptionalNullable[bool] = UNSET
93
+ r"""Whether the item is exempt of tax."""
94
+
95
+ unit_of_measure: OptionalNullable[str] = UNSET
96
+ r"""The unit of measure or the unit of measure code."""
97
+
98
+ commodity_code: OptionalNullable[str] = UNSET
99
+ r"""Item commodity code. Generally a UNSPSC code."""
100
+
101
+ description: OptionalNullable[str] = UNSET
102
+ r"""Brief item description."""
103
+
104
+ duty_amount: OptionalNullable[int] = UNSET
105
+ r"""Item import or export duties represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`"""
106
+
107
+ shipping_amount: OptionalNullable[int] = UNSET
108
+ r"""Freight/shipping amount represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`"""
109
+
79
110
  @model_serializer(mode="wrap")
80
111
  def serialize_model(self, handler):
81
112
  optional_fields = [
@@ -83,22 +114,36 @@ class CartItem(BaseModel):
83
114
  "tax_amount",
84
115
  "external_identifier",
85
116
  "sku",
117
+ "upc",
86
118
  "product_url",
87
119
  "image_url",
88
120
  "categories",
89
121
  "product_type",
90
122
  "seller_country",
123
+ "tax_exempt",
124
+ "unit_of_measure",
125
+ "commodity_code",
126
+ "description",
127
+ "duty_amount",
128
+ "shipping_amount",
91
129
  ]
92
130
  nullable_fields = [
93
131
  "discount_amount",
94
132
  "tax_amount",
95
133
  "external_identifier",
96
134
  "sku",
135
+ "upc",
97
136
  "product_url",
98
137
  "image_url",
99
138
  "categories",
100
139
  "product_type",
101
140
  "seller_country",
141
+ "tax_exempt",
142
+ "unit_of_measure",
143
+ "commodity_code",
144
+ "description",
145
+ "duty_amount",
146
+ "shipping_amount",
102
147
  ]
103
148
  null_default_fields = []
104
149