gr4vy 1.10.12__py3-none-any.whl → 1.10.14__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 (292) hide show
  1. gr4vy/_version.py +3 -3
  2. gr4vy/basesdk.py +20 -6
  3. gr4vy/models/__init__.py +132 -0
  4. gr4vy/models/accountsreceivablesreportspec.py +18 -1
  5. gr4vy/models/accountupdaterinquirysummary.py +18 -1
  6. gr4vy/models/accountupdaterjob.py +18 -1
  7. gr4vy/models/accountupdateroptions.py +30 -31
  8. gr4vy/models/add_buyer_shipping_detailsop.py +34 -1
  9. gr4vy/models/add_buyerop.py +34 -1
  10. gr4vy/models/add_payment_linkop.py +34 -1
  11. gr4vy/models/add_reportop.py +34 -1
  12. gr4vy/models/address.py +38 -39
  13. gr4vy/models/adyencardoptions.py +32 -33
  14. gr4vy/models/adyenoptions.py +14 -19
  15. gr4vy/models/adyensepaoptions.py +30 -31
  16. gr4vy/models/adyensplitsoptions.py +14 -19
  17. gr4vy/models/affirmitineraryoptions.py +34 -35
  18. gr4vy/models/affirmoptions.py +14 -19
  19. gr4vy/models/airline.py +58 -59
  20. gr4vy/models/airlineleg.py +66 -67
  21. gr4vy/models/airlinepassenger.py +42 -43
  22. gr4vy/models/applepaypaymentmethodcreate.py +34 -35
  23. gr4vy/models/auditlogentries.py +14 -19
  24. gr4vy/models/auditlogentry.py +14 -19
  25. gr4vy/models/auditlogentryuser.py +14 -19
  26. gr4vy/models/billingdetails.py +32 -33
  27. gr4vy/models/braintreedynamicdatafieldsoptions.py +26 -27
  28. gr4vy/models/braintreeoptions.py +18 -19
  29. gr4vy/models/browserinfo.py +14 -19
  30. gr4vy/models/buyer.py +31 -32
  31. gr4vy/models/buyercreate.py +18 -29
  32. gr4vy/models/buyers.py +14 -19
  33. gr4vy/models/buyerupdate.py +18 -29
  34. gr4vy/models/cancel_transactionop.py +34 -1
  35. gr4vy/models/capture_transactionop.py +30 -19
  36. gr4vy/models/cardpaymentmethodcreate.py +31 -32
  37. gr4vy/models/cardschemedefinition.py +18 -1
  38. gr4vy/models/cardwithurlpaymentmethodcreate.py +33 -34
  39. gr4vy/models/cartitem.py +52 -53
  40. gr4vy/models/chaseoptions.py +14 -19
  41. gr4vy/models/checkoutsession.py +37 -38
  42. gr4vy/models/checkoutsessioncreate.py +35 -36
  43. gr4vy/models/checkoutsessionpaymentmethod.py +16 -27
  44. gr4vy/models/checkoutsessionpaymentmethodcreate.py +18 -28
  45. gr4vy/models/checkoutsessionpaymentmethoddetails.py +14 -19
  46. gr4vy/models/checkoutsessionwithurlpaymentmethodcreate.py +29 -30
  47. gr4vy/models/clicktopayfpanpaymentmethodcreate.py +32 -33
  48. gr4vy/models/clicktopaypaymentmethodcreate.py +28 -29
  49. gr4vy/models/configure_digital_walletop.py +34 -1
  50. gr4vy/models/create_account_updater_jobop.py +34 -1
  51. gr4vy/models/create_apple_pay_digital_wallet_sessionop.py +34 -1
  52. gr4vy/models/create_checkout_sessionop.py +34 -1
  53. gr4vy/models/create_full_transaction_refundop.py +30 -19
  54. gr4vy/models/create_gift_cardop.py +34 -1
  55. gr4vy/models/create_google_pay_digital_wallet_sessionop.py +34 -1
  56. gr4vy/models/create_payment_method_network_token_cryptogramop.py +34 -1
  57. gr4vy/models/create_payment_method_network_tokenop.py +34 -1
  58. gr4vy/models/create_payment_method_payment_service_tokenop.py +34 -1
  59. gr4vy/models/create_payment_methodop.py +34 -1
  60. gr4vy/models/create_payment_service_sessionop.py +34 -1
  61. gr4vy/models/create_payment_serviceop.py +34 -1
  62. gr4vy/models/create_payoutop.py +34 -1
  63. gr4vy/models/create_report_execution_urlop.py +34 -1
  64. gr4vy/models/create_three_ds_scenarioop.py +79 -0
  65. gr4vy/models/create_transaction_refundop.py +34 -1
  66. gr4vy/models/create_transactionop.py +32 -19
  67. gr4vy/models/createsession.py +14 -19
  68. gr4vy/models/cryptogram.py +18 -1
  69. gr4vy/models/cybersourceantifraudoptions.py +18 -27
  70. gr4vy/models/cybersourceoptions.py +27 -28
  71. gr4vy/models/delete_buyer_shipping_detailsop.py +34 -1
  72. gr4vy/models/delete_buyerop.py +34 -1
  73. gr4vy/models/delete_checkout_sessionop.py +34 -1
  74. gr4vy/models/delete_digital_walletop.py +34 -1
  75. gr4vy/models/delete_gift_cardop.py +34 -1
  76. gr4vy/models/delete_payment_method_network_tokenop.py +34 -1
  77. gr4vy/models/delete_payment_method_payment_service_tokenop.py +34 -1
  78. gr4vy/models/delete_payment_methodop.py +34 -1
  79. gr4vy/models/delete_payment_serviceop.py +34 -1
  80. gr4vy/models/delete_three_ds_scenarioop.py +76 -0
  81. gr4vy/models/detailedsettlementreportspec.py +18 -1
  82. gr4vy/models/digitalwallet.py +27 -33
  83. gr4vy/models/digitalwalletcreate.py +23 -28
  84. gr4vy/models/digitalwalletupdate.py +30 -31
  85. gr4vy/models/dlocaloptions.py +14 -19
  86. gr4vy/models/dlocalupioptions.py +14 -19
  87. gr4vy/models/dlocalupiwalletoptions.py +18 -33
  88. gr4vy/models/dlocalwalletoptions.py +14 -19
  89. gr4vy/models/expire_payment_linkop.py +34 -1
  90. gr4vy/models/fiservinstallmentoptions.py +27 -28
  91. gr4vy/models/fiservoptions.py +14 -19
  92. gr4vy/models/forterantifraudoptions.py +30 -31
  93. gr4vy/models/forterantifraudoptionscartitem.py +13 -18
  94. gr4vy/models/forterantifraudoptionscartitembasicitemdata.py +14 -19
  95. gr4vy/models/forterantifraudoptionscartitembeneficiary.py +13 -18
  96. gr4vy/models/forterantifraudoptionscartitembeneficiaryaddress.py +18 -19
  97. gr4vy/models/forterantifraudoptionscartitembeneficiarycomments.py +18 -27
  98. gr4vy/models/forterantifraudoptionscartitembeneficiarypersonaldetails.py +14 -19
  99. gr4vy/models/forterantifraudoptionscartitemdeliverydetails.py +13 -18
  100. gr4vy/models/forterantifraudoptionsdiscount.py +13 -18
  101. gr4vy/models/forterantifraudoptionsdiscountcoupondiscountamount.py +14 -19
  102. gr4vy/models/get_buyer_shipping_detailsop.py +34 -1
  103. gr4vy/models/get_buyerop.py +34 -1
  104. gr4vy/models/get_checkout_sessionop.py +34 -1
  105. gr4vy/models/get_digital_walletop.py +34 -1
  106. gr4vy/models/get_gift_cardop.py +34 -1
  107. gr4vy/models/get_payment_linkop.py +34 -1
  108. gr4vy/models/get_payment_methodop.py +34 -1
  109. gr4vy/models/get_payment_serviceop.py +34 -1
  110. gr4vy/models/get_payoutop.py +34 -1
  111. gr4vy/models/get_refundop.py +34 -1
  112. gr4vy/models/get_report_executionop.py +34 -1
  113. gr4vy/models/get_reportop.py +34 -1
  114. gr4vy/models/get_three_ds_scenarioop.py +105 -0
  115. gr4vy/models/get_transaction_refundop.py +34 -1
  116. gr4vy/models/get_transaction_settlementop.py +34 -1
  117. gr4vy/models/get_transactionop.py +34 -1
  118. gr4vy/models/giftcard.py +14 -19
  119. gr4vy/models/giftcardcreate.py +14 -19
  120. gr4vy/models/giftcardredemption.py +29 -30
  121. gr4vy/models/giftcards.py +14 -19
  122. gr4vy/models/giftcardservice.py +18 -1
  123. gr4vy/models/giftcardsummary.py +35 -36
  124. gr4vy/models/givingblockoptions.py +14 -19
  125. gr4vy/models/googlepayassurancedetails.py +14 -19
  126. gr4vy/models/googlepayfpanpaymentmethodcreate.py +32 -33
  127. gr4vy/models/googlepaypaymentmethodcreate.py +36 -37
  128. gr4vy/models/guestbuyer.py +30 -31
  129. gr4vy/models/internal/globals.py +18 -1
  130. gr4vy/models/latitudeoptions.py +14 -19
  131. gr4vy/models/list_all_report_executionsop.py +50 -35
  132. gr4vy/models/list_audit_logsop.py +39 -26
  133. gr4vy/models/list_buyer_gift_cardsop.py +32 -23
  134. gr4vy/models/list_buyer_payment_methodsop.py +42 -33
  135. gr4vy/models/list_buyer_shipping_detailsop.py +34 -1
  136. gr4vy/models/list_buyersop.py +32 -25
  137. gr4vy/models/list_card_scheme_definitionsop.py +34 -1
  138. gr4vy/models/list_digital_walletsop.py +34 -1
  139. gr4vy/models/list_gift_card_balancesop.py +34 -1
  140. gr4vy/models/list_gift_cardsop.py +38 -25
  141. gr4vy/models/list_merchant_accountsop.py +14 -19
  142. gr4vy/models/list_payment_linksop.py +32 -19
  143. gr4vy/models/list_payment_method_network_tokensop.py +34 -1
  144. gr4vy/models/list_payment_method_payment_service_tokensop.py +30 -19
  145. gr4vy/models/list_payment_methodsop.py +48 -33
  146. gr4vy/models/list_payment_optionsop.py +34 -1
  147. gr4vy/models/list_payment_service_definitionsop.py +14 -19
  148. gr4vy/models/list_payment_servicesop.py +32 -25
  149. gr4vy/models/list_payoutsop.py +30 -19
  150. gr4vy/models/list_report_executionsop.py +30 -19
  151. gr4vy/models/list_reportsop.py +39 -26
  152. gr4vy/models/list_transaction_actionsop.py +34 -1
  153. gr4vy/models/list_transaction_eventsop.py +30 -19
  154. gr4vy/models/list_transaction_refundsop.py +34 -1
  155. gr4vy/models/list_transaction_settlementsop.py +34 -1
  156. gr4vy/models/list_transactionsop.py +124 -109
  157. gr4vy/models/mattildatapioptions.py +14 -19
  158. gr4vy/models/merchantaccount.py +52 -53
  159. gr4vy/models/merchantaccountcreate.py +52 -53
  160. gr4vy/models/merchantaccounts.py +14 -19
  161. gr4vy/models/merchantaccountupdate.py +54 -55
  162. gr4vy/models/mockcardmerchantadvicecodeoptions.py +14 -19
  163. gr4vy/models/mockcardoptions.py +14 -19
  164. gr4vy/models/networktoken.py +18 -1
  165. gr4vy/models/networktokencreate.py +14 -19
  166. gr4vy/models/networktokenpaymentmethodcreate.py +34 -35
  167. gr4vy/models/nuveiairlinedataoptions.py +14 -19
  168. gr4vy/models/nuveiidealoptions.py +14 -19
  169. gr4vy/models/nuveioptions.py +14 -19
  170. gr4vy/models/nuveipseoptions.py +13 -18
  171. gr4vy/models/oxxooptions.py +14 -19
  172. gr4vy/models/paymentlink.py +59 -60
  173. gr4vy/models/paymentlinkcreate.py +59 -60
  174. gr4vy/models/paymentlinks.py +14 -19
  175. gr4vy/models/paymentmethod.py +51 -52
  176. gr4vy/models/paymentmethodcard.py +14 -19
  177. gr4vy/models/paymentmethoddetailscard.py +14 -19
  178. gr4vy/models/paymentmethods.py +14 -19
  179. gr4vy/models/paymentmethodstoredcard.py +18 -1
  180. gr4vy/models/paymentmethodsummary.py +47 -48
  181. gr4vy/models/paymentoption.py +14 -19
  182. gr4vy/models/paymentoptioncontext.py +14 -19
  183. gr4vy/models/paymentoptioncontextapprovalui.py +14 -19
  184. gr4vy/models/paymentoptionrequest.py +18 -26
  185. gr4vy/models/paymentservice.py +35 -36
  186. gr4vy/models/paymentservicecreate.py +36 -37
  187. gr4vy/models/paymentservicedefinition.py +14 -19
  188. gr4vy/models/paymentservicedefinitions.py +14 -19
  189. gr4vy/models/paymentservices.py +14 -19
  190. gr4vy/models/paymentservicetoken.py +14 -19
  191. gr4vy/models/paymentservicetokencreate.py +14 -19
  192. gr4vy/models/paymentserviceupdate.py +45 -46
  193. gr4vy/models/payoutconnectionoptions.py +14 -19
  194. gr4vy/models/payoutcreate.py +34 -35
  195. gr4vy/models/payoutmerchant.py +14 -19
  196. gr4vy/models/payoutmerchantsummary.py +14 -19
  197. gr4vy/models/payoutpaymentservice.py +14 -19
  198. gr4vy/models/payoutsummaries.py +14 -19
  199. gr4vy/models/payoutsummary.py +35 -36
  200. gr4vy/models/paypaloptions.py +14 -19
  201. gr4vy/models/paypalshippingoptions.py +14 -19
  202. gr4vy/models/paypalshippingoptionsitem.py +14 -19
  203. gr4vy/models/plaidpaymentmethodcreate.py +31 -32
  204. gr4vy/models/powertranzoptions.py +14 -19
  205. gr4vy/models/recipient.py +14 -19
  206. gr4vy/models/redirectpaymentmethodcreate.py +18 -27
  207. gr4vy/models/refund.py +39 -40
  208. gr4vy/models/refunds.py +14 -19
  209. gr4vy/models/register_digital_wallet_domainop.py +34 -1
  210. gr4vy/models/report.py +33 -34
  211. gr4vy/models/reportcreate.py +14 -19
  212. gr4vy/models/reportexecution.py +18 -1
  213. gr4vy/models/reportexecutions.py +14 -19
  214. gr4vy/models/reportexecutionsummary.py +18 -1
  215. gr4vy/models/reportexecutionurlgenerate.py +18 -1
  216. gr4vy/models/reports.py +14 -19
  217. gr4vy/models/reportsummary.py +16 -19
  218. gr4vy/models/reportupdate.py +14 -19
  219. gr4vy/models/requiredcheckoutfields.py +14 -19
  220. gr4vy/models/resume_payment_method_network_tokenop.py +34 -1
  221. gr4vy/models/security.py +18 -1
  222. gr4vy/models/settlement.py +16 -25
  223. gr4vy/models/shippingdetails.py +35 -36
  224. gr4vy/models/shippingdetailscreate.py +18 -31
  225. gr4vy/models/shippingdetailsupdate.py +18 -31
  226. gr4vy/models/statementdescriptor.py +34 -35
  227. gr4vy/models/stripeconnectoptions.py +30 -31
  228. gr4vy/models/stripeoptions.py +14 -19
  229. gr4vy/models/suspend_payment_method_network_tokenop.py +34 -1
  230. gr4vy/models/sync_transactionop.py +34 -1
  231. gr4vy/models/threedsecure.py +14 -19
  232. gr4vy/models/threedsecuredatav1.py +14 -19
  233. gr4vy/models/threedsecuredatav2.py +14 -19
  234. gr4vy/models/threedsecureerror.py +14 -19
  235. gr4vy/models/threedsecurescenario.py +77 -0
  236. gr4vy/models/threedsecurescenarioconditions.py +84 -0
  237. gr4vy/models/threedsecurescenariocreate.py +24 -0
  238. gr4vy/models/threedsecurescenariooutcome.py +57 -0
  239. gr4vy/models/threedsecurescenariooutcomeauthentication.py +31 -0
  240. gr4vy/models/threedsecurescenariooutcomeresult.py +27 -0
  241. gr4vy/models/threedsecurescenarios.py +58 -0
  242. gr4vy/models/threedsecurescenarioupdate.py +54 -0
  243. gr4vy/models/threedsecurev2.py +34 -35
  244. gr4vy/models/tokenpaymentmethodcreate.py +14 -19
  245. gr4vy/models/transaction.py +111 -112
  246. gr4vy/models/transactionaction.py +18 -1
  247. gr4vy/models/transactionbuyer.py +31 -32
  248. gr4vy/models/transactioncancel.py +14 -19
  249. gr4vy/models/transactioncapture.py +14 -19
  250. gr4vy/models/transactioncapturecreate.py +14 -19
  251. gr4vy/models/transactionconnectionoptions.py +104 -105
  252. gr4vy/models/transactioncreate.py +88 -89
  253. gr4vy/models/transactionevent.py +18 -1
  254. gr4vy/models/transactionevents.py +14 -19
  255. gr4vy/models/transactiongiftcard.py +14 -19
  256. gr4vy/models/transactionpaymentmethod.py +49 -50
  257. gr4vy/models/transactionpaymentservice.py +18 -1
  258. gr4vy/models/transactionrefundallcreate.py +14 -19
  259. gr4vy/models/transactionrefundcreate.py +16 -25
  260. gr4vy/models/transactionretriesreportspec.py +18 -1
  261. gr4vy/models/transactionsreportspec.py +18 -1
  262. gr4vy/models/transactionsummaries.py +14 -19
  263. gr4vy/models/transactionsummary.py +50 -51
  264. gr4vy/models/transactionthreedsecuresummary.py +18 -33
  265. gr4vy/models/transactionupdate.py +14 -19
  266. gr4vy/models/transactionvoid.py +14 -19
  267. gr4vy/models/travelhubcustomdata.py +14 -19
  268. gr4vy/models/travelhuboptions.py +14 -19
  269. gr4vy/models/trustlyoptions.py +14 -19
  270. gr4vy/models/unregister_digital_wallet_domainop.py +34 -1
  271. gr4vy/models/update_buyer_shipping_detailsop.py +34 -1
  272. gr4vy/models/update_buyerop.py +34 -1
  273. gr4vy/models/update_checkout_sessionop.py +34 -1
  274. gr4vy/models/update_digital_walletop.py +34 -1
  275. gr4vy/models/update_payment_serviceop.py +34 -1
  276. gr4vy/models/update_reportop.py +34 -1
  277. gr4vy/models/update_three_ds_scenarioop.py +91 -0
  278. gr4vy/models/update_transactionop.py +34 -1
  279. gr4vy/models/verify_payment_service_credentialsop.py +34 -1
  280. gr4vy/models/verifycredentials.py +14 -19
  281. gr4vy/models/void_transactionop.py +30 -19
  282. gr4vy/models/wpayeverdaypayoptions.py +30 -31
  283. gr4vy/models/wpaypaytooptions.py +14 -19
  284. gr4vy/models/wpaypaytoresourceoptions.py +14 -19
  285. gr4vy/models/wpaypaytosimulationoptions.py +14 -19
  286. gr4vy/sdk.py +3 -0
  287. gr4vy/three_ds_scenarios.py +1322 -0
  288. gr4vy/utils/__init__.py +13 -1
  289. {gr4vy-1.10.12.dist-info → gr4vy-1.10.14.dist-info}/METADATA +8 -1
  290. gr4vy-1.10.14.dist-info/RECORD +464 -0
  291. gr4vy-1.10.12.dist-info/RECORD +0 -451
  292. {gr4vy-1.10.12.dist-info → gr4vy-1.10.14.dist-info}/WHEEL +0 -0
@@ -97,44 +97,38 @@ class DigitalWallet(BaseModel):
97
97
 
98
98
  @model_serializer(mode="wrap")
99
99
  def serialize_model(self, handler):
100
- optional_fields = [
101
- "type",
102
- "merchant_display_name",
103
- "merchant_url",
104
- "merchant_country_code",
105
- "active_certificate_count",
106
- "pending_certificate_count",
107
- "expired_certificate_count",
108
- "fields",
109
- ]
110
- nullable_fields = [
111
- "merchant_display_name",
112
- "merchant_url",
113
- "merchant_country_code",
114
- "fields",
115
- ]
116
- null_default_fields = []
117
-
100
+ optional_fields = set(
101
+ [
102
+ "type",
103
+ "merchant_display_name",
104
+ "merchant_url",
105
+ "merchant_country_code",
106
+ "active_certificate_count",
107
+ "pending_certificate_count",
108
+ "expired_certificate_count",
109
+ "fields",
110
+ ]
111
+ )
112
+ nullable_fields = set(
113
+ ["merchant_display_name", "merchant_url", "merchant_country_code", "fields"]
114
+ )
118
115
  serialized = handler(self)
119
-
120
116
  m = {}
121
117
 
122
118
  for n, f in type(self).model_fields.items():
123
119
  k = f.alias or n
124
120
  val = serialized.get(k)
125
- serialized.pop(k, None)
126
-
127
- optional_nullable = k in optional_fields and k in nullable_fields
128
- is_set = (
129
- self.__pydantic_fields_set__.intersection({n})
130
- or k in null_default_fields
131
- ) # pylint: disable=no-member
132
-
133
- if val is not None and val != UNSET_SENTINEL:
134
- m[k] = val
135
- elif val != UNSET_SENTINEL and (
136
- not k in optional_fields or (optional_nullable and is_set)
137
- ):
138
- m[k] = val
121
+ is_nullable_and_explicitly_set = (
122
+ k in nullable_fields
123
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
124
+ )
125
+
126
+ if val != UNSET_SENTINEL:
127
+ if (
128
+ val is not None
129
+ or k not in optional_fields
130
+ or is_nullable_and_explicitly_set
131
+ ):
132
+ m[k] = val
139
133
 
140
134
  return m
@@ -39,39 +39,34 @@ class DigitalWalletCreate(BaseModel):
39
39
 
40
40
  @model_serializer(mode="wrap")
41
41
  def serialize_model(self, handler):
42
- optional_fields = [
43
- "merchant_display_name",
44
- "merchant_url",
45
- "merchant_country_code",
46
- "domain_names",
47
- ]
48
- nullable_fields = [
49
- "merchant_display_name",
50
- "merchant_url",
51
- "merchant_country_code",
52
- ]
53
- null_default_fields = []
54
-
42
+ optional_fields = set(
43
+ [
44
+ "merchant_display_name",
45
+ "merchant_url",
46
+ "merchant_country_code",
47
+ "domain_names",
48
+ ]
49
+ )
50
+ nullable_fields = set(
51
+ ["merchant_display_name", "merchant_url", "merchant_country_code"]
52
+ )
55
53
  serialized = handler(self)
56
-
57
54
  m = {}
58
55
 
59
56
  for n, f in type(self).model_fields.items():
60
57
  k = f.alias or n
61
58
  val = serialized.get(k)
62
- serialized.pop(k, None)
63
-
64
- optional_nullable = k in optional_fields and k in nullable_fields
65
- is_set = (
66
- self.__pydantic_fields_set__.intersection({n})
67
- or k in null_default_fields
68
- ) # pylint: disable=no-member
69
-
70
- if val is not None and val != UNSET_SENTINEL:
71
- m[k] = val
72
- elif val != UNSET_SENTINEL and (
73
- not k in optional_fields or (optional_nullable and is_set)
74
- ):
75
- m[k] = val
59
+ is_nullable_and_explicitly_set = (
60
+ k in nullable_fields
61
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
62
+ )
63
+
64
+ if val != UNSET_SENTINEL:
65
+ if (
66
+ val is not None
67
+ or k not in optional_fields
68
+ or is_nullable_and_explicitly_set
69
+ ):
70
+ m[k] = val
76
71
 
77
72
  return m
@@ -32,42 +32,41 @@ class DigitalWalletUpdate(BaseModel):
32
32
 
33
33
  @model_serializer(mode="wrap")
34
34
  def serialize_model(self, handler):
35
- optional_fields = [
36
- "merchant_name",
37
- "domain_names",
38
- "merchant_display_name",
39
- "merchant_url",
40
- "merchant_country_code",
41
- ]
42
- nullable_fields = [
43
- "merchant_name",
44
- "domain_names",
45
- "merchant_display_name",
46
- "merchant_url",
47
- "merchant_country_code",
48
- ]
49
- null_default_fields = []
50
-
35
+ optional_fields = set(
36
+ [
37
+ "merchant_name",
38
+ "domain_names",
39
+ "merchant_display_name",
40
+ "merchant_url",
41
+ "merchant_country_code",
42
+ ]
43
+ )
44
+ nullable_fields = set(
45
+ [
46
+ "merchant_name",
47
+ "domain_names",
48
+ "merchant_display_name",
49
+ "merchant_url",
50
+ "merchant_country_code",
51
+ ]
52
+ )
51
53
  serialized = handler(self)
52
-
53
54
  m = {}
54
55
 
55
56
  for n, f in type(self).model_fields.items():
56
57
  k = f.alias or n
57
58
  val = serialized.get(k)
58
- serialized.pop(k, None)
59
-
60
- optional_nullable = k in optional_fields and k in nullable_fields
61
- is_set = (
62
- self.__pydantic_fields_set__.intersection({n})
63
- or k in null_default_fields
64
- ) # pylint: disable=no-member
65
-
66
- if val is not None and val != UNSET_SENTINEL:
67
- m[k] = val
68
- elif val != UNSET_SENTINEL and (
69
- not k in optional_fields or (optional_nullable and is_set)
70
- ):
71
- m[k] = val
59
+ is_nullable_and_explicitly_set = (
60
+ k in nullable_fields
61
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
62
+ )
63
+
64
+ if val != UNSET_SENTINEL:
65
+ if (
66
+ val is not None
67
+ or k not in optional_fields
68
+ or is_nullable_and_explicitly_set
69
+ ):
70
+ m[k] = val
72
71
 
73
72
  return m
@@ -18,30 +18,25 @@ class DlocalOptions(BaseModel):
18
18
 
19
19
  @model_serializer(mode="wrap")
20
20
  def serialize_model(self, handler):
21
- optional_fields = ["wallet"]
22
- nullable_fields = ["wallet"]
23
- null_default_fields = []
24
-
21
+ optional_fields = set(["wallet"])
22
+ nullable_fields = set(["wallet"])
25
23
  serialized = handler(self)
26
-
27
24
  m = {}
28
25
 
29
26
  for n, f in type(self).model_fields.items():
30
27
  k = f.alias or n
31
28
  val = serialized.get(k)
32
- serialized.pop(k, None)
33
-
34
- optional_nullable = k in optional_fields and k in nullable_fields
35
- is_set = (
36
- self.__pydantic_fields_set__.intersection({n})
37
- or k in null_default_fields
38
- ) # pylint: disable=no-member
39
-
40
- if val is not None and val != UNSET_SENTINEL:
41
- m[k] = val
42
- elif val != UNSET_SENTINEL and (
43
- not k in optional_fields or (optional_nullable and is_set)
44
- ):
45
- m[k] = val
29
+ is_nullable_and_explicitly_set = (
30
+ k in nullable_fields
31
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
32
+ )
33
+
34
+ if val != UNSET_SENTINEL:
35
+ if (
36
+ val is not None
37
+ or k not in optional_fields
38
+ or is_nullable_and_explicitly_set
39
+ ):
40
+ m[k] = val
46
41
 
47
42
  return m
@@ -21,30 +21,25 @@ class DlocalUPIOptions(BaseModel):
21
21
 
22
22
  @model_serializer(mode="wrap")
23
23
  def serialize_model(self, handler):
24
- optional_fields = ["wallet"]
25
- nullable_fields = ["wallet"]
26
- null_default_fields = []
27
-
24
+ optional_fields = set(["wallet"])
25
+ nullable_fields = set(["wallet"])
28
26
  serialized = handler(self)
29
-
30
27
  m = {}
31
28
 
32
29
  for n, f in type(self).model_fields.items():
33
30
  k = f.alias or n
34
31
  val = serialized.get(k)
35
- serialized.pop(k, None)
36
-
37
- optional_nullable = k in optional_fields and k in nullable_fields
38
- is_set = (
39
- self.__pydantic_fields_set__.intersection({n})
40
- or k in null_default_fields
41
- ) # pylint: disable=no-member
42
-
43
- if val is not None and val != UNSET_SENTINEL:
44
- m[k] = val
45
- elif val != UNSET_SENTINEL and (
46
- not k in optional_fields or (optional_nullable and is_set)
47
- ):
48
- m[k] = val
32
+ is_nullable_and_explicitly_set = (
33
+ k in nullable_fields
34
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
35
+ )
36
+
37
+ if val != UNSET_SENTINEL:
38
+ if (
39
+ val is not None
40
+ or k not in optional_fields
41
+ or is_nullable_and_explicitly_set
42
+ ):
43
+ m[k] = val
49
44
 
50
45
  return m
@@ -46,44 +46,29 @@ class DlocalUPIWalletOptions(BaseModel):
46
46
 
47
47
  @model_serializer(mode="wrap")
48
48
  def serialize_model(self, handler):
49
- optional_fields = [
50
- "name",
51
- "email",
52
- "token",
53
- "username",
54
- "verify",
55
- "recurring_info",
56
- ]
57
- nullable_fields = [
58
- "name",
59
- "email",
60
- "token",
61
- "username",
62
- "verify",
63
- "recurring_info",
64
- ]
65
- null_default_fields = []
66
-
49
+ optional_fields = set(
50
+ ["name", "email", "token", "username", "verify", "recurring_info"]
51
+ )
52
+ nullable_fields = set(
53
+ ["name", "email", "token", "username", "verify", "recurring_info"]
54
+ )
67
55
  serialized = handler(self)
68
-
69
56
  m = {}
70
57
 
71
58
  for n, f in type(self).model_fields.items():
72
59
  k = f.alias or n
73
60
  val = serialized.get(k)
74
- serialized.pop(k, None)
75
-
76
- optional_nullable = k in optional_fields and k in nullable_fields
77
- is_set = (
78
- self.__pydantic_fields_set__.intersection({n})
79
- or k in null_default_fields
80
- ) # pylint: disable=no-member
81
-
82
- if val is not None and val != UNSET_SENTINEL:
83
- m[k] = val
84
- elif val != UNSET_SENTINEL and (
85
- not k in optional_fields or (optional_nullable and is_set)
86
- ):
87
- m[k] = val
61
+ is_nullable_and_explicitly_set = (
62
+ k in nullable_fields
63
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
64
+ )
65
+
66
+ if val != UNSET_SENTINEL:
67
+ if (
68
+ val is not None
69
+ or k not in optional_fields
70
+ or is_nullable_and_explicitly_set
71
+ ):
72
+ m[k] = val
88
73
 
89
74
  return m
@@ -37,30 +37,25 @@ class DlocalWalletOptions(BaseModel):
37
37
 
38
38
  @model_serializer(mode="wrap")
39
39
  def serialize_model(self, handler):
40
- optional_fields = ["name", "email", "token", "username", "verify"]
41
- nullable_fields = ["name", "email", "token", "username", "verify"]
42
- null_default_fields = []
43
-
40
+ optional_fields = set(["name", "email", "token", "username", "verify"])
41
+ nullable_fields = set(["name", "email", "token", "username", "verify"])
44
42
  serialized = handler(self)
45
-
46
43
  m = {}
47
44
 
48
45
  for n, f in type(self).model_fields.items():
49
46
  k = f.alias or n
50
47
  val = serialized.get(k)
51
- serialized.pop(k, None)
52
-
53
- optional_nullable = k in optional_fields and k in nullable_fields
54
- is_set = (
55
- self.__pydantic_fields_set__.intersection({n})
56
- or k in null_default_fields
57
- ) # pylint: disable=no-member
58
-
59
- if val is not None and val != UNSET_SENTINEL:
60
- m[k] = val
61
- elif val != UNSET_SENTINEL and (
62
- not k in optional_fields or (optional_nullable and is_set)
63
- ):
64
- m[k] = val
48
+ is_nullable_and_explicitly_set = (
49
+ k in nullable_fields
50
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
51
+ )
52
+
53
+ if val != UNSET_SENTINEL:
54
+ if (
55
+ val is not None
56
+ or k not in optional_fields
57
+ or is_nullable_and_explicitly_set
58
+ ):
59
+ m[k] = val
65
60
 
66
61
  return m
@@ -1,9 +1,10 @@
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
4
+ from gr4vy.types import BaseModel, UNSET_SENTINEL
5
5
  from gr4vy.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
6
6
  import pydantic
7
+ from pydantic import model_serializer
7
8
  from typing import Optional
8
9
  from typing_extensions import Annotated, NotRequired, TypedDict
9
10
 
@@ -21,6 +22,22 @@ class ExpirePaymentLinkGlobals(BaseModel):
21
22
  ] = None
22
23
  r"""The ID of the merchant account to use for this request."""
23
24
 
25
+ @model_serializer(mode="wrap")
26
+ def serialize_model(self, handler):
27
+ optional_fields = set(["merchant_account_id"])
28
+ serialized = handler(self)
29
+ m = {}
30
+
31
+ for n, f in type(self).model_fields.items():
32
+ k = f.alias or n
33
+ val = serialized.get(k)
34
+
35
+ if val != UNSET_SENTINEL:
36
+ if val is not None or k not in optional_fields:
37
+ m[k] = val
38
+
39
+ return m
40
+
24
41
 
25
42
  class ExpirePaymentLinkRequestTypedDict(TypedDict):
26
43
  payment_link_id: str
@@ -41,3 +58,19 @@ class ExpirePaymentLinkRequest(BaseModel):
41
58
  FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
42
59
  ] = None
43
60
  r"""The ID of the merchant account to use for this request."""
61
+
62
+ @model_serializer(mode="wrap")
63
+ def serialize_model(self, handler):
64
+ optional_fields = set(["merchant_account_id"])
65
+ serialized = handler(self)
66
+ m = {}
67
+
68
+ for n, f in type(self).model_fields.items():
69
+ k = f.alias or n
70
+ val = serialized.get(k)
71
+
72
+ if val != UNSET_SENTINEL:
73
+ if val is not None or k not in optional_fields:
74
+ m[k] = val
75
+
76
+ return m
@@ -41,40 +41,39 @@ class FiservInstallmentOptions(BaseModel):
41
41
 
42
42
  @model_serializer(mode="wrap")
43
43
  def serialize_model(self, handler):
44
- optional_fields = [
45
- "numberOfInstallments",
46
- "installmentsInterest",
47
- "installmentDelayMonths",
48
- "merchantAdviceCodeSupported",
49
- ]
50
- nullable_fields = [
51
- "numberOfInstallments",
52
- "installmentsInterest",
53
- "installmentDelayMonths",
54
- "merchantAdviceCodeSupported",
55
- ]
56
- null_default_fields = []
57
-
44
+ optional_fields = set(
45
+ [
46
+ "numberOfInstallments",
47
+ "installmentsInterest",
48
+ "installmentDelayMonths",
49
+ "merchantAdviceCodeSupported",
50
+ ]
51
+ )
52
+ nullable_fields = set(
53
+ [
54
+ "numberOfInstallments",
55
+ "installmentsInterest",
56
+ "installmentDelayMonths",
57
+ "merchantAdviceCodeSupported",
58
+ ]
59
+ )
58
60
  serialized = handler(self)
59
-
60
61
  m = {}
61
62
 
62
63
  for n, f in type(self).model_fields.items():
63
64
  k = f.alias or n
64
65
  val = serialized.get(k)
65
- serialized.pop(k, None)
66
-
67
- optional_nullable = k in optional_fields and k in nullable_fields
68
- is_set = (
69
- self.__pydantic_fields_set__.intersection({n})
70
- or k in null_default_fields
71
- ) # pylint: disable=no-member
66
+ is_nullable_and_explicitly_set = (
67
+ k in nullable_fields
68
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
69
+ )
72
70
 
73
- if val is not None and val != UNSET_SENTINEL:
74
- m[k] = val
75
- elif val != UNSET_SENTINEL and (
76
- not k in optional_fields or (optional_nullable and is_set)
77
- ):
78
- m[k] = val
71
+ if val != UNSET_SENTINEL:
72
+ if (
73
+ val is not None
74
+ or k not in optional_fields
75
+ or is_nullable_and_explicitly_set
76
+ ):
77
+ m[k] = val
79
78
 
80
79
  return m
@@ -25,30 +25,25 @@ class FiservOptions(BaseModel):
25
25
 
26
26
  @model_serializer(mode="wrap")
27
27
  def serialize_model(self, handler):
28
- optional_fields = ["installmentOptions"]
29
- nullable_fields = ["installmentOptions"]
30
- null_default_fields = []
31
-
28
+ optional_fields = set(["installmentOptions"])
29
+ nullable_fields = set(["installmentOptions"])
32
30
  serialized = handler(self)
33
-
34
31
  m = {}
35
32
 
36
33
  for n, f in type(self).model_fields.items():
37
34
  k = f.alias or n
38
35
  val = serialized.get(k)
39
- serialized.pop(k, None)
40
-
41
- optional_nullable = k in optional_fields and k in nullable_fields
42
- is_set = (
43
- self.__pydantic_fields_set__.intersection({n})
44
- or k in null_default_fields
45
- ) # pylint: disable=no-member
46
-
47
- if val is not None and val != UNSET_SENTINEL:
48
- m[k] = val
49
- elif val != UNSET_SENTINEL and (
50
- not k in optional_fields or (optional_nullable and is_set)
51
- ):
52
- m[k] = val
36
+ is_nullable_and_explicitly_set = (
37
+ k in nullable_fields
38
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
39
+ )
40
+
41
+ if val != UNSET_SENTINEL:
42
+ if (
43
+ val is not None
44
+ or k not in optional_fields
45
+ or is_nullable_and_explicitly_set
46
+ ):
47
+ m[k] = val
53
48
 
54
49
  return m
@@ -63,42 +63,41 @@ class ForterAntiFraudOptions(BaseModel):
63
63
 
64
64
  @model_serializer(mode="wrap")
65
65
  def serialize_model(self, handler):
66
- optional_fields = [
67
- "delivery_type",
68
- "delivery_method",
69
- "is_guest_buyer",
70
- "cart_items",
71
- "total_discount",
72
- ]
73
- nullable_fields = [
74
- "delivery_type",
75
- "delivery_method",
76
- "is_guest_buyer",
77
- "cart_items",
78
- "total_discount",
79
- ]
80
- null_default_fields = []
81
-
66
+ optional_fields = set(
67
+ [
68
+ "delivery_type",
69
+ "delivery_method",
70
+ "is_guest_buyer",
71
+ "cart_items",
72
+ "total_discount",
73
+ ]
74
+ )
75
+ nullable_fields = set(
76
+ [
77
+ "delivery_type",
78
+ "delivery_method",
79
+ "is_guest_buyer",
80
+ "cart_items",
81
+ "total_discount",
82
+ ]
83
+ )
82
84
  serialized = handler(self)
83
-
84
85
  m = {}
85
86
 
86
87
  for n, f in type(self).model_fields.items():
87
88
  k = f.alias or n
88
89
  val = serialized.get(k)
89
- serialized.pop(k, None)
90
-
91
- optional_nullable = k in optional_fields and k in nullable_fields
92
- is_set = (
93
- self.__pydantic_fields_set__.intersection({n})
94
- or k in null_default_fields
95
- ) # pylint: disable=no-member
96
-
97
- if val is not None and val != UNSET_SENTINEL:
98
- m[k] = val
99
- elif val != UNSET_SENTINEL and (
100
- not k in optional_fields or (optional_nullable and is_set)
101
- ):
102
- m[k] = val
90
+ is_nullable_and_explicitly_set = (
91
+ k in nullable_fields
92
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
93
+ )
94
+
95
+ if val != UNSET_SENTINEL:
96
+ if (
97
+ val is not None
98
+ or k not in optional_fields
99
+ or is_nullable_and_explicitly_set
100
+ ):
101
+ m[k] = val
103
102
 
104
103
  return m