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
gr4vy/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "gr4vy"
6
- __version__: str = "1.1.29"
6
+ __version__: str = "1.10.9"
7
7
  __openapi_doc_version__: str = "1.0.0"
8
- __gen_version__: str = "2.681.1"
9
- __user_agent__: str = "speakeasy-sdk/python 1.1.29 2.681.1 1.0.0 gr4vy"
8
+ __gen_version__: str = "2.793.0"
9
+ __user_agent__: str = "speakeasy-sdk/python 1.10.9 2.793.0 1.0.0 gr4vy"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
gr4vy/account_updater.py CHANGED
@@ -3,15 +3,18 @@
3
3
  from .basesdk import BaseSDK
4
4
  from .sdkconfiguration import SDKConfiguration
5
5
  from gr4vy.jobs import Jobs
6
+ from typing import Optional
6
7
 
7
8
 
8
9
  class AccountUpdater(BaseSDK):
9
10
  jobs: Jobs
10
11
 
11
- def __init__(self, sdk_config: SDKConfiguration) -> None:
12
- BaseSDK.__init__(self, sdk_config)
12
+ def __init__(
13
+ self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
14
+ ) -> None:
15
+ BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
13
16
  self.sdk_configuration = sdk_config
14
17
  self._init_sdks()
15
18
 
16
19
  def _init_sdks(self):
17
- self.jobs = Jobs(self.sdk_configuration)
20
+ self.jobs = Jobs(self.sdk_configuration, parent_ref=self.parent_ref)
gr4vy/actions.py ADDED
@@ -0,0 +1,307 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from gr4vy import errors, models, utils
5
+ from gr4vy._hooks import HookContext
6
+ from gr4vy.types import OptionalNullable, UNSET
7
+ from gr4vy.utils import get_security_from_env
8
+ from gr4vy.utils.unmarshal_json_response import unmarshal_json_response
9
+ from typing import Any, Mapping, Optional
10
+
11
+
12
+ class Actions(BaseSDK):
13
+ def list(
14
+ self,
15
+ *,
16
+ transaction_id: str,
17
+ merchant_account_id: Optional[str] = None,
18
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
19
+ server_url: Optional[str] = None,
20
+ timeout_ms: Optional[int] = None,
21
+ http_headers: Optional[Mapping[str, str]] = None,
22
+ ) -> models.TransactionActions:
23
+ r"""List transaction Flow rules
24
+
25
+ Retrieve the list of Flow rule actions that have been triggered for a transaction.
26
+
27
+ :param transaction_id: The ID of the transaction
28
+ :param merchant_account_id: The ID of the merchant account to use for this request.
29
+ :param retries: Override the default retry configuration for this method
30
+ :param server_url: Override the default server URL for this method
31
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
32
+ :param http_headers: Additional headers to set or replace on requests.
33
+ """
34
+ base_url = None
35
+ url_variables = None
36
+ if timeout_ms is None:
37
+ timeout_ms = self.sdk_configuration.timeout_ms
38
+
39
+ if server_url is not None:
40
+ base_url = server_url
41
+ else:
42
+ base_url = self._get_url(base_url, url_variables)
43
+
44
+ request = models.ListTransactionActionsRequest(
45
+ transaction_id=transaction_id,
46
+ merchant_account_id=merchant_account_id,
47
+ )
48
+
49
+ req = self._build_request(
50
+ method="GET",
51
+ path="/transactions/{transaction_id}/actions",
52
+ base_url=base_url,
53
+ url_variables=url_variables,
54
+ request=request,
55
+ request_body_required=False,
56
+ request_has_path_params=True,
57
+ request_has_query_params=True,
58
+ user_agent_header="user-agent",
59
+ accept_header_value="application/json",
60
+ http_headers=http_headers,
61
+ _globals=models.ListTransactionActionsGlobals(
62
+ merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
63
+ ),
64
+ security=self.sdk_configuration.security,
65
+ allow_empty_value=None,
66
+ timeout_ms=timeout_ms,
67
+ )
68
+
69
+ if retries == UNSET:
70
+ if self.sdk_configuration.retry_config is not UNSET:
71
+ retries = self.sdk_configuration.retry_config
72
+ else:
73
+ retries = utils.RetryConfig(
74
+ "backoff", utils.BackoffStrategy(200, 200, 1, 1000), True
75
+ )
76
+
77
+ retry_config = None
78
+ if isinstance(retries, utils.RetryConfig):
79
+ retry_config = (retries, ["5XX"])
80
+
81
+ http_res = self.do_request(
82
+ hook_ctx=HookContext(
83
+ config=self.sdk_configuration,
84
+ base_url=base_url or "",
85
+ operation_id="list_transaction_actions",
86
+ oauth2_scopes=None,
87
+ security_source=get_security_from_env(
88
+ self.sdk_configuration.security, models.Security
89
+ ),
90
+ ),
91
+ request=req,
92
+ error_status_codes=[
93
+ "400",
94
+ "401",
95
+ "403",
96
+ "404",
97
+ "405",
98
+ "409",
99
+ "422",
100
+ "425",
101
+ "429",
102
+ "4XX",
103
+ "500",
104
+ "502",
105
+ "504",
106
+ "5XX",
107
+ ],
108
+ retry_config=retry_config,
109
+ )
110
+
111
+ response_data: Any = None
112
+ if utils.match_response(http_res, "200", "application/json"):
113
+ return unmarshal_json_response(models.TransactionActions, http_res)
114
+ if utils.match_response(http_res, "400", "application/json"):
115
+ response_data = unmarshal_json_response(errors.Error400Data, http_res)
116
+ raise errors.Error400(response_data, http_res)
117
+ if utils.match_response(http_res, "401", "application/json"):
118
+ response_data = unmarshal_json_response(errors.Error401Data, http_res)
119
+ raise errors.Error401(response_data, http_res)
120
+ if utils.match_response(http_res, "403", "application/json"):
121
+ response_data = unmarshal_json_response(errors.Error403Data, http_res)
122
+ raise errors.Error403(response_data, http_res)
123
+ if utils.match_response(http_res, "404", "application/json"):
124
+ response_data = unmarshal_json_response(errors.Error404Data, http_res)
125
+ raise errors.Error404(response_data, http_res)
126
+ if utils.match_response(http_res, "405", "application/json"):
127
+ response_data = unmarshal_json_response(errors.Error405Data, http_res)
128
+ raise errors.Error405(response_data, http_res)
129
+ if utils.match_response(http_res, "409", "application/json"):
130
+ response_data = unmarshal_json_response(errors.Error409Data, http_res)
131
+ raise errors.Error409(response_data, http_res)
132
+ if utils.match_response(http_res, "422", "application/json"):
133
+ response_data = unmarshal_json_response(
134
+ errors.HTTPValidationErrorData, http_res
135
+ )
136
+ raise errors.HTTPValidationError(response_data, http_res)
137
+ if utils.match_response(http_res, "425", "application/json"):
138
+ response_data = unmarshal_json_response(errors.Error425Data, http_res)
139
+ raise errors.Error425(response_data, http_res)
140
+ if utils.match_response(http_res, "429", "application/json"):
141
+ response_data = unmarshal_json_response(errors.Error429Data, http_res)
142
+ raise errors.Error429(response_data, http_res)
143
+ if utils.match_response(http_res, "500", "application/json"):
144
+ response_data = unmarshal_json_response(errors.Error500Data, http_res)
145
+ raise errors.Error500(response_data, http_res)
146
+ if utils.match_response(http_res, "502", "application/json"):
147
+ response_data = unmarshal_json_response(errors.Error502Data, http_res)
148
+ raise errors.Error502(response_data, http_res)
149
+ if utils.match_response(http_res, "504", "application/json"):
150
+ response_data = unmarshal_json_response(errors.Error504Data, http_res)
151
+ raise errors.Error504(response_data, http_res)
152
+ if utils.match_response(http_res, "4XX", "*"):
153
+ http_res_text = utils.stream_to_text(http_res)
154
+ raise errors.APIError("API error occurred", http_res, http_res_text)
155
+ if utils.match_response(http_res, "5XX", "*"):
156
+ http_res_text = utils.stream_to_text(http_res)
157
+ raise errors.APIError("API error occurred", http_res, http_res_text)
158
+
159
+ raise errors.APIError("Unexpected response received", http_res)
160
+
161
+ async def list_async(
162
+ self,
163
+ *,
164
+ transaction_id: str,
165
+ merchant_account_id: Optional[str] = None,
166
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
167
+ server_url: Optional[str] = None,
168
+ timeout_ms: Optional[int] = None,
169
+ http_headers: Optional[Mapping[str, str]] = None,
170
+ ) -> models.TransactionActions:
171
+ r"""List transaction Flow rules
172
+
173
+ Retrieve the list of Flow rule actions that have been triggered for a transaction.
174
+
175
+ :param transaction_id: The ID of the transaction
176
+ :param merchant_account_id: The ID of the merchant account to use for this request.
177
+ :param retries: Override the default retry configuration for this method
178
+ :param server_url: Override the default server URL for this method
179
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
180
+ :param http_headers: Additional headers to set or replace on requests.
181
+ """
182
+ base_url = None
183
+ url_variables = None
184
+ if timeout_ms is None:
185
+ timeout_ms = self.sdk_configuration.timeout_ms
186
+
187
+ if server_url is not None:
188
+ base_url = server_url
189
+ else:
190
+ base_url = self._get_url(base_url, url_variables)
191
+
192
+ request = models.ListTransactionActionsRequest(
193
+ transaction_id=transaction_id,
194
+ merchant_account_id=merchant_account_id,
195
+ )
196
+
197
+ req = self._build_request_async(
198
+ method="GET",
199
+ path="/transactions/{transaction_id}/actions",
200
+ base_url=base_url,
201
+ url_variables=url_variables,
202
+ request=request,
203
+ request_body_required=False,
204
+ request_has_path_params=True,
205
+ request_has_query_params=True,
206
+ user_agent_header="user-agent",
207
+ accept_header_value="application/json",
208
+ http_headers=http_headers,
209
+ _globals=models.ListTransactionActionsGlobals(
210
+ merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
211
+ ),
212
+ security=self.sdk_configuration.security,
213
+ allow_empty_value=None,
214
+ timeout_ms=timeout_ms,
215
+ )
216
+
217
+ if retries == UNSET:
218
+ if self.sdk_configuration.retry_config is not UNSET:
219
+ retries = self.sdk_configuration.retry_config
220
+ else:
221
+ retries = utils.RetryConfig(
222
+ "backoff", utils.BackoffStrategy(200, 200, 1, 1000), True
223
+ )
224
+
225
+ retry_config = None
226
+ if isinstance(retries, utils.RetryConfig):
227
+ retry_config = (retries, ["5XX"])
228
+
229
+ http_res = await self.do_request_async(
230
+ hook_ctx=HookContext(
231
+ config=self.sdk_configuration,
232
+ base_url=base_url or "",
233
+ operation_id="list_transaction_actions",
234
+ oauth2_scopes=None,
235
+ security_source=get_security_from_env(
236
+ self.sdk_configuration.security, models.Security
237
+ ),
238
+ ),
239
+ request=req,
240
+ error_status_codes=[
241
+ "400",
242
+ "401",
243
+ "403",
244
+ "404",
245
+ "405",
246
+ "409",
247
+ "422",
248
+ "425",
249
+ "429",
250
+ "4XX",
251
+ "500",
252
+ "502",
253
+ "504",
254
+ "5XX",
255
+ ],
256
+ retry_config=retry_config,
257
+ )
258
+
259
+ response_data: Any = None
260
+ if utils.match_response(http_res, "200", "application/json"):
261
+ return unmarshal_json_response(models.TransactionActions, http_res)
262
+ if utils.match_response(http_res, "400", "application/json"):
263
+ response_data = unmarshal_json_response(errors.Error400Data, http_res)
264
+ raise errors.Error400(response_data, http_res)
265
+ if utils.match_response(http_res, "401", "application/json"):
266
+ response_data = unmarshal_json_response(errors.Error401Data, http_res)
267
+ raise errors.Error401(response_data, http_res)
268
+ if utils.match_response(http_res, "403", "application/json"):
269
+ response_data = unmarshal_json_response(errors.Error403Data, http_res)
270
+ raise errors.Error403(response_data, http_res)
271
+ if utils.match_response(http_res, "404", "application/json"):
272
+ response_data = unmarshal_json_response(errors.Error404Data, http_res)
273
+ raise errors.Error404(response_data, http_res)
274
+ if utils.match_response(http_res, "405", "application/json"):
275
+ response_data = unmarshal_json_response(errors.Error405Data, http_res)
276
+ raise errors.Error405(response_data, http_res)
277
+ if utils.match_response(http_res, "409", "application/json"):
278
+ response_data = unmarshal_json_response(errors.Error409Data, http_res)
279
+ raise errors.Error409(response_data, http_res)
280
+ if utils.match_response(http_res, "422", "application/json"):
281
+ response_data = unmarshal_json_response(
282
+ errors.HTTPValidationErrorData, http_res
283
+ )
284
+ raise errors.HTTPValidationError(response_data, http_res)
285
+ if utils.match_response(http_res, "425", "application/json"):
286
+ response_data = unmarshal_json_response(errors.Error425Data, http_res)
287
+ raise errors.Error425(response_data, http_res)
288
+ if utils.match_response(http_res, "429", "application/json"):
289
+ response_data = unmarshal_json_response(errors.Error429Data, http_res)
290
+ raise errors.Error429(response_data, http_res)
291
+ if utils.match_response(http_res, "500", "application/json"):
292
+ response_data = unmarshal_json_response(errors.Error500Data, http_res)
293
+ raise errors.Error500(response_data, http_res)
294
+ if utils.match_response(http_res, "502", "application/json"):
295
+ response_data = unmarshal_json_response(errors.Error502Data, http_res)
296
+ raise errors.Error502(response_data, http_res)
297
+ if utils.match_response(http_res, "504", "application/json"):
298
+ response_data = unmarshal_json_response(errors.Error504Data, http_res)
299
+ raise errors.Error504(response_data, http_res)
300
+ if utils.match_response(http_res, "4XX", "*"):
301
+ http_res_text = await utils.stream_to_text_async(http_res)
302
+ raise errors.APIError("API error occurred", http_res, http_res_text)
303
+ if utils.match_response(http_res, "5XX", "*"):
304
+ http_res_text = await utils.stream_to_text_async(http_res)
305
+ raise errors.APIError("API error occurred", http_res, http_res_text)
306
+
307
+ raise errors.APIError("Unexpected response received", http_res)
gr4vy/all.py CHANGED
@@ -77,6 +77,7 @@ class All(BaseSDK):
77
77
  "json",
78
78
  OptionalNullable[models.TransactionRefundAllCreate],
79
79
  ),
80
+ allow_empty_value=None,
80
81
  timeout_ms=timeout_ms,
81
82
  )
82
83
 
@@ -93,7 +94,7 @@ class All(BaseSDK):
93
94
  config=self.sdk_configuration,
94
95
  base_url=base_url or "",
95
96
  operation_id="create_full_transaction_refund",
96
- oauth2_scopes=[],
97
+ oauth2_scopes=None,
97
98
  security_source=get_security_from_env(
98
99
  self.sdk_configuration.security, models.Security
99
100
  ),
@@ -235,6 +236,7 @@ class All(BaseSDK):
235
236
  "json",
236
237
  OptionalNullable[models.TransactionRefundAllCreate],
237
238
  ),
239
+ allow_empty_value=None,
238
240
  timeout_ms=timeout_ms,
239
241
  )
240
242
 
@@ -251,7 +253,7 @@ class All(BaseSDK):
251
253
  config=self.sdk_configuration,
252
254
  base_url=base_url or "",
253
255
  operation_id="create_full_transaction_refund",
254
- oauth2_scopes=[],
256
+ oauth2_scopes=None,
255
257
  security_source=get_security_from_env(
256
258
  self.sdk_configuration.security, models.Security
257
259
  ),
gr4vy/audit_logs.py CHANGED
@@ -75,6 +75,7 @@ class AuditLogs(BaseSDK):
75
75
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
76
76
  ),
77
77
  security=self.sdk_configuration.security,
78
+ allow_empty_value=None,
78
79
  timeout_ms=timeout_ms,
79
80
  )
80
81
 
@@ -95,7 +96,7 @@ class AuditLogs(BaseSDK):
95
96
  config=self.sdk_configuration,
96
97
  base_url=base_url or "",
97
98
  operation_id="list_audit_logs",
98
- oauth2_scopes=[],
99
+ oauth2_scopes=None,
99
100
  security_source=get_security_from_env(
100
101
  self.sdk_configuration.security, models.Security
101
102
  ),
@@ -128,7 +129,7 @@ class AuditLogs(BaseSDK):
128
129
  return None
129
130
 
130
131
  next_cursor = next_cursor[0]
131
- if next_cursor is None:
132
+ if next_cursor is None or str(next_cursor).strip() == "":
132
133
  return None
133
134
 
134
135
  return self.list(
@@ -258,6 +259,7 @@ class AuditLogs(BaseSDK):
258
259
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
259
260
  ),
260
261
  security=self.sdk_configuration.security,
262
+ allow_empty_value=None,
261
263
  timeout_ms=timeout_ms,
262
264
  )
263
265
 
@@ -278,7 +280,7 @@ class AuditLogs(BaseSDK):
278
280
  config=self.sdk_configuration,
279
281
  base_url=base_url or "",
280
282
  operation_id="list_audit_logs",
281
- oauth2_scopes=[],
283
+ oauth2_scopes=None,
282
284
  security_source=get_security_from_env(
283
285
  self.sdk_configuration.security, models.Security
284
286
  ),
@@ -311,7 +313,7 @@ class AuditLogs(BaseSDK):
311
313
  return None
312
314
 
313
315
  next_cursor = next_cursor[0]
314
- if next_cursor is None:
316
+ if next_cursor is None or str(next_cursor).strip() == "":
315
317
  return None
316
318
 
317
319
  return self.list(
gr4vy/balances.py CHANGED
@@ -71,6 +71,7 @@ class Balances(BaseSDK):
71
71
  "json",
72
72
  models.GiftCardBalanceRequest,
73
73
  ),
74
+ allow_empty_value=None,
74
75
  timeout_ms=timeout_ms,
75
76
  )
76
77
 
@@ -87,7 +88,7 @@ class Balances(BaseSDK):
87
88
  config=self.sdk_configuration,
88
89
  base_url=base_url or "",
89
90
  operation_id="list_gift_card_balances",
90
- oauth2_scopes=[],
91
+ oauth2_scopes=None,
91
92
  security_source=get_security_from_env(
92
93
  self.sdk_configuration.security, models.Security
93
94
  ),
@@ -223,6 +224,7 @@ class Balances(BaseSDK):
223
224
  "json",
224
225
  models.GiftCardBalanceRequest,
225
226
  ),
227
+ allow_empty_value=None,
226
228
  timeout_ms=timeout_ms,
227
229
  )
228
230
 
@@ -239,7 +241,7 @@ class Balances(BaseSDK):
239
241
  config=self.sdk_configuration,
240
242
  base_url=base_url or "",
241
243
  operation_id="list_gift_card_balances",
242
- oauth2_scopes=[],
244
+ oauth2_scopes=None,
243
245
  security_source=get_security_from_env(
244
246
  self.sdk_configuration.security, models.Security
245
247
  ),
gr4vy/basesdk.py CHANGED
@@ -11,9 +11,19 @@ from urllib.parse import parse_qs, urlparse
11
11
 
12
12
  class BaseSDK:
13
13
  sdk_configuration: SDKConfiguration
14
+ parent_ref: Optional[object] = None
15
+ """
16
+ Reference to the root SDK instance, if any. This will prevent it from
17
+ being garbage collected while there are active streams.
18
+ """
14
19
 
15
- def __init__(self, sdk_config: SDKConfiguration) -> None:
20
+ def __init__(
21
+ self,
22
+ sdk_config: SDKConfiguration,
23
+ parent_ref: Optional[object] = None,
24
+ ) -> None:
16
25
  self.sdk_configuration = sdk_config
26
+ self.parent_ref = parent_ref
17
27
 
18
28
  def _get_url(self, base_url, url_variables):
19
29
  sdk_url, sdk_variables = self.sdk_configuration.get_server_details()
@@ -46,6 +56,7 @@ class BaseSDK:
46
56
  ] = None,
47
57
  url_override: Optional[str] = None,
48
58
  http_headers: Optional[Mapping[str, str]] = None,
59
+ allow_empty_value: Optional[List[str]] = None,
49
60
  ) -> httpx.Request:
50
61
  client = self.sdk_configuration.async_client
51
62
  return self._build_request_with_client(
@@ -66,6 +77,7 @@ class BaseSDK:
66
77
  get_serialized_body,
67
78
  url_override,
68
79
  http_headers,
80
+ allow_empty_value,
69
81
  )
70
82
 
71
83
  def _build_request(
@@ -88,6 +100,7 @@ class BaseSDK:
88
100
  ] = None,
89
101
  url_override: Optional[str] = None,
90
102
  http_headers: Optional[Mapping[str, str]] = None,
103
+ allow_empty_value: Optional[List[str]] = None,
91
104
  ) -> httpx.Request:
92
105
  client = self.sdk_configuration.client
93
106
  return self._build_request_with_client(
@@ -108,6 +121,7 @@ class BaseSDK:
108
121
  get_serialized_body,
109
122
  url_override,
110
123
  http_headers,
124
+ allow_empty_value,
111
125
  )
112
126
 
113
127
  def _build_request_with_client(
@@ -131,6 +145,7 @@ class BaseSDK:
131
145
  ] = None,
132
146
  url_override: Optional[str] = None,
133
147
  http_headers: Optional[Mapping[str, str]] = None,
148
+ allow_empty_value: Optional[List[str]] = None,
134
149
  ) -> httpx.Request:
135
150
  query_params = {}
136
151
 
@@ -146,6 +161,7 @@ class BaseSDK:
146
161
  query_params = utils.get_query_params(
147
162
  request if request_has_query_params else None,
148
163
  _globals if request_has_query_params else None,
164
+ allow_empty_value,
149
165
  )
150
166
  else:
151
167
  # Pick up the query parameter from the override so they can be
@@ -65,6 +65,7 @@ class BuyersGiftCards(BaseSDK):
65
65
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
66
66
  ),
67
67
  security=self.sdk_configuration.security,
68
+ allow_empty_value=None,
68
69
  timeout_ms=timeout_ms,
69
70
  )
70
71
 
@@ -85,7 +86,7 @@ class BuyersGiftCards(BaseSDK):
85
86
  config=self.sdk_configuration,
86
87
  base_url=base_url or "",
87
88
  operation_id="list_buyer_gift_cards",
88
- oauth2_scopes=[],
89
+ oauth2_scopes=None,
89
90
  security_source=get_security_from_env(
90
91
  self.sdk_configuration.security, models.Security
91
92
  ),
@@ -215,6 +216,7 @@ class BuyersGiftCards(BaseSDK):
215
216
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
216
217
  ),
217
218
  security=self.sdk_configuration.security,
219
+ allow_empty_value=None,
218
220
  timeout_ms=timeout_ms,
219
221
  )
220
222
 
@@ -235,7 +237,7 @@ class BuyersGiftCards(BaseSDK):
235
237
  config=self.sdk_configuration,
236
238
  base_url=base_url or "",
237
239
  operation_id="list_buyer_gift_cards",
238
- oauth2_scopes=[],
240
+ oauth2_scopes=None,
239
241
  security_source=get_security_from_env(
240
242
  self.sdk_configuration.security, models.Security
241
243
  ),
@@ -74,6 +74,7 @@ class BuyersPaymentMethods(BaseSDK):
74
74
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
75
75
  ),
76
76
  security=self.sdk_configuration.security,
77
+ allow_empty_value=None,
77
78
  timeout_ms=timeout_ms,
78
79
  )
79
80
 
@@ -94,7 +95,7 @@ class BuyersPaymentMethods(BaseSDK):
94
95
  config=self.sdk_configuration,
95
96
  base_url=base_url or "",
96
97
  operation_id="list_buyer_payment_methods",
97
- oauth2_scopes=[],
98
+ oauth2_scopes=None,
98
99
  security_source=get_security_from_env(
99
100
  self.sdk_configuration.security, models.Security
100
101
  ),
@@ -233,6 +234,7 @@ class BuyersPaymentMethods(BaseSDK):
233
234
  merchant_account_id=self.sdk_configuration.globals.merchant_account_id,
234
235
  ),
235
236
  security=self.sdk_configuration.security,
237
+ allow_empty_value=None,
236
238
  timeout_ms=timeout_ms,
237
239
  )
238
240
 
@@ -253,7 +255,7 @@ class BuyersPaymentMethods(BaseSDK):
253
255
  config=self.sdk_configuration,
254
256
  base_url=base_url or "",
255
257
  operation_id="list_buyer_payment_methods",
256
- oauth2_scopes=[],
258
+ oauth2_scopes=None,
257
259
  security_source=get_security_from_env(
258
260
  self.sdk_configuration.security, models.Security
259
261
  ),