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
gr4vy/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "gr4vy"
6
- __version__: str = "1.5.2"
6
+ __version__: str = "1.10.9"
7
7
  __openapi_doc_version__: str = "1.0.0"
8
- __gen_version__: str = "2.721.3"
9
- __user_agent__: str = "speakeasy-sdk/python 1.5.2 2.721.3 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/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
  ),
@@ -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
  ),
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
@@ -56,6 +56,7 @@ class BaseSDK:
56
56
  ] = None,
57
57
  url_override: Optional[str] = None,
58
58
  http_headers: Optional[Mapping[str, str]] = None,
59
+ allow_empty_value: Optional[List[str]] = None,
59
60
  ) -> httpx.Request:
60
61
  client = self.sdk_configuration.async_client
61
62
  return self._build_request_with_client(
@@ -76,6 +77,7 @@ class BaseSDK:
76
77
  get_serialized_body,
77
78
  url_override,
78
79
  http_headers,
80
+ allow_empty_value,
79
81
  )
80
82
 
81
83
  def _build_request(
@@ -98,6 +100,7 @@ class BaseSDK:
98
100
  ] = None,
99
101
  url_override: Optional[str] = None,
100
102
  http_headers: Optional[Mapping[str, str]] = None,
103
+ allow_empty_value: Optional[List[str]] = None,
101
104
  ) -> httpx.Request:
102
105
  client = self.sdk_configuration.client
103
106
  return self._build_request_with_client(
@@ -118,6 +121,7 @@ class BaseSDK:
118
121
  get_serialized_body,
119
122
  url_override,
120
123
  http_headers,
124
+ allow_empty_value,
121
125
  )
122
126
 
123
127
  def _build_request_with_client(
@@ -141,6 +145,7 @@ class BaseSDK:
141
145
  ] = None,
142
146
  url_override: Optional[str] = None,
143
147
  http_headers: Optional[Mapping[str, str]] = None,
148
+ allow_empty_value: Optional[List[str]] = None,
144
149
  ) -> httpx.Request:
145
150
  query_params = {}
146
151
 
@@ -156,6 +161,7 @@ class BaseSDK:
156
161
  query_params = utils.get_query_params(
157
162
  request if request_has_query_params else None,
158
163
  _globals if request_has_query_params else None,
164
+ allow_empty_value,
159
165
  )
160
166
  else:
161
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
  ),