moovio_sdk 0.3.8__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 (586) hide show
  1. moovio_sdk/__init__.py +17 -0
  2. moovio_sdk/_hooks/__init__.py +5 -0
  3. moovio_sdk/_hooks/registration.py +13 -0
  4. moovio_sdk/_hooks/sdkhooks.py +76 -0
  5. moovio_sdk/_hooks/types.py +106 -0
  6. moovio_sdk/_version.py +15 -0
  7. moovio_sdk/accounts.py +2461 -0
  8. moovio_sdk/adjustments.py +463 -0
  9. moovio_sdk/apple_pay.py +1417 -0
  10. moovio_sdk/authentication.py +531 -0
  11. moovio_sdk/avatars.py +231 -0
  12. moovio_sdk/bank_accounts.py +2445 -0
  13. moovio_sdk/basesdk.py +363 -0
  14. moovio_sdk/branding.py +1089 -0
  15. moovio_sdk/capabilities.py +1001 -0
  16. moovio_sdk/card_issuing.py +1351 -0
  17. moovio_sdk/cards.py +1469 -0
  18. moovio_sdk/disputes.py +2985 -0
  19. moovio_sdk/end_to_end_encryption.py +453 -0
  20. moovio_sdk/enriched_address.py +307 -0
  21. moovio_sdk/enriched_profile.py +235 -0
  22. moovio_sdk/fee_plans.py +1759 -0
  23. moovio_sdk/files.py +775 -0
  24. moovio_sdk/httpclient.py +136 -0
  25. moovio_sdk/industries.py +239 -0
  26. moovio_sdk/institutions.py +261 -0
  27. moovio_sdk/issuing_transactions.py +1228 -0
  28. moovio_sdk/models/__init__.py +4 -0
  29. moovio_sdk/models/components/__init__.py +1411 -0
  30. moovio_sdk/models/components/account.py +96 -0
  31. moovio_sdk/models/components/accountcapability.py +20 -0
  32. moovio_sdk/models/components/accountcountries.py +18 -0
  33. moovio_sdk/models/components/accountnameverification.py +28 -0
  34. moovio_sdk/models/components/accounttype.py +11 -0
  35. moovio_sdk/models/components/accountverificationstatus.py +19 -0
  36. moovio_sdk/models/components/achcreditsamedaypaymentmethod.py +38 -0
  37. moovio_sdk/models/components/achcreditstandardpaymentmethod.py +38 -0
  38. moovio_sdk/models/components/achdebitcollectpaymentmethod.py +38 -0
  39. moovio_sdk/models/components/achdebitfundpaymentmethod.py +38 -0
  40. moovio_sdk/models/components/achexception.py +20 -0
  41. moovio_sdk/models/components/achlocation.py +26 -0
  42. moovio_sdk/models/components/achparticipant.py +93 -0
  43. moovio_sdk/models/components/achpaymentdetails.py +30 -0
  44. moovio_sdk/models/components/achpaymentdetailserror.py +22 -0
  45. moovio_sdk/models/components/achpaymentsettings.py +16 -0
  46. moovio_sdk/models/components/achreturncode.py +51 -0
  47. moovio_sdk/models/components/achtransactiondetails.py +94 -0
  48. moovio_sdk/models/components/achtransactionstatus.py +15 -0
  49. moovio_sdk/models/components/addcapabilities.py +15 -0
  50. moovio_sdk/models/components/address.py +30 -0
  51. moovio_sdk/models/components/addresserror.py +32 -0
  52. moovio_sdk/models/components/addresssuggestion.py +34 -0
  53. moovio_sdk/models/components/addressupdate.py +32 -0
  54. moovio_sdk/models/components/adjustment.py +29 -0
  55. moovio_sdk/models/components/amount.py +26 -0
  56. moovio_sdk/models/components/amountdecimal.py +27 -0
  57. moovio_sdk/models/components/amountupdate.py +27 -0
  58. moovio_sdk/models/components/amountvalidationerror.py +17 -0
  59. moovio_sdk/models/components/applebillingcontact.py +53 -0
  60. moovio_sdk/models/components/applepayheader.py +41 -0
  61. moovio_sdk/models/components/applepaymerchantdomains.py +32 -0
  62. moovio_sdk/models/components/applepaypaymentmethod.py +33 -0
  63. moovio_sdk/models/components/applepayresponse.py +70 -0
  64. moovio_sdk/models/components/applicationscope.py +41 -0
  65. moovio_sdk/models/components/asynccreatedrefund.py +26 -0
  66. moovio_sdk/models/components/asynctransfer.py +18 -0
  67. moovio_sdk/models/components/authorizeduser.py +21 -0
  68. moovio_sdk/models/components/authtoken.py +36 -0
  69. moovio_sdk/models/components/authtokenrequest.py +46 -0
  70. moovio_sdk/models/components/bankaccount.py +98 -0
  71. moovio_sdk/models/components/bankaccountexception.py +96 -0
  72. moovio_sdk/models/components/bankaccountholdertype.py +11 -0
  73. moovio_sdk/models/components/bankaccountintegration.py +34 -0
  74. moovio_sdk/models/components/bankaccountpayload.py +21 -0
  75. moovio_sdk/models/components/bankaccountstatus.py +12 -0
  76. moovio_sdk/models/components/bankaccountstatusreason.py +23 -0
  77. moovio_sdk/models/components/bankaccounttype.py +13 -0
  78. moovio_sdk/models/components/bankaccountverification.py +30 -0
  79. moovio_sdk/models/components/bankaccountverificationcreated.py +21 -0
  80. moovio_sdk/models/components/bankaccountverificationmethod.py +9 -0
  81. moovio_sdk/models/components/bankaccountverificationstatus.py +13 -0
  82. moovio_sdk/models/components/bankaccountwaitfor.py +9 -0
  83. moovio_sdk/models/components/basicpaymentmethod.py +24 -0
  84. moovio_sdk/models/components/billablefee.py +54 -0
  85. moovio_sdk/models/components/birthdate.py +19 -0
  86. moovio_sdk/models/components/birthdateerror.py +20 -0
  87. moovio_sdk/models/components/birthdateupdate.py +20 -0
  88. moovio_sdk/models/components/birthdatevalidationerror.py +20 -0
  89. moovio_sdk/models/components/brandcolor.py +15 -0
  90. moovio_sdk/models/components/brandcolors.py +21 -0
  91. moovio_sdk/models/components/brandcolorvalidationerror.py +14 -0
  92. moovio_sdk/models/components/brandproperties.py +16 -0
  93. moovio_sdk/models/components/businessprofile.py +81 -0
  94. moovio_sdk/models/components/businesstype.py +19 -0
  95. moovio_sdk/models/components/calltoaction.py +19 -0
  96. moovio_sdk/models/components/cancellation.py +22 -0
  97. moovio_sdk/models/components/cancellationstatus.py +10 -0
  98. moovio_sdk/models/components/capabilitieserror.py +14 -0
  99. moovio_sdk/models/components/capability.py +56 -0
  100. moovio_sdk/models/components/capabilityid.py +18 -0
  101. moovio_sdk/models/components/capabilityrequirement.py +26 -0
  102. moovio_sdk/models/components/capabilitystatus.py +13 -0
  103. moovio_sdk/models/components/card.py +164 -0
  104. moovio_sdk/models/components/cardaccountupdater.py +28 -0
  105. moovio_sdk/models/components/cardacquiringdispute.py +26 -0
  106. moovio_sdk/models/components/cardacquiringmodel.py +11 -0
  107. moovio_sdk/models/components/cardacquiringrefund.py +42 -0
  108. moovio_sdk/models/components/cardaddress.py +32 -0
  109. moovio_sdk/models/components/cardbrand.py +14 -0
  110. moovio_sdk/models/components/cardexpiration.py +20 -0
  111. moovio_sdk/models/components/cardexpirationerror.py +17 -0
  112. moovio_sdk/models/components/cardissuingnetwork.py +12 -0
  113. moovio_sdk/models/components/cardpaymentdetails.py +23 -0
  114. moovio_sdk/models/components/cardpaymentdetailserror.py +17 -0
  115. moovio_sdk/models/components/cardpaymentpaymentmethod.py +33 -0
  116. moovio_sdk/models/components/cardpaymentsettings.py +23 -0
  117. moovio_sdk/models/components/cardtransactiondetails.py +94 -0
  118. moovio_sdk/models/components/cardtransactionfailurecode.py +32 -0
  119. moovio_sdk/models/components/cardtransactionstatus.py +15 -0
  120. moovio_sdk/models/components/cardtype.py +13 -0
  121. moovio_sdk/models/components/cardupdatereason.py +16 -0
  122. moovio_sdk/models/components/cardverification.py +38 -0
  123. moovio_sdk/models/components/cardverificationresult.py +12 -0
  124. moovio_sdk/models/components/cardvolumedistribution.py +29 -0
  125. moovio_sdk/models/components/cardvolumedistributionerror.py +32 -0
  126. moovio_sdk/models/components/collectionpaymentmethodtype.py +12 -0
  127. moovio_sdk/models/components/colorsvalidationerror.py +21 -0
  128. moovio_sdk/models/components/completebankaccountverification.py +15 -0
  129. moovio_sdk/models/components/completedmicrodeposits.py +14 -0
  130. moovio_sdk/models/components/completemicrodeposits.py +20 -0
  131. moovio_sdk/models/components/countrieserrors.py +14 -0
  132. moovio_sdk/models/components/createaccount.py +78 -0
  133. moovio_sdk/models/components/createaccounterror.py +44 -0
  134. moovio_sdk/models/components/createaccountsettings.py +40 -0
  135. moovio_sdk/models/components/createapplepaysession.py +21 -0
  136. moovio_sdk/models/components/createauthorizeduser.py +26 -0
  137. moovio_sdk/models/components/createauthorizedusererror.py +24 -0
  138. moovio_sdk/models/components/createauthorizeduserupdate.py +28 -0
  139. moovio_sdk/models/components/createbusinesserror.py +88 -0
  140. moovio_sdk/models/components/createbusinessprofile.py +69 -0
  141. moovio_sdk/models/components/createevidencefilemultipart.py +63 -0
  142. moovio_sdk/models/components/createevidencetext.py +20 -0
  143. moovio_sdk/models/components/createfeeplanagreement.py +14 -0
  144. moovio_sdk/models/components/createindividualerror.py +72 -0
  145. moovio_sdk/models/components/createindividualprofile.py +37 -0
  146. moovio_sdk/models/components/createpaymentlink.py +95 -0
  147. moovio_sdk/models/components/createprofile.py +22 -0
  148. moovio_sdk/models/components/createprofileerror.py +19 -0
  149. moovio_sdk/models/components/createrefund.py +26 -0
  150. moovio_sdk/models/components/createrefundresponse.py +18 -0
  151. moovio_sdk/models/components/createrepresentative.py +50 -0
  152. moovio_sdk/models/components/createreversal.py +15 -0
  153. moovio_sdk/models/components/createsweepconfig.py +41 -0
  154. moovio_sdk/models/components/createterminalapplication.py +42 -0
  155. moovio_sdk/models/components/createtransfer.py +49 -0
  156. moovio_sdk/models/components/createtransferdestination.py +37 -0
  157. moovio_sdk/models/components/createtransferdestinationach.py +26 -0
  158. moovio_sdk/models/components/createtransferdestinationcard.py +19 -0
  159. moovio_sdk/models/components/createtransferoptions.py +24 -0
  160. moovio_sdk/models/components/createtransfersource.py +48 -0
  161. moovio_sdk/models/components/createtransfersourceach.py +40 -0
  162. moovio_sdk/models/components/createtransfersourcecard.py +35 -0
  163. moovio_sdk/models/components/customersupport.py +33 -0
  164. moovio_sdk/models/components/customersupporterror.py +25 -0
  165. moovio_sdk/models/components/debitholdperiod.py +12 -0
  166. moovio_sdk/models/components/disbursementpaymentmethodtype.py +13 -0
  167. moovio_sdk/models/components/displayoptionserror.py +23 -0
  168. moovio_sdk/models/components/dispute.py +76 -0
  169. moovio_sdk/models/components/disputeevidenceresponse.py +49 -0
  170. moovio_sdk/models/components/disputephase.py +13 -0
  171. moovio_sdk/models/components/disputestatus.py +20 -0
  172. moovio_sdk/models/components/disputetransferdetails.py +16 -0
  173. moovio_sdk/models/components/document.py +37 -0
  174. moovio_sdk/models/components/documenttype.py +13 -0
  175. moovio_sdk/models/components/domesticpullfromcard.py +12 -0
  176. moovio_sdk/models/components/domesticpushtocard.py +13 -0
  177. moovio_sdk/models/components/e2eetoken.py +25 -0
  178. moovio_sdk/models/components/e2eetokenupdate.py +26 -0
  179. moovio_sdk/models/components/end2endencryptionerror.py +14 -0
  180. moovio_sdk/models/components/enrichedaddressresponse.py +15 -0
  181. moovio_sdk/models/components/enrichedbusinessprofile.py +37 -0
  182. moovio_sdk/models/components/enrichedbusinessresponse.py +18 -0
  183. moovio_sdk/models/components/enrichedindustries.py +15 -0
  184. moovio_sdk/models/components/enrichedindustry.py +32 -0
  185. moovio_sdk/models/components/enrichedindustrycodes.py +17 -0
  186. moovio_sdk/models/components/evidencetextresponse.py +28 -0
  187. moovio_sdk/models/components/evidencetype.py +15 -0
  188. moovio_sdk/models/components/evidenceuploadresponse.py +50 -0
  189. moovio_sdk/models/components/facilitatorfee.py +48 -0
  190. moovio_sdk/models/components/feecategory.py +16 -0
  191. moovio_sdk/models/components/feemodel.py +12 -0
  192. moovio_sdk/models/components/feeplan.py +43 -0
  193. moovio_sdk/models/components/feeplanagreement.py +51 -0
  194. moovio_sdk/models/components/feeplanagreementstatus.py +9 -0
  195. moovio_sdk/models/components/feeproperties.py +49 -0
  196. moovio_sdk/models/components/filedetails.py +55 -0
  197. moovio_sdk/models/components/filepurpose.py +15 -0
  198. moovio_sdk/models/components/filestatus.py +12 -0
  199. moovio_sdk/models/components/fileuploadrequestmultipart.py +69 -0
  200. moovio_sdk/models/components/financialinstitutions.py +18 -0
  201. moovio_sdk/models/components/fulfillmentdetails.py +24 -0
  202. moovio_sdk/models/components/fulfillmentdetailserror.py +20 -0
  203. moovio_sdk/models/components/fullissuedcard.py +92 -0
  204. moovio_sdk/models/components/generatedby.py +39 -0
  205. moovio_sdk/models/components/generatedbyaccountid.py +15 -0
  206. moovio_sdk/models/components/generatedbybankaccountid.py +17 -0
  207. moovio_sdk/models/components/generatedbycardid.py +15 -0
  208. moovio_sdk/models/components/generatedbydisputeid.py +15 -0
  209. moovio_sdk/models/components/generatedbytransferid.py +15 -0
  210. moovio_sdk/models/components/governmentid.py +40 -0
  211. moovio_sdk/models/components/governmentiderror.py +40 -0
  212. moovio_sdk/models/components/granttype.py +15 -0
  213. moovio_sdk/models/components/incurredfee.py +44 -0
  214. moovio_sdk/models/components/individualname.py +32 -0
  215. moovio_sdk/models/components/individualnameerror.py +24 -0
  216. moovio_sdk/models/components/individualnameupdate.py +32 -0
  217. moovio_sdk/models/components/individualprofile.py +45 -0
  218. moovio_sdk/models/components/industrycodes.py +20 -0
  219. moovio_sdk/models/components/issuedcard.py +78 -0
  220. moovio_sdk/models/components/issuedcardauthorization.py +53 -0
  221. moovio_sdk/models/components/issuedcardauthorizationevent.py +37 -0
  222. moovio_sdk/models/components/issuedcardauthorizationeventresult.py +12 -0
  223. moovio_sdk/models/components/issuedcardeventtype.py +15 -0
  224. moovio_sdk/models/components/issuedcardformfactor.py +10 -0
  225. moovio_sdk/models/components/issuedcardstate.py +19 -0
  226. moovio_sdk/models/components/issuedcardtransaction.py +42 -0
  227. moovio_sdk/models/components/issuingauthorizationstatus.py +14 -0
  228. moovio_sdk/models/components/issuingcontrols.py +25 -0
  229. moovio_sdk/models/components/issuingcontrolserror.py +22 -0
  230. moovio_sdk/models/components/issuingintervallimit.py +10 -0
  231. moovio_sdk/models/components/issuingmerchantdata.py +47 -0
  232. moovio_sdk/models/components/issuingvelocitylimit.py +21 -0
  233. moovio_sdk/models/components/issuingvelocitylimiterror.py +17 -0
  234. moovio_sdk/models/components/jsonwebkey.py +103 -0
  235. moovio_sdk/models/components/linkapplepay.py +54 -0
  236. moovio_sdk/models/components/linkapplepaymentdata.py +51 -0
  237. moovio_sdk/models/components/linkapplepaymentmethod.py +38 -0
  238. moovio_sdk/models/components/linkapplepaytoken.py +63 -0
  239. moovio_sdk/models/components/linkbankaccount.py +26 -0
  240. moovio_sdk/models/components/linkcard.py +54 -0
  241. moovio_sdk/models/components/linkcardwaitfor.py +8 -0
  242. moovio_sdk/models/components/linkedapplepaypaymentmethod.py +30 -0
  243. moovio_sdk/models/components/listfeesfetchrequest.py +19 -0
  244. moovio_sdk/models/components/manualtermsofservice.py +34 -0
  245. moovio_sdk/models/components/manualtermsofserviceupdate.py +41 -0
  246. moovio_sdk/models/components/microdepositstatus.py +8 -0
  247. moovio_sdk/models/components/mode.py +11 -0
  248. moovio_sdk/models/components/moovfeedetails.py +36 -0
  249. moovio_sdk/models/components/moovwalletpaymentmethod.py +31 -0
  250. moovio_sdk/models/components/mxauthorizationcode.py +26 -0
  251. moovio_sdk/models/components/mxpayload.py +46 -0
  252. moovio_sdk/models/components/occurrence.py +44 -0
  253. moovio_sdk/models/components/occurrencesresponse.py +80 -0
  254. moovio_sdk/models/components/occurrencestatus.py +12 -0
  255. moovio_sdk/models/components/onboardinginvite.py +91 -0
  256. moovio_sdk/models/components/onboardinginviterequest.py +57 -0
  257. moovio_sdk/models/components/onboardingpartneraccount.py +31 -0
  258. moovio_sdk/models/components/partnerpricing.py +46 -0
  259. moovio_sdk/models/components/partnerpricingagreement.py +56 -0
  260. moovio_sdk/models/components/patchaccount.py +138 -0
  261. moovio_sdk/models/components/patchaccounterror.py +38 -0
  262. moovio_sdk/models/components/patchbusiness.py +72 -0
  263. moovio_sdk/models/components/patchindividual.py +43 -0
  264. moovio_sdk/models/components/patchprofile.py +29 -0
  265. moovio_sdk/models/components/patchsweepconfig.py +147 -0
  266. moovio_sdk/models/components/patchtransfer.py +51 -0
  267. moovio_sdk/models/components/paymentdetailserror.py +35 -0
  268. moovio_sdk/models/components/paymentlink.py +125 -0
  269. moovio_sdk/models/components/paymentlinkcustomeroptions.py +31 -0
  270. moovio_sdk/models/components/paymentlinkdisplayoptions.py +39 -0
  271. moovio_sdk/models/components/paymentlinkdisplayoptionsupdate.py +42 -0
  272. moovio_sdk/models/components/paymentlinkpaymentdetails.py +40 -0
  273. moovio_sdk/models/components/paymentlinkpaymentdetailsupdate.py +41 -0
  274. moovio_sdk/models/components/paymentlinkpayoutdetails.py +32 -0
  275. moovio_sdk/models/components/paymentlinkpayoutdetailsupdate.py +33 -0
  276. moovio_sdk/models/components/paymentlinkstatus.py +11 -0
  277. moovio_sdk/models/components/paymentmethod.py +82 -0
  278. moovio_sdk/models/components/paymentmethodsbankaccount.py +65 -0
  279. moovio_sdk/models/components/paymentmethodscard.py +121 -0
  280. moovio_sdk/models/components/paymentmethodswallet.py +14 -0
  281. moovio_sdk/models/components/paymentmethodtype.py +19 -0
  282. moovio_sdk/models/components/payoutdetailserror.py +21 -0
  283. moovio_sdk/models/components/payoutrecipient.py +23 -0
  284. moovio_sdk/models/components/payoutrecipienterror.py +14 -0
  285. moovio_sdk/models/components/payoutrecipientupdate.py +24 -0
  286. moovio_sdk/models/components/phonenumber.py +18 -0
  287. moovio_sdk/models/components/phonenumbererror.py +18 -0
  288. moovio_sdk/models/components/plaidintegration.py +39 -0
  289. moovio_sdk/models/components/plaidlinkintegration.py +36 -0
  290. moovio_sdk/models/components/plaidlinkpayload.py +45 -0
  291. moovio_sdk/models/components/plaidpayload.py +42 -0
  292. moovio_sdk/models/components/primaryregulator.py +13 -0
  293. moovio_sdk/models/components/profile.py +27 -0
  294. moovio_sdk/models/components/pullfromcardpaymentmethod.py +33 -0
  295. moovio_sdk/models/components/pushtocardpaymentmethod.py +33 -0
  296. moovio_sdk/models/components/qrcode.py +16 -0
  297. moovio_sdk/models/components/receiptkind.py +10 -0
  298. moovio_sdk/models/components/receiptrequest.py +75 -0
  299. moovio_sdk/models/components/receiptresponse.py +95 -0
  300. moovio_sdk/models/components/recur.py +40 -0
  301. moovio_sdk/models/components/refundcarddetails.py +44 -0
  302. moovio_sdk/models/components/refundcardstatus.py +12 -0
  303. moovio_sdk/models/components/refundstatus.py +11 -0
  304. moovio_sdk/models/components/registerapplepaymerchantdomains.py +22 -0
  305. moovio_sdk/models/components/representative.py +71 -0
  306. moovio_sdk/models/components/representativeresponsibilities.py +42 -0
  307. moovio_sdk/models/components/representativeresponsibilitieserror.py +26 -0
  308. moovio_sdk/models/components/requestcard.py +44 -0
  309. moovio_sdk/models/components/requirementerror.py +24 -0
  310. moovio_sdk/models/components/requirementerrorcode.py +25 -0
  311. moovio_sdk/models/components/requirementid.py +71 -0
  312. moovio_sdk/models/components/returnpolicytype.py +11 -0
  313. moovio_sdk/models/components/reversal.py +23 -0
  314. moovio_sdk/models/components/reversedwithcancellation.py +14 -0
  315. moovio_sdk/models/components/reversedwithrefund.py +16 -0
  316. moovio_sdk/models/components/revoketokenrequest.py +40 -0
  317. moovio_sdk/models/components/rtpcreditpaymentmethod.py +38 -0
  318. moovio_sdk/models/components/rtpfailurecode.py +19 -0
  319. moovio_sdk/models/components/rtprejectioncode.py +25 -0
  320. moovio_sdk/models/components/rtptransactiondetails.py +56 -0
  321. moovio_sdk/models/components/rtptransactionstatus.py +13 -0
  322. moovio_sdk/models/components/runtransfer.py +34 -0
  323. moovio_sdk/models/components/schedulepaymentmethod.py +56 -0
  324. moovio_sdk/models/components/scheduleresponse.py +60 -0
  325. moovio_sdk/models/components/seccode.py +13 -0
  326. moovio_sdk/models/components/security.py +32 -0
  327. moovio_sdk/models/components/sentreceipt.py +27 -0
  328. moovio_sdk/models/components/settings.py +30 -0
  329. moovio_sdk/models/components/sourcedestinationoptions.py +20 -0
  330. moovio_sdk/models/components/sweep.py +80 -0
  331. moovio_sdk/models/components/sweepconfig.py +81 -0
  332. moovio_sdk/models/components/sweepconfigpaymentmethod.py +31 -0
  333. moovio_sdk/models/components/sweepconfigstatus.py +9 -0
  334. moovio_sdk/models/components/sweepstatus.py +13 -0
  335. moovio_sdk/models/components/taxid.py +25 -0
  336. moovio_sdk/models/components/taxidupdate.py +26 -0
  337. moovio_sdk/models/components/terminalapplication.py +55 -0
  338. moovio_sdk/models/components/terminalapplicationplatform.py +12 -0
  339. moovio_sdk/models/components/terminalapplicationstatus.py +13 -0
  340. moovio_sdk/models/components/termsofservice.py +26 -0
  341. moovio_sdk/models/components/termsofserviceerror.py +39 -0
  342. moovio_sdk/models/components/termsofservicetoken.py +17 -0
  343. moovio_sdk/models/components/termsofservicetokenupdate.py +18 -0
  344. moovio_sdk/models/components/tokentype.py +10 -0
  345. moovio_sdk/models/components/transactionsource.py +16 -0
  346. moovio_sdk/models/components/transfer.py +126 -0
  347. moovio_sdk/models/components/transferaccount.py +20 -0
  348. moovio_sdk/models/components/transferdestination.py +83 -0
  349. moovio_sdk/models/components/transferfailurereason.py +14 -0
  350. moovio_sdk/models/components/transferoptions.py +23 -0
  351. moovio_sdk/models/components/transferresponse.py +15 -0
  352. moovio_sdk/models/components/transfersource.py +80 -0
  353. moovio_sdk/models/components/transferstatus.py +16 -0
  354. moovio_sdk/models/components/transferwaitfor.py +8 -0
  355. moovio_sdk/models/components/underwriting.py +56 -0
  356. moovio_sdk/models/components/underwritingstatus.py +16 -0
  357. moovio_sdk/models/components/updateapplepaymerchantdomains.py +26 -0
  358. moovio_sdk/models/components/updatebrand.py +15 -0
  359. moovio_sdk/models/components/updatecard.py +51 -0
  360. moovio_sdk/models/components/updatecardaddress.py +32 -0
  361. moovio_sdk/models/components/updatecardexpiration.py +17 -0
  362. moovio_sdk/models/components/updatecolor.py +14 -0
  363. moovio_sdk/models/components/updatecolors.py +18 -0
  364. moovio_sdk/models/components/updateevidence.py +23 -0
  365. moovio_sdk/models/components/updateissuedcard.py +44 -0
  366. moovio_sdk/models/components/updatepaymentlink.py +98 -0
  367. moovio_sdk/models/components/updaterepresentative.py +224 -0
  368. moovio_sdk/models/components/updateunderwriting.py +43 -0
  369. moovio_sdk/models/components/upsertschedule.py +26 -0
  370. moovio_sdk/models/components/verification.py +54 -0
  371. moovio_sdk/models/components/verificationstatus.py +17 -0
  372. moovio_sdk/models/components/verificationstatusdetail.py +23 -0
  373. moovio_sdk/models/components/volumebycustomertype.py +21 -0
  374. moovio_sdk/models/components/volumebycustomertypeerror.py +22 -0
  375. moovio_sdk/models/components/wallet.py +27 -0
  376. moovio_sdk/models/components/walletavailablebalance.py +30 -0
  377. moovio_sdk/models/components/wallettransaction.py +114 -0
  378. moovio_sdk/models/components/wallettransactionsourcetype.py +13 -0
  379. moovio_sdk/models/components/wallettransactionstatus.py +11 -0
  380. moovio_sdk/models/components/wallettransactiontype.py +32 -0
  381. moovio_sdk/models/errors/__init__.py +155 -0
  382. moovio_sdk/models/errors/addcapabilitieserror.py +23 -0
  383. moovio_sdk/models/errors/apierror.py +22 -0
  384. moovio_sdk/models/errors/assigncountrieserror.py +20 -0
  385. moovio_sdk/models/errors/authtokenrequesterror.py +22 -0
  386. moovio_sdk/models/errors/bankaccountvalidationerror.py +30 -0
  387. moovio_sdk/models/errors/brandvalidationerror.py +23 -0
  388. moovio_sdk/models/errors/cardacquiringrefund.py +44 -0
  389. moovio_sdk/models/errors/createaccount.py +24 -0
  390. moovio_sdk/models/errors/createpaymentlinkerror.py +46 -0
  391. moovio_sdk/models/errors/createsweepconfigerror.py +40 -0
  392. moovio_sdk/models/errors/feeplanagreementerror.py +22 -0
  393. moovio_sdk/models/errors/fileuploadvalidationerror.py +35 -0
  394. moovio_sdk/models/errors/filevalidationerror.py +28 -0
  395. moovio_sdk/models/errors/genericerror.py +19 -0
  396. moovio_sdk/models/errors/linkapplepayerror.py +36 -0
  397. moovio_sdk/models/errors/linkcarderror.py +47 -0
  398. moovio_sdk/models/errors/microdepositvalidationerror.py +20 -0
  399. moovio_sdk/models/errors/onboardinginviteerror.py +34 -0
  400. moovio_sdk/models/errors/patchsweepconfigerror.py +38 -0
  401. moovio_sdk/models/errors/receiptvalidationerror.py +40 -0
  402. moovio_sdk/models/errors/refundvalidationerror.py +23 -0
  403. moovio_sdk/models/errors/representativevalidationerror.py +68 -0
  404. moovio_sdk/models/errors/requestcarderror.py +42 -0
  405. moovio_sdk/models/errors/reversalvalidationerror.py +20 -0
  406. moovio_sdk/models/errors/revoketokenrequesterror.py +22 -0
  407. moovio_sdk/models/errors/schedulevalidationerror.py +24 -0
  408. moovio_sdk/models/errors/terminalapplicationerror.py +30 -0
  409. moovio_sdk/models/errors/transfer.py +108 -0
  410. moovio_sdk/models/errors/transferoptionsvalidationerror.py +24 -0
  411. moovio_sdk/models/errors/transfervalidationerror.py +49 -0
  412. moovio_sdk/models/errors/updateaccount.py +24 -0
  413. moovio_sdk/models/errors/updatecarderror.py +43 -0
  414. moovio_sdk/models/errors/updateissuedcarderror.py +32 -0
  415. moovio_sdk/models/errors/updatepaymentlinkerror.py +36 -0
  416. moovio_sdk/models/errors/updateunderwritingerror.py +70 -0
  417. moovio_sdk/models/internal/__init__.py +6 -0
  418. moovio_sdk/models/internal/globals.py +40 -0
  419. moovio_sdk/models/operations/__init__.py +1824 -0
  420. moovio_sdk/models/operations/acceptdispute.py +71 -0
  421. moovio_sdk/models/operations/assignaccountcountries.py +75 -0
  422. moovio_sdk/models/operations/cancelschedule.py +67 -0
  423. moovio_sdk/models/operations/completebankaccountverification.py +85 -0
  424. moovio_sdk/models/operations/completemicrodeposits.py +87 -0
  425. moovio_sdk/models/operations/createaccesstoken.py +52 -0
  426. moovio_sdk/models/operations/createaccount.py +52 -0
  427. moovio_sdk/models/operations/createapplepaysession.py +81 -0
  428. moovio_sdk/models/operations/createbrand.py +75 -0
  429. moovio_sdk/models/operations/createcancellation.py +75 -0
  430. moovio_sdk/models/operations/createfeeplanagreements.py +80 -0
  431. moovio_sdk/models/operations/createonboardinginvite.py +52 -0
  432. moovio_sdk/models/operations/createpaymentlink.py +78 -0
  433. moovio_sdk/models/operations/createreceipts.py +52 -0
  434. moovio_sdk/models/operations/createrepresentative.py +80 -0
  435. moovio_sdk/models/operations/createreversal.py +98 -0
  436. moovio_sdk/models/operations/createschedule.py +78 -0
  437. moovio_sdk/models/operations/createsweepconfig.py +78 -0
  438. moovio_sdk/models/operations/createterminalapplication.py +54 -0
  439. moovio_sdk/models/operations/createtransfer.py +125 -0
  440. moovio_sdk/models/operations/createtransferoptions.py +52 -0
  441. moovio_sdk/models/operations/deletedisputeevidencefile.py +74 -0
  442. moovio_sdk/models/operations/deleterepresentative.py +71 -0
  443. moovio_sdk/models/operations/deleteterminalapplication.py +60 -0
  444. moovio_sdk/models/operations/disablebankaccount.py +67 -0
  445. moovio_sdk/models/operations/disablecapability.py +76 -0
  446. moovio_sdk/models/operations/disablecard.py +67 -0
  447. moovio_sdk/models/operations/disablepaymentlink.py +67 -0
  448. moovio_sdk/models/operations/disconnectaccount.py +60 -0
  449. moovio_sdk/models/operations/generateendtoendkey.py +60 -0
  450. moovio_sdk/models/operations/getaccount.py +64 -0
  451. moovio_sdk/models/operations/getaccountcountries.py +64 -0
  452. moovio_sdk/models/operations/getadjustment.py +71 -0
  453. moovio_sdk/models/operations/getapplepaymerchantdomains.py +68 -0
  454. moovio_sdk/models/operations/getavatar.py +66 -0
  455. moovio_sdk/models/operations/getbankaccount.py +71 -0
  456. moovio_sdk/models/operations/getbankaccountverification.py +73 -0
  457. moovio_sdk/models/operations/getbrand.py +64 -0
  458. moovio_sdk/models/operations/getcancellation.py +84 -0
  459. moovio_sdk/models/operations/getcapability.py +82 -0
  460. moovio_sdk/models/operations/getcard.py +71 -0
  461. moovio_sdk/models/operations/getdispute.py +71 -0
  462. moovio_sdk/models/operations/getdisputeevidence.py +80 -0
  463. moovio_sdk/models/operations/getdisputeevidencedata.py +90 -0
  464. moovio_sdk/models/operations/getenrichmentaddress.py +178 -0
  465. moovio_sdk/models/operations/getenrichmentprofile.py +64 -0
  466. moovio_sdk/models/operations/getfiledetails.py +71 -0
  467. moovio_sdk/models/operations/getfullissuedcard.py +73 -0
  468. moovio_sdk/models/operations/getissuedcard.py +73 -0
  469. moovio_sdk/models/operations/getissuedcardauthorization.py +75 -0
  470. moovio_sdk/models/operations/getissuedcardtransaction.py +75 -0
  471. moovio_sdk/models/operations/getmerchantprocessingagreement.py +64 -0
  472. moovio_sdk/models/operations/getonboardinginvite.py +62 -0
  473. moovio_sdk/models/operations/getpaymentlink.py +71 -0
  474. moovio_sdk/models/operations/getpaymentlinkqrcode.py +84 -0
  475. moovio_sdk/models/operations/getpaymentmethod.py +71 -0
  476. moovio_sdk/models/operations/getrefund.py +84 -0
  477. moovio_sdk/models/operations/getrepresentative.py +75 -0
  478. moovio_sdk/models/operations/getscheduledoccurrence.py +92 -0
  479. moovio_sdk/models/operations/getschedules.py +71 -0
  480. moovio_sdk/models/operations/getsweep.py +78 -0
  481. moovio_sdk/models/operations/getsweepconfig.py +71 -0
  482. moovio_sdk/models/operations/getterminalapplication.py +66 -0
  483. moovio_sdk/models/operations/gettermsofservicetoken.py +75 -0
  484. moovio_sdk/models/operations/gettransfer.py +73 -0
  485. moovio_sdk/models/operations/getunderwriting.py +64 -0
  486. moovio_sdk/models/operations/getwallet.py +71 -0
  487. moovio_sdk/models/operations/getwallettransaction.py +80 -0
  488. moovio_sdk/models/operations/initiatebankaccountverification.py +89 -0
  489. moovio_sdk/models/operations/initiatemicrodeposits.py +67 -0
  490. moovio_sdk/models/operations/initiaterefund.py +131 -0
  491. moovio_sdk/models/operations/linkapplepaytoken.py +80 -0
  492. moovio_sdk/models/operations/linkbankaccount.py +96 -0
  493. moovio_sdk/models/operations/linkcard.py +96 -0
  494. moovio_sdk/models/operations/listaccounts.py +171 -0
  495. moovio_sdk/models/operations/listadjustments.py +78 -0
  496. moovio_sdk/models/operations/listbankaccounts.py +64 -0
  497. moovio_sdk/models/operations/listcapabilities.py +64 -0
  498. moovio_sdk/models/operations/listcards.py +64 -0
  499. moovio_sdk/models/operations/listdisputeevidence.py +73 -0
  500. moovio_sdk/models/operations/listdisputes.py +172 -0
  501. moovio_sdk/models/operations/listfeeplanagreements.py +101 -0
  502. moovio_sdk/models/operations/listfeeplans.py +78 -0
  503. moovio_sdk/models/operations/listfeesfetch.py +80 -0
  504. moovio_sdk/models/operations/listfiles.py +64 -0
  505. moovio_sdk/models/operations/listindustries.py +62 -0
  506. moovio_sdk/models/operations/listinstitutions.py +92 -0
  507. moovio_sdk/models/operations/listissuedcardauthorizationevents.py +94 -0
  508. moovio_sdk/models/operations/listissuedcardauthorizations.py +126 -0
  509. moovio_sdk/models/operations/listissuedcards.py +94 -0
  510. moovio_sdk/models/operations/listissuedcardtransactions.py +113 -0
  511. moovio_sdk/models/operations/listonboardinginvites.py +60 -0
  512. moovio_sdk/models/operations/listpartnerpricing.py +78 -0
  513. moovio_sdk/models/operations/listpartnerpricingagreements.py +101 -0
  514. moovio_sdk/models/operations/listpaymentlinks.py +64 -0
  515. moovio_sdk/models/operations/listpaymentmethods.py +98 -0
  516. moovio_sdk/models/operations/listreceipts.py +65 -0
  517. moovio_sdk/models/operations/listrefunds.py +75 -0
  518. moovio_sdk/models/operations/listrepresentatives.py +66 -0
  519. moovio_sdk/models/operations/listschedules.py +81 -0
  520. moovio_sdk/models/operations/listsweepconfigs.py +64 -0
  521. moovio_sdk/models/operations/listsweeps.py +108 -0
  522. moovio_sdk/models/operations/listterminalapplications.py +62 -0
  523. moovio_sdk/models/operations/listtransfers.py +145 -0
  524. moovio_sdk/models/operations/listwallets.py +64 -0
  525. moovio_sdk/models/operations/listwallettransactions.py +189 -0
  526. moovio_sdk/models/operations/ping.py +56 -0
  527. moovio_sdk/models/operations/registerapplepaymerchantdomains.py +80 -0
  528. moovio_sdk/models/operations/requestcapabilities.py +78 -0
  529. moovio_sdk/models/operations/requestcard.py +80 -0
  530. moovio_sdk/models/operations/retrievefees.py +117 -0
  531. moovio_sdk/models/operations/revokeaccesstoken.py +48 -0
  532. moovio_sdk/models/operations/revokeonboardinginvite.py +58 -0
  533. moovio_sdk/models/operations/submitdisputeevidence.py +71 -0
  534. moovio_sdk/models/operations/testendtoendtoken.py +56 -0
  535. moovio_sdk/models/operations/updateaccount.py +78 -0
  536. moovio_sdk/models/operations/updateapplepaymerchantdomains.py +78 -0
  537. moovio_sdk/models/operations/updatebrand.py +78 -0
  538. moovio_sdk/models/operations/updatecard.py +85 -0
  539. moovio_sdk/models/operations/updatedisputeevidence.py +92 -0
  540. moovio_sdk/models/operations/updateissuedcard.py +81 -0
  541. moovio_sdk/models/operations/updatepaymentlink.py +85 -0
  542. moovio_sdk/models/operations/updaterepresentative.py +89 -0
  543. moovio_sdk/models/operations/updateschedule.py +85 -0
  544. moovio_sdk/models/operations/updatesweepconfig.py +85 -0
  545. moovio_sdk/models/operations/updatetransfer.py +87 -0
  546. moovio_sdk/models/operations/uploaddisputeevidencefile.py +87 -0
  547. moovio_sdk/models/operations/uploaddisputeevidencetext.py +85 -0
  548. moovio_sdk/models/operations/uploadfile.py +80 -0
  549. moovio_sdk/models/operations/upsertbrand.py +75 -0
  550. moovio_sdk/models/operations/upsertunderwriting.py +78 -0
  551. moovio_sdk/onboarding.py +965 -0
  552. moovio_sdk/payment_links.py +1694 -0
  553. moovio_sdk/payment_methods.py +475 -0
  554. moovio_sdk/ping.py +233 -0
  555. moovio_sdk/py.typed +1 -0
  556. moovio_sdk/receipts.py +507 -0
  557. moovio_sdk/representatives.py +1513 -0
  558. moovio_sdk/scheduling.py +1565 -0
  559. moovio_sdk/sdk.py +242 -0
  560. moovio_sdk/sdkconfiguration.py +59 -0
  561. moovio_sdk/sweeps.py +1617 -0
  562. moovio_sdk/terminal_applications.py +1013 -0
  563. moovio_sdk/transfers.py +3040 -0
  564. moovio_sdk/types/__init__.py +21 -0
  565. moovio_sdk/types/basemodel.py +39 -0
  566. moovio_sdk/underwriting.py +581 -0
  567. moovio_sdk/utils/__init__.py +101 -0
  568. moovio_sdk/utils/annotations.py +55 -0
  569. moovio_sdk/utils/enums.py +34 -0
  570. moovio_sdk/utils/eventstreaming.py +238 -0
  571. moovio_sdk/utils/forms.py +202 -0
  572. moovio_sdk/utils/headers.py +136 -0
  573. moovio_sdk/utils/logger.py +27 -0
  574. moovio_sdk/utils/metadata.py +118 -0
  575. moovio_sdk/utils/queryparams.py +205 -0
  576. moovio_sdk/utils/requestbodies.py +66 -0
  577. moovio_sdk/utils/retries.py +217 -0
  578. moovio_sdk/utils/security.py +195 -0
  579. moovio_sdk/utils/serializers.py +215 -0
  580. moovio_sdk/utils/url.py +155 -0
  581. moovio_sdk/utils/values.py +137 -0
  582. moovio_sdk/wallet_transactions.py +558 -0
  583. moovio_sdk/wallets.py +465 -0
  584. moovio_sdk-0.3.8.dist-info/METADATA +1920 -0
  585. moovio_sdk-0.3.8.dist-info/RECORD +586 -0
  586. moovio_sdk-0.3.8.dist-info/WHEEL +4 -0
moovio_sdk/accounts.py ADDED
@@ -0,0 +1,2461 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from moovio_sdk import utils
5
+ from moovio_sdk._hooks import HookContext
6
+ from moovio_sdk.models import components, errors, operations
7
+ from moovio_sdk.types import OptionalNullable, UNSET
8
+ from moovio_sdk.utils import get_security_from_env
9
+ from typing import Any, Dict, List, Mapping, Optional, Union
10
+
11
+
12
+ class Accounts(BaseSDK):
13
+ def create(
14
+ self,
15
+ *,
16
+ account_type: components.AccountType,
17
+ profile: Union[components.CreateProfile, components.CreateProfileTypedDict],
18
+ metadata: Optional[Dict[str, str]] = None,
19
+ terms_of_service: Optional[
20
+ Union[
21
+ components.CreateAccountTermsOfService,
22
+ components.CreateAccountTermsOfServiceTypedDict,
23
+ ]
24
+ ] = None,
25
+ foreign_id: Optional[str] = None,
26
+ customer_support: Optional[
27
+ Union[components.CustomerSupport, components.CustomerSupportTypedDict]
28
+ ] = None,
29
+ settings: Optional[
30
+ Union[components.Settings, components.SettingsTypedDict]
31
+ ] = None,
32
+ capabilities: Optional[List[components.CapabilityID]] = None,
33
+ mode: Optional[components.Mode] = None,
34
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
35
+ server_url: Optional[str] = None,
36
+ timeout_ms: Optional[int] = None,
37
+ http_headers: Optional[Mapping[str, str]] = None,
38
+ ) -> operations.CreateAccountResponse:
39
+ r"""You can create **business** or **individual** accounts for your users (i.e., customers, merchants) by passing the required
40
+ information to Moov. Requirements differ per account type and requested [capabilities](https://docs.moov.io/guides/accounts/capabilities/requirements/).
41
+
42
+ If you're requesting the `wallet`, `send-funds`, `collect-funds`, or `card-issuing` capabilities, you'll need to:
43
+ + Send Moov the user [platform terms of service agreement](https://docs.moov.io/guides/accounts/requirements/platform-agreement/) acceptance.
44
+ This can be done upon account creation, or by [patching](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account using the `termsOfService` field.
45
+ If you're creating a business account with the business type `llc`, `partnership`, or `privateCorporation`, you'll need to:
46
+ + Provide [business representatives](https://docs.moov.io/api/moov-accounts/representatives/) after creating the account.
47
+ + [Patch](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account to indicate that business representative ownership information is complete.
48
+
49
+ Visit our documentation to read more about [creating accounts](https://docs.moov.io/guides/accounts/create-accounts/) and [verification requirements](https://docs.moov.io/guides/accounts/requirements/identity-verification/).
50
+ Note that the `mode` field (for production or sandbox) is only required when creating a _facilitator_ account. All non-facilitator account requests will ignore the mode field and be set to the calling facilitator's mode.
51
+
52
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
53
+ to specify the `/accounts.write` scope.
54
+
55
+ :param account_type: The type of entity represented by this account.
56
+ :param profile:
57
+ :param metadata: Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
58
+ :param terms_of_service:
59
+ :param foreign_id: Optional alias from a foreign/external system which can be used to reference this resource.
60
+ :param customer_support: User-provided information that can be displayed on credit card transactions for customers to use when contacting a customer support team. This data is only allowed on a business account.
61
+ :param settings: User provided settings to manage an account.
62
+ :param capabilities:
63
+ :param mode: The operating mode for an account.
64
+ :param retries: Override the default retry configuration for this method
65
+ :param server_url: Override the default server URL for this method
66
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
67
+ :param http_headers: Additional headers to set or replace on requests.
68
+ """
69
+ base_url = None
70
+ url_variables = None
71
+ if timeout_ms is None:
72
+ timeout_ms = self.sdk_configuration.timeout_ms
73
+
74
+ if server_url is not None:
75
+ base_url = server_url
76
+ else:
77
+ base_url = self._get_url(base_url, url_variables)
78
+
79
+ request = components.CreateAccount(
80
+ account_type=account_type,
81
+ profile=utils.get_pydantic_model(profile, components.CreateProfile),
82
+ metadata=metadata,
83
+ terms_of_service=utils.get_pydantic_model(
84
+ terms_of_service, Optional[components.CreateAccountTermsOfService]
85
+ ),
86
+ foreign_id=foreign_id,
87
+ customer_support=utils.get_pydantic_model(
88
+ customer_support, Optional[components.CustomerSupport]
89
+ ),
90
+ settings=utils.get_pydantic_model(settings, Optional[components.Settings]),
91
+ capabilities=capabilities,
92
+ mode=mode,
93
+ )
94
+
95
+ req = self._build_request(
96
+ method="POST",
97
+ path="/accounts",
98
+ base_url=base_url,
99
+ url_variables=url_variables,
100
+ request=request,
101
+ request_body_required=True,
102
+ request_has_path_params=False,
103
+ request_has_query_params=True,
104
+ user_agent_header="user-agent",
105
+ accept_header_value="application/json",
106
+ http_headers=http_headers,
107
+ _globals=operations.CreateAccountGlobals(
108
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
109
+ ),
110
+ security=self.sdk_configuration.security,
111
+ get_serialized_body=lambda: utils.serialize_request_body(
112
+ request, False, False, "json", components.CreateAccount
113
+ ),
114
+ timeout_ms=timeout_ms,
115
+ )
116
+
117
+ if retries == UNSET:
118
+ if self.sdk_configuration.retry_config is not UNSET:
119
+ retries = self.sdk_configuration.retry_config
120
+
121
+ retry_config = None
122
+ if isinstance(retries, utils.RetryConfig):
123
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
124
+
125
+ http_res = self.do_request(
126
+ hook_ctx=HookContext(
127
+ base_url=base_url or "",
128
+ operation_id="createAccount",
129
+ oauth2_scopes=[],
130
+ security_source=get_security_from_env(
131
+ self.sdk_configuration.security, components.Security
132
+ ),
133
+ ),
134
+ request=req,
135
+ error_status_codes=[
136
+ "400",
137
+ "401",
138
+ "403",
139
+ "404",
140
+ "409",
141
+ "422",
142
+ "429",
143
+ "4XX",
144
+ "500",
145
+ "504",
146
+ "5XX",
147
+ ],
148
+ retry_config=retry_config,
149
+ )
150
+
151
+ response_data: Any = None
152
+ if utils.match_response(http_res, "200", "application/json"):
153
+ return operations.CreateAccountResponse(
154
+ result=utils.unmarshal_json(http_res.text, components.Account),
155
+ headers=utils.get_response_headers(http_res.headers),
156
+ )
157
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
158
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
159
+ raise errors.GenericError(data=response_data)
160
+ if utils.match_response(http_res, "422", "application/json"):
161
+ response_data = utils.unmarshal_json(
162
+ http_res.text, errors.CreateAccountResponseBodyData
163
+ )
164
+ raise errors.CreateAccountResponseBody(data=response_data)
165
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
166
+ http_res_text = utils.stream_to_text(http_res)
167
+ raise errors.APIError(
168
+ "API error occurred", http_res.status_code, http_res_text, http_res
169
+ )
170
+ if utils.match_response(http_res, ["500", "504"], "*"):
171
+ http_res_text = utils.stream_to_text(http_res)
172
+ raise errors.APIError(
173
+ "API error occurred", http_res.status_code, http_res_text, http_res
174
+ )
175
+ if utils.match_response(http_res, "4XX", "*"):
176
+ http_res_text = utils.stream_to_text(http_res)
177
+ raise errors.APIError(
178
+ "API error occurred", http_res.status_code, http_res_text, http_res
179
+ )
180
+ if utils.match_response(http_res, "5XX", "*"):
181
+ http_res_text = utils.stream_to_text(http_res)
182
+ raise errors.APIError(
183
+ "API error occurred", http_res.status_code, http_res_text, http_res
184
+ )
185
+
186
+ content_type = http_res.headers.get("Content-Type")
187
+ http_res_text = utils.stream_to_text(http_res)
188
+ raise errors.APIError(
189
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
190
+ http_res.status_code,
191
+ http_res_text,
192
+ http_res,
193
+ )
194
+
195
+ async def create_async(
196
+ self,
197
+ *,
198
+ account_type: components.AccountType,
199
+ profile: Union[components.CreateProfile, components.CreateProfileTypedDict],
200
+ metadata: Optional[Dict[str, str]] = None,
201
+ terms_of_service: Optional[
202
+ Union[
203
+ components.CreateAccountTermsOfService,
204
+ components.CreateAccountTermsOfServiceTypedDict,
205
+ ]
206
+ ] = None,
207
+ foreign_id: Optional[str] = None,
208
+ customer_support: Optional[
209
+ Union[components.CustomerSupport, components.CustomerSupportTypedDict]
210
+ ] = None,
211
+ settings: Optional[
212
+ Union[components.Settings, components.SettingsTypedDict]
213
+ ] = None,
214
+ capabilities: Optional[List[components.CapabilityID]] = None,
215
+ mode: Optional[components.Mode] = None,
216
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
217
+ server_url: Optional[str] = None,
218
+ timeout_ms: Optional[int] = None,
219
+ http_headers: Optional[Mapping[str, str]] = None,
220
+ ) -> operations.CreateAccountResponse:
221
+ r"""You can create **business** or **individual** accounts for your users (i.e., customers, merchants) by passing the required
222
+ information to Moov. Requirements differ per account type and requested [capabilities](https://docs.moov.io/guides/accounts/capabilities/requirements/).
223
+
224
+ If you're requesting the `wallet`, `send-funds`, `collect-funds`, or `card-issuing` capabilities, you'll need to:
225
+ + Send Moov the user [platform terms of service agreement](https://docs.moov.io/guides/accounts/requirements/platform-agreement/) acceptance.
226
+ This can be done upon account creation, or by [patching](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account using the `termsOfService` field.
227
+ If you're creating a business account with the business type `llc`, `partnership`, or `privateCorporation`, you'll need to:
228
+ + Provide [business representatives](https://docs.moov.io/api/moov-accounts/representatives/) after creating the account.
229
+ + [Patch](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account to indicate that business representative ownership information is complete.
230
+
231
+ Visit our documentation to read more about [creating accounts](https://docs.moov.io/guides/accounts/create-accounts/) and [verification requirements](https://docs.moov.io/guides/accounts/requirements/identity-verification/).
232
+ Note that the `mode` field (for production or sandbox) is only required when creating a _facilitator_ account. All non-facilitator account requests will ignore the mode field and be set to the calling facilitator's mode.
233
+
234
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
235
+ to specify the `/accounts.write` scope.
236
+
237
+ :param account_type: The type of entity represented by this account.
238
+ :param profile:
239
+ :param metadata: Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
240
+ :param terms_of_service:
241
+ :param foreign_id: Optional alias from a foreign/external system which can be used to reference this resource.
242
+ :param customer_support: User-provided information that can be displayed on credit card transactions for customers to use when contacting a customer support team. This data is only allowed on a business account.
243
+ :param settings: User provided settings to manage an account.
244
+ :param capabilities:
245
+ :param mode: The operating mode for an account.
246
+ :param retries: Override the default retry configuration for this method
247
+ :param server_url: Override the default server URL for this method
248
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
249
+ :param http_headers: Additional headers to set or replace on requests.
250
+ """
251
+ base_url = None
252
+ url_variables = None
253
+ if timeout_ms is None:
254
+ timeout_ms = self.sdk_configuration.timeout_ms
255
+
256
+ if server_url is not None:
257
+ base_url = server_url
258
+ else:
259
+ base_url = self._get_url(base_url, url_variables)
260
+
261
+ request = components.CreateAccount(
262
+ account_type=account_type,
263
+ profile=utils.get_pydantic_model(profile, components.CreateProfile),
264
+ metadata=metadata,
265
+ terms_of_service=utils.get_pydantic_model(
266
+ terms_of_service, Optional[components.CreateAccountTermsOfService]
267
+ ),
268
+ foreign_id=foreign_id,
269
+ customer_support=utils.get_pydantic_model(
270
+ customer_support, Optional[components.CustomerSupport]
271
+ ),
272
+ settings=utils.get_pydantic_model(settings, Optional[components.Settings]),
273
+ capabilities=capabilities,
274
+ mode=mode,
275
+ )
276
+
277
+ req = self._build_request_async(
278
+ method="POST",
279
+ path="/accounts",
280
+ base_url=base_url,
281
+ url_variables=url_variables,
282
+ request=request,
283
+ request_body_required=True,
284
+ request_has_path_params=False,
285
+ request_has_query_params=True,
286
+ user_agent_header="user-agent",
287
+ accept_header_value="application/json",
288
+ http_headers=http_headers,
289
+ _globals=operations.CreateAccountGlobals(
290
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
291
+ ),
292
+ security=self.sdk_configuration.security,
293
+ get_serialized_body=lambda: utils.serialize_request_body(
294
+ request, False, False, "json", components.CreateAccount
295
+ ),
296
+ timeout_ms=timeout_ms,
297
+ )
298
+
299
+ if retries == UNSET:
300
+ if self.sdk_configuration.retry_config is not UNSET:
301
+ retries = self.sdk_configuration.retry_config
302
+
303
+ retry_config = None
304
+ if isinstance(retries, utils.RetryConfig):
305
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
306
+
307
+ http_res = await self.do_request_async(
308
+ hook_ctx=HookContext(
309
+ base_url=base_url or "",
310
+ operation_id="createAccount",
311
+ oauth2_scopes=[],
312
+ security_source=get_security_from_env(
313
+ self.sdk_configuration.security, components.Security
314
+ ),
315
+ ),
316
+ request=req,
317
+ error_status_codes=[
318
+ "400",
319
+ "401",
320
+ "403",
321
+ "404",
322
+ "409",
323
+ "422",
324
+ "429",
325
+ "4XX",
326
+ "500",
327
+ "504",
328
+ "5XX",
329
+ ],
330
+ retry_config=retry_config,
331
+ )
332
+
333
+ response_data: Any = None
334
+ if utils.match_response(http_res, "200", "application/json"):
335
+ return operations.CreateAccountResponse(
336
+ result=utils.unmarshal_json(http_res.text, components.Account),
337
+ headers=utils.get_response_headers(http_res.headers),
338
+ )
339
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
340
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
341
+ raise errors.GenericError(data=response_data)
342
+ if utils.match_response(http_res, "422", "application/json"):
343
+ response_data = utils.unmarshal_json(
344
+ http_res.text, errors.CreateAccountResponseBodyData
345
+ )
346
+ raise errors.CreateAccountResponseBody(data=response_data)
347
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
348
+ http_res_text = await utils.stream_to_text_async(http_res)
349
+ raise errors.APIError(
350
+ "API error occurred", http_res.status_code, http_res_text, http_res
351
+ )
352
+ if utils.match_response(http_res, ["500", "504"], "*"):
353
+ http_res_text = await utils.stream_to_text_async(http_res)
354
+ raise errors.APIError(
355
+ "API error occurred", http_res.status_code, http_res_text, http_res
356
+ )
357
+ if utils.match_response(http_res, "4XX", "*"):
358
+ http_res_text = await utils.stream_to_text_async(http_res)
359
+ raise errors.APIError(
360
+ "API error occurred", http_res.status_code, http_res_text, http_res
361
+ )
362
+ if utils.match_response(http_res, "5XX", "*"):
363
+ http_res_text = await utils.stream_to_text_async(http_res)
364
+ raise errors.APIError(
365
+ "API error occurred", http_res.status_code, http_res_text, http_res
366
+ )
367
+
368
+ content_type = http_res.headers.get("Content-Type")
369
+ http_res_text = await utils.stream_to_text_async(http_res)
370
+ raise errors.APIError(
371
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
372
+ http_res.status_code,
373
+ http_res_text,
374
+ http_res,
375
+ )
376
+
377
+ def list(
378
+ self,
379
+ *,
380
+ name: Optional[str] = None,
381
+ email: Optional[str] = None,
382
+ type_: Optional[components.AccountType] = None,
383
+ foreign_id: Optional[str] = None,
384
+ include_disconnected: Optional[bool] = None,
385
+ capability: Optional[components.CapabilityID] = None,
386
+ capability_status: Optional[components.CapabilityStatus] = None,
387
+ skip: Optional[int] = None,
388
+ count: Optional[int] = None,
389
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
390
+ server_url: Optional[str] = None,
391
+ timeout_ms: Optional[int] = None,
392
+ http_headers: Optional[Mapping[str, str]] = None,
393
+ ) -> operations.ListAccountsResponse:
394
+ r"""List or search accounts to which the caller is connected.
395
+
396
+ All supported query parameters are optional. If none are provided the response will include all connected accounts.
397
+ Pagination is supported via the `skip` and `count` query parameters. Searching by name and email will overlap and
398
+ return results based on relevance.
399
+
400
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
401
+ to specify the `/accounts.read` scope.
402
+
403
+ :param name: Filter connected accounts by name. If provided, this query will attempt to find matches against the following Account and Profile fields: <ul> <li>Account `displayName`</li> <li>Individual Profile `firstName`, `middleName`, and `lastName`</li> <li>Business Profile `legalBusinessName`</li> </ul>
404
+ :param email: Filter connected accounts by email address. Provide the full email address to filter by email.
405
+ :param type: Filter connected accounts by AccountType. If the `type` parameter is used in combination with `name`, only the corresponding type's name fields will be searched. For example, if `type=business` and `name=moov`, the search will attempt to find matches against the display name and Business Profile name fields (`legalBusinessName`, and `doingBusinessAs`).
406
+ :param foreign_id: Serves as an optional alias from a foreign/external system which can be used to reference this resource.
407
+ :param include_disconnected: Filter disconnected accounts. If true, the response will include disconnected accounts.
408
+ :param capability: Filter connected accounts by the capability.
409
+ :param capability_status: Filter connected accounts by the capability.
410
+ :param skip:
411
+ :param count:
412
+ :param retries: Override the default retry configuration for this method
413
+ :param server_url: Override the default server URL for this method
414
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
415
+ :param http_headers: Additional headers to set or replace on requests.
416
+ """
417
+ base_url = None
418
+ url_variables = None
419
+ if timeout_ms is None:
420
+ timeout_ms = self.sdk_configuration.timeout_ms
421
+
422
+ if server_url is not None:
423
+ base_url = server_url
424
+ else:
425
+ base_url = self._get_url(base_url, url_variables)
426
+
427
+ request = operations.ListAccountsRequest(
428
+ name=name,
429
+ email=email,
430
+ type=type_,
431
+ foreign_id=foreign_id,
432
+ include_disconnected=include_disconnected,
433
+ capability=capability,
434
+ capability_status=capability_status,
435
+ skip=skip,
436
+ count=count,
437
+ )
438
+
439
+ req = self._build_request(
440
+ method="GET",
441
+ path="/accounts",
442
+ base_url=base_url,
443
+ url_variables=url_variables,
444
+ request=request,
445
+ request_body_required=False,
446
+ request_has_path_params=False,
447
+ request_has_query_params=True,
448
+ user_agent_header="user-agent",
449
+ accept_header_value="application/json",
450
+ http_headers=http_headers,
451
+ _globals=operations.ListAccountsGlobals(
452
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
453
+ ),
454
+ security=self.sdk_configuration.security,
455
+ timeout_ms=timeout_ms,
456
+ )
457
+
458
+ if retries == UNSET:
459
+ if self.sdk_configuration.retry_config is not UNSET:
460
+ retries = self.sdk_configuration.retry_config
461
+
462
+ retry_config = None
463
+ if isinstance(retries, utils.RetryConfig):
464
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
465
+
466
+ http_res = self.do_request(
467
+ hook_ctx=HookContext(
468
+ base_url=base_url or "",
469
+ operation_id="listAccounts",
470
+ oauth2_scopes=[],
471
+ security_source=get_security_from_env(
472
+ self.sdk_configuration.security, components.Security
473
+ ),
474
+ ),
475
+ request=req,
476
+ error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
477
+ retry_config=retry_config,
478
+ )
479
+
480
+ if utils.match_response(http_res, "200", "application/json"):
481
+ return operations.ListAccountsResponse(
482
+ result=utils.unmarshal_json(http_res.text, List[components.Account]),
483
+ headers=utils.get_response_headers(http_res.headers),
484
+ )
485
+ if utils.match_response(http_res, ["401", "403", "429"], "*"):
486
+ http_res_text = utils.stream_to_text(http_res)
487
+ raise errors.APIError(
488
+ "API error occurred", http_res.status_code, http_res_text, http_res
489
+ )
490
+ if utils.match_response(http_res, ["500", "504"], "*"):
491
+ http_res_text = utils.stream_to_text(http_res)
492
+ raise errors.APIError(
493
+ "API error occurred", http_res.status_code, http_res_text, http_res
494
+ )
495
+ if utils.match_response(http_res, "4XX", "*"):
496
+ http_res_text = utils.stream_to_text(http_res)
497
+ raise errors.APIError(
498
+ "API error occurred", http_res.status_code, http_res_text, http_res
499
+ )
500
+ if utils.match_response(http_res, "5XX", "*"):
501
+ http_res_text = utils.stream_to_text(http_res)
502
+ raise errors.APIError(
503
+ "API error occurred", http_res.status_code, http_res_text, http_res
504
+ )
505
+
506
+ content_type = http_res.headers.get("Content-Type")
507
+ http_res_text = utils.stream_to_text(http_res)
508
+ raise errors.APIError(
509
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
510
+ http_res.status_code,
511
+ http_res_text,
512
+ http_res,
513
+ )
514
+
515
+ async def list_async(
516
+ self,
517
+ *,
518
+ name: Optional[str] = None,
519
+ email: Optional[str] = None,
520
+ type_: Optional[components.AccountType] = None,
521
+ foreign_id: Optional[str] = None,
522
+ include_disconnected: Optional[bool] = None,
523
+ capability: Optional[components.CapabilityID] = None,
524
+ capability_status: Optional[components.CapabilityStatus] = None,
525
+ skip: Optional[int] = None,
526
+ count: Optional[int] = None,
527
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
528
+ server_url: Optional[str] = None,
529
+ timeout_ms: Optional[int] = None,
530
+ http_headers: Optional[Mapping[str, str]] = None,
531
+ ) -> operations.ListAccountsResponse:
532
+ r"""List or search accounts to which the caller is connected.
533
+
534
+ All supported query parameters are optional. If none are provided the response will include all connected accounts.
535
+ Pagination is supported via the `skip` and `count` query parameters. Searching by name and email will overlap and
536
+ return results based on relevance.
537
+
538
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
539
+ to specify the `/accounts.read` scope.
540
+
541
+ :param name: Filter connected accounts by name. If provided, this query will attempt to find matches against the following Account and Profile fields: <ul> <li>Account `displayName`</li> <li>Individual Profile `firstName`, `middleName`, and `lastName`</li> <li>Business Profile `legalBusinessName`</li> </ul>
542
+ :param email: Filter connected accounts by email address. Provide the full email address to filter by email.
543
+ :param type: Filter connected accounts by AccountType. If the `type` parameter is used in combination with `name`, only the corresponding type's name fields will be searched. For example, if `type=business` and `name=moov`, the search will attempt to find matches against the display name and Business Profile name fields (`legalBusinessName`, and `doingBusinessAs`).
544
+ :param foreign_id: Serves as an optional alias from a foreign/external system which can be used to reference this resource.
545
+ :param include_disconnected: Filter disconnected accounts. If true, the response will include disconnected accounts.
546
+ :param capability: Filter connected accounts by the capability.
547
+ :param capability_status: Filter connected accounts by the capability.
548
+ :param skip:
549
+ :param count:
550
+ :param retries: Override the default retry configuration for this method
551
+ :param server_url: Override the default server URL for this method
552
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
553
+ :param http_headers: Additional headers to set or replace on requests.
554
+ """
555
+ base_url = None
556
+ url_variables = None
557
+ if timeout_ms is None:
558
+ timeout_ms = self.sdk_configuration.timeout_ms
559
+
560
+ if server_url is not None:
561
+ base_url = server_url
562
+ else:
563
+ base_url = self._get_url(base_url, url_variables)
564
+
565
+ request = operations.ListAccountsRequest(
566
+ name=name,
567
+ email=email,
568
+ type=type_,
569
+ foreign_id=foreign_id,
570
+ include_disconnected=include_disconnected,
571
+ capability=capability,
572
+ capability_status=capability_status,
573
+ skip=skip,
574
+ count=count,
575
+ )
576
+
577
+ req = self._build_request_async(
578
+ method="GET",
579
+ path="/accounts",
580
+ base_url=base_url,
581
+ url_variables=url_variables,
582
+ request=request,
583
+ request_body_required=False,
584
+ request_has_path_params=False,
585
+ request_has_query_params=True,
586
+ user_agent_header="user-agent",
587
+ accept_header_value="application/json",
588
+ http_headers=http_headers,
589
+ _globals=operations.ListAccountsGlobals(
590
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
591
+ ),
592
+ security=self.sdk_configuration.security,
593
+ timeout_ms=timeout_ms,
594
+ )
595
+
596
+ if retries == UNSET:
597
+ if self.sdk_configuration.retry_config is not UNSET:
598
+ retries = self.sdk_configuration.retry_config
599
+
600
+ retry_config = None
601
+ if isinstance(retries, utils.RetryConfig):
602
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
603
+
604
+ http_res = await self.do_request_async(
605
+ hook_ctx=HookContext(
606
+ base_url=base_url or "",
607
+ operation_id="listAccounts",
608
+ oauth2_scopes=[],
609
+ security_source=get_security_from_env(
610
+ self.sdk_configuration.security, components.Security
611
+ ),
612
+ ),
613
+ request=req,
614
+ error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
615
+ retry_config=retry_config,
616
+ )
617
+
618
+ if utils.match_response(http_res, "200", "application/json"):
619
+ return operations.ListAccountsResponse(
620
+ result=utils.unmarshal_json(http_res.text, List[components.Account]),
621
+ headers=utils.get_response_headers(http_res.headers),
622
+ )
623
+ if utils.match_response(http_res, ["401", "403", "429"], "*"):
624
+ http_res_text = await utils.stream_to_text_async(http_res)
625
+ raise errors.APIError(
626
+ "API error occurred", http_res.status_code, http_res_text, http_res
627
+ )
628
+ if utils.match_response(http_res, ["500", "504"], "*"):
629
+ http_res_text = await utils.stream_to_text_async(http_res)
630
+ raise errors.APIError(
631
+ "API error occurred", http_res.status_code, http_res_text, http_res
632
+ )
633
+ if utils.match_response(http_res, "4XX", "*"):
634
+ http_res_text = await utils.stream_to_text_async(http_res)
635
+ raise errors.APIError(
636
+ "API error occurred", http_res.status_code, http_res_text, http_res
637
+ )
638
+ if utils.match_response(http_res, "5XX", "*"):
639
+ http_res_text = await utils.stream_to_text_async(http_res)
640
+ raise errors.APIError(
641
+ "API error occurred", http_res.status_code, http_res_text, http_res
642
+ )
643
+
644
+ content_type = http_res.headers.get("Content-Type")
645
+ http_res_text = await utils.stream_to_text_async(http_res)
646
+ raise errors.APIError(
647
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
648
+ http_res.status_code,
649
+ http_res_text,
650
+ http_res,
651
+ )
652
+
653
+ def get(
654
+ self,
655
+ *,
656
+ account_id: str,
657
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
658
+ server_url: Optional[str] = None,
659
+ timeout_ms: Optional[int] = None,
660
+ http_headers: Optional[Mapping[str, str]] = None,
661
+ ) -> operations.GetAccountResponse:
662
+ r"""Retrieves details for the account with the specified ID.
663
+
664
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
665
+ to specify the `/accounts/{accountID}/profile.read` scope.
666
+
667
+ :param account_id:
668
+ :param retries: Override the default retry configuration for this method
669
+ :param server_url: Override the default server URL for this method
670
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
671
+ :param http_headers: Additional headers to set or replace on requests.
672
+ """
673
+ base_url = None
674
+ url_variables = None
675
+ if timeout_ms is None:
676
+ timeout_ms = self.sdk_configuration.timeout_ms
677
+
678
+ if server_url is not None:
679
+ base_url = server_url
680
+ else:
681
+ base_url = self._get_url(base_url, url_variables)
682
+
683
+ request = operations.GetAccountRequest(
684
+ account_id=account_id,
685
+ )
686
+
687
+ req = self._build_request(
688
+ method="GET",
689
+ path="/accounts/{accountID}",
690
+ base_url=base_url,
691
+ url_variables=url_variables,
692
+ request=request,
693
+ request_body_required=False,
694
+ request_has_path_params=True,
695
+ request_has_query_params=True,
696
+ user_agent_header="user-agent",
697
+ accept_header_value="application/json",
698
+ http_headers=http_headers,
699
+ _globals=operations.GetAccountGlobals(
700
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
701
+ ),
702
+ security=self.sdk_configuration.security,
703
+ timeout_ms=timeout_ms,
704
+ )
705
+
706
+ if retries == UNSET:
707
+ if self.sdk_configuration.retry_config is not UNSET:
708
+ retries = self.sdk_configuration.retry_config
709
+
710
+ retry_config = None
711
+ if isinstance(retries, utils.RetryConfig):
712
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
713
+
714
+ http_res = self.do_request(
715
+ hook_ctx=HookContext(
716
+ base_url=base_url or "",
717
+ operation_id="getAccount",
718
+ oauth2_scopes=[],
719
+ security_source=get_security_from_env(
720
+ self.sdk_configuration.security, components.Security
721
+ ),
722
+ ),
723
+ request=req,
724
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
725
+ retry_config=retry_config,
726
+ )
727
+
728
+ if utils.match_response(http_res, "200", "application/json"):
729
+ return operations.GetAccountResponse(
730
+ result=utils.unmarshal_json(http_res.text, components.Account),
731
+ headers=utils.get_response_headers(http_res.headers),
732
+ )
733
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
734
+ http_res_text = utils.stream_to_text(http_res)
735
+ raise errors.APIError(
736
+ "API error occurred", http_res.status_code, http_res_text, http_res
737
+ )
738
+ if utils.match_response(http_res, ["500", "504"], "*"):
739
+ http_res_text = utils.stream_to_text(http_res)
740
+ raise errors.APIError(
741
+ "API error occurred", http_res.status_code, http_res_text, http_res
742
+ )
743
+ if utils.match_response(http_res, "4XX", "*"):
744
+ http_res_text = utils.stream_to_text(http_res)
745
+ raise errors.APIError(
746
+ "API error occurred", http_res.status_code, http_res_text, http_res
747
+ )
748
+ if utils.match_response(http_res, "5XX", "*"):
749
+ http_res_text = utils.stream_to_text(http_res)
750
+ raise errors.APIError(
751
+ "API error occurred", http_res.status_code, http_res_text, http_res
752
+ )
753
+
754
+ content_type = http_res.headers.get("Content-Type")
755
+ http_res_text = utils.stream_to_text(http_res)
756
+ raise errors.APIError(
757
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
758
+ http_res.status_code,
759
+ http_res_text,
760
+ http_res,
761
+ )
762
+
763
+ async def get_async(
764
+ self,
765
+ *,
766
+ account_id: str,
767
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
768
+ server_url: Optional[str] = None,
769
+ timeout_ms: Optional[int] = None,
770
+ http_headers: Optional[Mapping[str, str]] = None,
771
+ ) -> operations.GetAccountResponse:
772
+ r"""Retrieves details for the account with the specified ID.
773
+
774
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
775
+ to specify the `/accounts/{accountID}/profile.read` scope.
776
+
777
+ :param account_id:
778
+ :param retries: Override the default retry configuration for this method
779
+ :param server_url: Override the default server URL for this method
780
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
781
+ :param http_headers: Additional headers to set or replace on requests.
782
+ """
783
+ base_url = None
784
+ url_variables = None
785
+ if timeout_ms is None:
786
+ timeout_ms = self.sdk_configuration.timeout_ms
787
+
788
+ if server_url is not None:
789
+ base_url = server_url
790
+ else:
791
+ base_url = self._get_url(base_url, url_variables)
792
+
793
+ request = operations.GetAccountRequest(
794
+ account_id=account_id,
795
+ )
796
+
797
+ req = self._build_request_async(
798
+ method="GET",
799
+ path="/accounts/{accountID}",
800
+ base_url=base_url,
801
+ url_variables=url_variables,
802
+ request=request,
803
+ request_body_required=False,
804
+ request_has_path_params=True,
805
+ request_has_query_params=True,
806
+ user_agent_header="user-agent",
807
+ accept_header_value="application/json",
808
+ http_headers=http_headers,
809
+ _globals=operations.GetAccountGlobals(
810
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
811
+ ),
812
+ security=self.sdk_configuration.security,
813
+ timeout_ms=timeout_ms,
814
+ )
815
+
816
+ if retries == UNSET:
817
+ if self.sdk_configuration.retry_config is not UNSET:
818
+ retries = self.sdk_configuration.retry_config
819
+
820
+ retry_config = None
821
+ if isinstance(retries, utils.RetryConfig):
822
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
823
+
824
+ http_res = await self.do_request_async(
825
+ hook_ctx=HookContext(
826
+ base_url=base_url or "",
827
+ operation_id="getAccount",
828
+ oauth2_scopes=[],
829
+ security_source=get_security_from_env(
830
+ self.sdk_configuration.security, components.Security
831
+ ),
832
+ ),
833
+ request=req,
834
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
835
+ retry_config=retry_config,
836
+ )
837
+
838
+ if utils.match_response(http_res, "200", "application/json"):
839
+ return operations.GetAccountResponse(
840
+ result=utils.unmarshal_json(http_res.text, components.Account),
841
+ headers=utils.get_response_headers(http_res.headers),
842
+ )
843
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
844
+ http_res_text = await utils.stream_to_text_async(http_res)
845
+ raise errors.APIError(
846
+ "API error occurred", http_res.status_code, http_res_text, http_res
847
+ )
848
+ if utils.match_response(http_res, ["500", "504"], "*"):
849
+ http_res_text = await utils.stream_to_text_async(http_res)
850
+ raise errors.APIError(
851
+ "API error occurred", http_res.status_code, http_res_text, http_res
852
+ )
853
+ if utils.match_response(http_res, "4XX", "*"):
854
+ http_res_text = await utils.stream_to_text_async(http_res)
855
+ raise errors.APIError(
856
+ "API error occurred", http_res.status_code, http_res_text, http_res
857
+ )
858
+ if utils.match_response(http_res, "5XX", "*"):
859
+ http_res_text = await utils.stream_to_text_async(http_res)
860
+ raise errors.APIError(
861
+ "API error occurred", http_res.status_code, http_res_text, http_res
862
+ )
863
+
864
+ content_type = http_res.headers.get("Content-Type")
865
+ http_res_text = await utils.stream_to_text_async(http_res)
866
+ raise errors.APIError(
867
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
868
+ http_res.status_code,
869
+ http_res_text,
870
+ http_res,
871
+ )
872
+
873
+ def update(
874
+ self,
875
+ *,
876
+ account_id: str,
877
+ profile: Optional[
878
+ Union[components.PatchProfile, components.PatchProfileTypedDict]
879
+ ] = None,
880
+ metadata: OptionalNullable[Dict[str, str]] = UNSET,
881
+ terms_of_service: Optional[
882
+ Union[
883
+ components.PatchAccountTermsOfService,
884
+ components.PatchAccountTermsOfServiceTypedDict,
885
+ ]
886
+ ] = None,
887
+ foreign_id: Optional[str] = None,
888
+ customer_support: OptionalNullable[
889
+ Union[
890
+ components.PatchAccountCustomerSupport,
891
+ components.PatchAccountCustomerSupportTypedDict,
892
+ ]
893
+ ] = UNSET,
894
+ settings: Optional[
895
+ Union[
896
+ components.CreateAccountSettings,
897
+ components.CreateAccountSettingsTypedDict,
898
+ ]
899
+ ] = None,
900
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
901
+ server_url: Optional[str] = None,
902
+ timeout_ms: Optional[int] = None,
903
+ http_headers: Optional[Mapping[str, str]] = None,
904
+ ) -> operations.UpdateAccountResponse:
905
+ r"""When **can** profile data be updated:
906
+ + For unverified accounts, all profile data can be edited.
907
+ + During the verification process, missing or incomplete profile data can be edited.
908
+ + Verified accounts can only add missing profile data.
909
+
910
+ When **can't** profile data be updated:
911
+ + Verified accounts cannot change any existing profile data.
912
+
913
+ If you need to update information in a locked state, please contact Moov support.
914
+
915
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
916
+ to specify the `/accounts/{accountID}/profile.write` scope.
917
+
918
+ :param account_id:
919
+ :param profile: Describes the fields available when patching a profile. Each object can be patched independent of patching the other fields.
920
+ :param metadata:
921
+ :param terms_of_service:
922
+ :param foreign_id:
923
+ :param customer_support:
924
+ :param settings:
925
+ :param retries: Override the default retry configuration for this method
926
+ :param server_url: Override the default server URL for this method
927
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
928
+ :param http_headers: Additional headers to set or replace on requests.
929
+ """
930
+ base_url = None
931
+ url_variables = None
932
+ if timeout_ms is None:
933
+ timeout_ms = self.sdk_configuration.timeout_ms
934
+
935
+ if server_url is not None:
936
+ base_url = server_url
937
+ else:
938
+ base_url = self._get_url(base_url, url_variables)
939
+
940
+ request = operations.UpdateAccountRequest(
941
+ account_id=account_id,
942
+ patch_account=components.PatchAccount(
943
+ profile=utils.get_pydantic_model(
944
+ profile, Optional[components.PatchProfile]
945
+ ),
946
+ metadata=metadata,
947
+ terms_of_service=utils.get_pydantic_model(
948
+ terms_of_service, Optional[components.PatchAccountTermsOfService]
949
+ ),
950
+ foreign_id=foreign_id,
951
+ customer_support=utils.get_pydantic_model(
952
+ customer_support,
953
+ OptionalNullable[components.PatchAccountCustomerSupport],
954
+ ),
955
+ settings=utils.get_pydantic_model(
956
+ settings, Optional[components.CreateAccountSettings]
957
+ ),
958
+ ),
959
+ )
960
+
961
+ req = self._build_request(
962
+ method="PATCH",
963
+ path="/accounts/{accountID}",
964
+ base_url=base_url,
965
+ url_variables=url_variables,
966
+ request=request,
967
+ request_body_required=True,
968
+ request_has_path_params=True,
969
+ request_has_query_params=True,
970
+ user_agent_header="user-agent",
971
+ accept_header_value="application/json",
972
+ http_headers=http_headers,
973
+ _globals=operations.UpdateAccountGlobals(
974
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
975
+ ),
976
+ security=self.sdk_configuration.security,
977
+ get_serialized_body=lambda: utils.serialize_request_body(
978
+ request.patch_account, False, False, "json", components.PatchAccount
979
+ ),
980
+ timeout_ms=timeout_ms,
981
+ )
982
+
983
+ if retries == UNSET:
984
+ if self.sdk_configuration.retry_config is not UNSET:
985
+ retries = self.sdk_configuration.retry_config
986
+
987
+ retry_config = None
988
+ if isinstance(retries, utils.RetryConfig):
989
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
990
+
991
+ http_res = self.do_request(
992
+ hook_ctx=HookContext(
993
+ base_url=base_url or "",
994
+ operation_id="updateAccount",
995
+ oauth2_scopes=[],
996
+ security_source=get_security_from_env(
997
+ self.sdk_configuration.security, components.Security
998
+ ),
999
+ ),
1000
+ request=req,
1001
+ error_status_codes=[
1002
+ "400",
1003
+ "401",
1004
+ "403",
1005
+ "404",
1006
+ "409",
1007
+ "422",
1008
+ "429",
1009
+ "4XX",
1010
+ "500",
1011
+ "504",
1012
+ "5XX",
1013
+ ],
1014
+ retry_config=retry_config,
1015
+ )
1016
+
1017
+ response_data: Any = None
1018
+ if utils.match_response(http_res, "200", "application/json"):
1019
+ return operations.UpdateAccountResponse(
1020
+ result=utils.unmarshal_json(http_res.text, components.Account),
1021
+ headers=utils.get_response_headers(http_res.headers),
1022
+ )
1023
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
1024
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1025
+ raise errors.GenericError(data=response_data)
1026
+ if utils.match_response(http_res, "422", "application/json"):
1027
+ response_data = utils.unmarshal_json(
1028
+ http_res.text, errors.UpdateAccountResponseBodyData
1029
+ )
1030
+ raise errors.UpdateAccountResponseBody(data=response_data)
1031
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1032
+ http_res_text = utils.stream_to_text(http_res)
1033
+ raise errors.APIError(
1034
+ "API error occurred", http_res.status_code, http_res_text, http_res
1035
+ )
1036
+ if utils.match_response(http_res, ["500", "504"], "*"):
1037
+ http_res_text = utils.stream_to_text(http_res)
1038
+ raise errors.APIError(
1039
+ "API error occurred", http_res.status_code, http_res_text, http_res
1040
+ )
1041
+ if utils.match_response(http_res, "4XX", "*"):
1042
+ http_res_text = utils.stream_to_text(http_res)
1043
+ raise errors.APIError(
1044
+ "API error occurred", http_res.status_code, http_res_text, http_res
1045
+ )
1046
+ if utils.match_response(http_res, "5XX", "*"):
1047
+ http_res_text = utils.stream_to_text(http_res)
1048
+ raise errors.APIError(
1049
+ "API error occurred", http_res.status_code, http_res_text, http_res
1050
+ )
1051
+
1052
+ content_type = http_res.headers.get("Content-Type")
1053
+ http_res_text = utils.stream_to_text(http_res)
1054
+ raise errors.APIError(
1055
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1056
+ http_res.status_code,
1057
+ http_res_text,
1058
+ http_res,
1059
+ )
1060
+
1061
+ async def update_async(
1062
+ self,
1063
+ *,
1064
+ account_id: str,
1065
+ profile: Optional[
1066
+ Union[components.PatchProfile, components.PatchProfileTypedDict]
1067
+ ] = None,
1068
+ metadata: OptionalNullable[Dict[str, str]] = UNSET,
1069
+ terms_of_service: Optional[
1070
+ Union[
1071
+ components.PatchAccountTermsOfService,
1072
+ components.PatchAccountTermsOfServiceTypedDict,
1073
+ ]
1074
+ ] = None,
1075
+ foreign_id: Optional[str] = None,
1076
+ customer_support: OptionalNullable[
1077
+ Union[
1078
+ components.PatchAccountCustomerSupport,
1079
+ components.PatchAccountCustomerSupportTypedDict,
1080
+ ]
1081
+ ] = UNSET,
1082
+ settings: Optional[
1083
+ Union[
1084
+ components.CreateAccountSettings,
1085
+ components.CreateAccountSettingsTypedDict,
1086
+ ]
1087
+ ] = None,
1088
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1089
+ server_url: Optional[str] = None,
1090
+ timeout_ms: Optional[int] = None,
1091
+ http_headers: Optional[Mapping[str, str]] = None,
1092
+ ) -> operations.UpdateAccountResponse:
1093
+ r"""When **can** profile data be updated:
1094
+ + For unverified accounts, all profile data can be edited.
1095
+ + During the verification process, missing or incomplete profile data can be edited.
1096
+ + Verified accounts can only add missing profile data.
1097
+
1098
+ When **can't** profile data be updated:
1099
+ + Verified accounts cannot change any existing profile data.
1100
+
1101
+ If you need to update information in a locked state, please contact Moov support.
1102
+
1103
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
1104
+ to specify the `/accounts/{accountID}/profile.write` scope.
1105
+
1106
+ :param account_id:
1107
+ :param profile: Describes the fields available when patching a profile. Each object can be patched independent of patching the other fields.
1108
+ :param metadata:
1109
+ :param terms_of_service:
1110
+ :param foreign_id:
1111
+ :param customer_support:
1112
+ :param settings:
1113
+ :param retries: Override the default retry configuration for this method
1114
+ :param server_url: Override the default server URL for this method
1115
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1116
+ :param http_headers: Additional headers to set or replace on requests.
1117
+ """
1118
+ base_url = None
1119
+ url_variables = None
1120
+ if timeout_ms is None:
1121
+ timeout_ms = self.sdk_configuration.timeout_ms
1122
+
1123
+ if server_url is not None:
1124
+ base_url = server_url
1125
+ else:
1126
+ base_url = self._get_url(base_url, url_variables)
1127
+
1128
+ request = operations.UpdateAccountRequest(
1129
+ account_id=account_id,
1130
+ patch_account=components.PatchAccount(
1131
+ profile=utils.get_pydantic_model(
1132
+ profile, Optional[components.PatchProfile]
1133
+ ),
1134
+ metadata=metadata,
1135
+ terms_of_service=utils.get_pydantic_model(
1136
+ terms_of_service, Optional[components.PatchAccountTermsOfService]
1137
+ ),
1138
+ foreign_id=foreign_id,
1139
+ customer_support=utils.get_pydantic_model(
1140
+ customer_support,
1141
+ OptionalNullable[components.PatchAccountCustomerSupport],
1142
+ ),
1143
+ settings=utils.get_pydantic_model(
1144
+ settings, Optional[components.CreateAccountSettings]
1145
+ ),
1146
+ ),
1147
+ )
1148
+
1149
+ req = self._build_request_async(
1150
+ method="PATCH",
1151
+ path="/accounts/{accountID}",
1152
+ base_url=base_url,
1153
+ url_variables=url_variables,
1154
+ request=request,
1155
+ request_body_required=True,
1156
+ request_has_path_params=True,
1157
+ request_has_query_params=True,
1158
+ user_agent_header="user-agent",
1159
+ accept_header_value="application/json",
1160
+ http_headers=http_headers,
1161
+ _globals=operations.UpdateAccountGlobals(
1162
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1163
+ ),
1164
+ security=self.sdk_configuration.security,
1165
+ get_serialized_body=lambda: utils.serialize_request_body(
1166
+ request.patch_account, False, False, "json", components.PatchAccount
1167
+ ),
1168
+ timeout_ms=timeout_ms,
1169
+ )
1170
+
1171
+ if retries == UNSET:
1172
+ if self.sdk_configuration.retry_config is not UNSET:
1173
+ retries = self.sdk_configuration.retry_config
1174
+
1175
+ retry_config = None
1176
+ if isinstance(retries, utils.RetryConfig):
1177
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1178
+
1179
+ http_res = await self.do_request_async(
1180
+ hook_ctx=HookContext(
1181
+ base_url=base_url or "",
1182
+ operation_id="updateAccount",
1183
+ oauth2_scopes=[],
1184
+ security_source=get_security_from_env(
1185
+ self.sdk_configuration.security, components.Security
1186
+ ),
1187
+ ),
1188
+ request=req,
1189
+ error_status_codes=[
1190
+ "400",
1191
+ "401",
1192
+ "403",
1193
+ "404",
1194
+ "409",
1195
+ "422",
1196
+ "429",
1197
+ "4XX",
1198
+ "500",
1199
+ "504",
1200
+ "5XX",
1201
+ ],
1202
+ retry_config=retry_config,
1203
+ )
1204
+
1205
+ response_data: Any = None
1206
+ if utils.match_response(http_res, "200", "application/json"):
1207
+ return operations.UpdateAccountResponse(
1208
+ result=utils.unmarshal_json(http_res.text, components.Account),
1209
+ headers=utils.get_response_headers(http_res.headers),
1210
+ )
1211
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
1212
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1213
+ raise errors.GenericError(data=response_data)
1214
+ if utils.match_response(http_res, "422", "application/json"):
1215
+ response_data = utils.unmarshal_json(
1216
+ http_res.text, errors.UpdateAccountResponseBodyData
1217
+ )
1218
+ raise errors.UpdateAccountResponseBody(data=response_data)
1219
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1220
+ http_res_text = await utils.stream_to_text_async(http_res)
1221
+ raise errors.APIError(
1222
+ "API error occurred", http_res.status_code, http_res_text, http_res
1223
+ )
1224
+ if utils.match_response(http_res, ["500", "504"], "*"):
1225
+ http_res_text = await utils.stream_to_text_async(http_res)
1226
+ raise errors.APIError(
1227
+ "API error occurred", http_res.status_code, http_res_text, http_res
1228
+ )
1229
+ if utils.match_response(http_res, "4XX", "*"):
1230
+ http_res_text = await utils.stream_to_text_async(http_res)
1231
+ raise errors.APIError(
1232
+ "API error occurred", http_res.status_code, http_res_text, http_res
1233
+ )
1234
+ if utils.match_response(http_res, "5XX", "*"):
1235
+ http_res_text = await utils.stream_to_text_async(http_res)
1236
+ raise errors.APIError(
1237
+ "API error occurred", http_res.status_code, http_res_text, http_res
1238
+ )
1239
+
1240
+ content_type = http_res.headers.get("Content-Type")
1241
+ http_res_text = await utils.stream_to_text_async(http_res)
1242
+ raise errors.APIError(
1243
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1244
+ http_res.status_code,
1245
+ http_res_text,
1246
+ http_res,
1247
+ )
1248
+
1249
+ def disconnect(
1250
+ self,
1251
+ *,
1252
+ account_id: str,
1253
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1254
+ server_url: Optional[str] = None,
1255
+ timeout_ms: Optional[int] = None,
1256
+ http_headers: Optional[Mapping[str, str]] = None,
1257
+ ) -> operations.DisconnectAccountResponse:
1258
+ r"""This will sever the connection between you and the account specified and it will no longer be listed as
1259
+ active in the list of accounts. This also means you'll only have read-only access to the account going
1260
+ forward for reporting purposes.
1261
+
1262
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
1263
+ you'll need to specify the `/accounts/{accountID}/profile.disconnect` scope.
1264
+
1265
+ :param account_id:
1266
+ :param retries: Override the default retry configuration for this method
1267
+ :param server_url: Override the default server URL for this method
1268
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1269
+ :param http_headers: Additional headers to set or replace on requests.
1270
+ """
1271
+ base_url = None
1272
+ url_variables = None
1273
+ if timeout_ms is None:
1274
+ timeout_ms = self.sdk_configuration.timeout_ms
1275
+
1276
+ if server_url is not None:
1277
+ base_url = server_url
1278
+ else:
1279
+ base_url = self._get_url(base_url, url_variables)
1280
+
1281
+ request = operations.DisconnectAccountRequest(
1282
+ account_id=account_id,
1283
+ )
1284
+
1285
+ req = self._build_request(
1286
+ method="DELETE",
1287
+ path="/accounts/{accountID}",
1288
+ base_url=base_url,
1289
+ url_variables=url_variables,
1290
+ request=request,
1291
+ request_body_required=False,
1292
+ request_has_path_params=True,
1293
+ request_has_query_params=True,
1294
+ user_agent_header="user-agent",
1295
+ accept_header_value="application/json",
1296
+ http_headers=http_headers,
1297
+ _globals=operations.DisconnectAccountGlobals(
1298
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1299
+ ),
1300
+ security=self.sdk_configuration.security,
1301
+ timeout_ms=timeout_ms,
1302
+ )
1303
+
1304
+ if retries == UNSET:
1305
+ if self.sdk_configuration.retry_config is not UNSET:
1306
+ retries = self.sdk_configuration.retry_config
1307
+
1308
+ retry_config = None
1309
+ if isinstance(retries, utils.RetryConfig):
1310
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1311
+
1312
+ http_res = self.do_request(
1313
+ hook_ctx=HookContext(
1314
+ base_url=base_url or "",
1315
+ operation_id="disconnectAccount",
1316
+ oauth2_scopes=[],
1317
+ security_source=get_security_from_env(
1318
+ self.sdk_configuration.security, components.Security
1319
+ ),
1320
+ ),
1321
+ request=req,
1322
+ error_status_codes=[
1323
+ "400",
1324
+ "401",
1325
+ "403",
1326
+ "404",
1327
+ "409",
1328
+ "429",
1329
+ "4XX",
1330
+ "500",
1331
+ "504",
1332
+ "5XX",
1333
+ ],
1334
+ retry_config=retry_config,
1335
+ )
1336
+
1337
+ response_data: Any = None
1338
+ if utils.match_response(http_res, "204", "*"):
1339
+ return operations.DisconnectAccountResponse(
1340
+ headers=utils.get_response_headers(http_res.headers)
1341
+ )
1342
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
1343
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1344
+ raise errors.GenericError(data=response_data)
1345
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1346
+ http_res_text = utils.stream_to_text(http_res)
1347
+ raise errors.APIError(
1348
+ "API error occurred", http_res.status_code, http_res_text, http_res
1349
+ )
1350
+ if utils.match_response(http_res, ["500", "504"], "*"):
1351
+ http_res_text = utils.stream_to_text(http_res)
1352
+ raise errors.APIError(
1353
+ "API error occurred", http_res.status_code, http_res_text, http_res
1354
+ )
1355
+ if utils.match_response(http_res, "4XX", "*"):
1356
+ http_res_text = utils.stream_to_text(http_res)
1357
+ raise errors.APIError(
1358
+ "API error occurred", http_res.status_code, http_res_text, http_res
1359
+ )
1360
+ if utils.match_response(http_res, "5XX", "*"):
1361
+ http_res_text = utils.stream_to_text(http_res)
1362
+ raise errors.APIError(
1363
+ "API error occurred", http_res.status_code, http_res_text, http_res
1364
+ )
1365
+
1366
+ content_type = http_res.headers.get("Content-Type")
1367
+ http_res_text = utils.stream_to_text(http_res)
1368
+ raise errors.APIError(
1369
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1370
+ http_res.status_code,
1371
+ http_res_text,
1372
+ http_res,
1373
+ )
1374
+
1375
+ async def disconnect_async(
1376
+ self,
1377
+ *,
1378
+ account_id: str,
1379
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1380
+ server_url: Optional[str] = None,
1381
+ timeout_ms: Optional[int] = None,
1382
+ http_headers: Optional[Mapping[str, str]] = None,
1383
+ ) -> operations.DisconnectAccountResponse:
1384
+ r"""This will sever the connection between you and the account specified and it will no longer be listed as
1385
+ active in the list of accounts. This also means you'll only have read-only access to the account going
1386
+ forward for reporting purposes.
1387
+
1388
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
1389
+ you'll need to specify the `/accounts/{accountID}/profile.disconnect` scope.
1390
+
1391
+ :param account_id:
1392
+ :param retries: Override the default retry configuration for this method
1393
+ :param server_url: Override the default server URL for this method
1394
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1395
+ :param http_headers: Additional headers to set or replace on requests.
1396
+ """
1397
+ base_url = None
1398
+ url_variables = None
1399
+ if timeout_ms is None:
1400
+ timeout_ms = self.sdk_configuration.timeout_ms
1401
+
1402
+ if server_url is not None:
1403
+ base_url = server_url
1404
+ else:
1405
+ base_url = self._get_url(base_url, url_variables)
1406
+
1407
+ request = operations.DisconnectAccountRequest(
1408
+ account_id=account_id,
1409
+ )
1410
+
1411
+ req = self._build_request_async(
1412
+ method="DELETE",
1413
+ path="/accounts/{accountID}",
1414
+ base_url=base_url,
1415
+ url_variables=url_variables,
1416
+ request=request,
1417
+ request_body_required=False,
1418
+ request_has_path_params=True,
1419
+ request_has_query_params=True,
1420
+ user_agent_header="user-agent",
1421
+ accept_header_value="application/json",
1422
+ http_headers=http_headers,
1423
+ _globals=operations.DisconnectAccountGlobals(
1424
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1425
+ ),
1426
+ security=self.sdk_configuration.security,
1427
+ timeout_ms=timeout_ms,
1428
+ )
1429
+
1430
+ if retries == UNSET:
1431
+ if self.sdk_configuration.retry_config is not UNSET:
1432
+ retries = self.sdk_configuration.retry_config
1433
+
1434
+ retry_config = None
1435
+ if isinstance(retries, utils.RetryConfig):
1436
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1437
+
1438
+ http_res = await self.do_request_async(
1439
+ hook_ctx=HookContext(
1440
+ base_url=base_url or "",
1441
+ operation_id="disconnectAccount",
1442
+ oauth2_scopes=[],
1443
+ security_source=get_security_from_env(
1444
+ self.sdk_configuration.security, components.Security
1445
+ ),
1446
+ ),
1447
+ request=req,
1448
+ error_status_codes=[
1449
+ "400",
1450
+ "401",
1451
+ "403",
1452
+ "404",
1453
+ "409",
1454
+ "429",
1455
+ "4XX",
1456
+ "500",
1457
+ "504",
1458
+ "5XX",
1459
+ ],
1460
+ retry_config=retry_config,
1461
+ )
1462
+
1463
+ response_data: Any = None
1464
+ if utils.match_response(http_res, "204", "*"):
1465
+ return operations.DisconnectAccountResponse(
1466
+ headers=utils.get_response_headers(http_res.headers)
1467
+ )
1468
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
1469
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1470
+ raise errors.GenericError(data=response_data)
1471
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1472
+ http_res_text = await utils.stream_to_text_async(http_res)
1473
+ raise errors.APIError(
1474
+ "API error occurred", http_res.status_code, http_res_text, http_res
1475
+ )
1476
+ if utils.match_response(http_res, ["500", "504"], "*"):
1477
+ http_res_text = await utils.stream_to_text_async(http_res)
1478
+ raise errors.APIError(
1479
+ "API error occurred", http_res.status_code, http_res_text, http_res
1480
+ )
1481
+ if utils.match_response(http_res, "4XX", "*"):
1482
+ http_res_text = await utils.stream_to_text_async(http_res)
1483
+ raise errors.APIError(
1484
+ "API error occurred", http_res.status_code, http_res_text, http_res
1485
+ )
1486
+ if utils.match_response(http_res, "5XX", "*"):
1487
+ http_res_text = await utils.stream_to_text_async(http_res)
1488
+ raise errors.APIError(
1489
+ "API error occurred", http_res.status_code, http_res_text, http_res
1490
+ )
1491
+
1492
+ content_type = http_res.headers.get("Content-Type")
1493
+ http_res_text = await utils.stream_to_text_async(http_res)
1494
+ raise errors.APIError(
1495
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1496
+ http_res.status_code,
1497
+ http_res_text,
1498
+ http_res,
1499
+ )
1500
+
1501
+ def get_countries(
1502
+ self,
1503
+ *,
1504
+ account_id: str,
1505
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1506
+ server_url: Optional[str] = None,
1507
+ timeout_ms: Optional[int] = None,
1508
+ http_headers: Optional[Mapping[str, str]] = None,
1509
+ ) -> operations.GetAccountCountriesResponse:
1510
+ r"""Retrieve the specified countries of operation for an account.
1511
+
1512
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
1513
+ you'll need to specify the `/accounts/{accountID}/profile.read` scope.
1514
+
1515
+ :param account_id:
1516
+ :param retries: Override the default retry configuration for this method
1517
+ :param server_url: Override the default server URL for this method
1518
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1519
+ :param http_headers: Additional headers to set or replace on requests.
1520
+ """
1521
+ base_url = None
1522
+ url_variables = None
1523
+ if timeout_ms is None:
1524
+ timeout_ms = self.sdk_configuration.timeout_ms
1525
+
1526
+ if server_url is not None:
1527
+ base_url = server_url
1528
+ else:
1529
+ base_url = self._get_url(base_url, url_variables)
1530
+
1531
+ request = operations.GetAccountCountriesRequest(
1532
+ account_id=account_id,
1533
+ )
1534
+
1535
+ req = self._build_request(
1536
+ method="GET",
1537
+ path="/accounts/{accountID}/countries",
1538
+ base_url=base_url,
1539
+ url_variables=url_variables,
1540
+ request=request,
1541
+ request_body_required=False,
1542
+ request_has_path_params=True,
1543
+ request_has_query_params=True,
1544
+ user_agent_header="user-agent",
1545
+ accept_header_value="application/json",
1546
+ http_headers=http_headers,
1547
+ _globals=operations.GetAccountCountriesGlobals(
1548
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1549
+ ),
1550
+ security=self.sdk_configuration.security,
1551
+ timeout_ms=timeout_ms,
1552
+ )
1553
+
1554
+ if retries == UNSET:
1555
+ if self.sdk_configuration.retry_config is not UNSET:
1556
+ retries = self.sdk_configuration.retry_config
1557
+
1558
+ retry_config = None
1559
+ if isinstance(retries, utils.RetryConfig):
1560
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1561
+
1562
+ http_res = self.do_request(
1563
+ hook_ctx=HookContext(
1564
+ base_url=base_url or "",
1565
+ operation_id="getAccountCountries",
1566
+ oauth2_scopes=[],
1567
+ security_source=get_security_from_env(
1568
+ self.sdk_configuration.security, components.Security
1569
+ ),
1570
+ ),
1571
+ request=req,
1572
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
1573
+ retry_config=retry_config,
1574
+ )
1575
+
1576
+ if utils.match_response(http_res, "200", "application/json"):
1577
+ return operations.GetAccountCountriesResponse(
1578
+ result=utils.unmarshal_json(http_res.text, components.AccountCountries),
1579
+ headers=utils.get_response_headers(http_res.headers),
1580
+ )
1581
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1582
+ http_res_text = utils.stream_to_text(http_res)
1583
+ raise errors.APIError(
1584
+ "API error occurred", http_res.status_code, http_res_text, http_res
1585
+ )
1586
+ if utils.match_response(http_res, ["500", "504"], "*"):
1587
+ http_res_text = utils.stream_to_text(http_res)
1588
+ raise errors.APIError(
1589
+ "API error occurred", http_res.status_code, http_res_text, http_res
1590
+ )
1591
+ if utils.match_response(http_res, "4XX", "*"):
1592
+ http_res_text = utils.stream_to_text(http_res)
1593
+ raise errors.APIError(
1594
+ "API error occurred", http_res.status_code, http_res_text, http_res
1595
+ )
1596
+ if utils.match_response(http_res, "5XX", "*"):
1597
+ http_res_text = utils.stream_to_text(http_res)
1598
+ raise errors.APIError(
1599
+ "API error occurred", http_res.status_code, http_res_text, http_res
1600
+ )
1601
+
1602
+ content_type = http_res.headers.get("Content-Type")
1603
+ http_res_text = utils.stream_to_text(http_res)
1604
+ raise errors.APIError(
1605
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1606
+ http_res.status_code,
1607
+ http_res_text,
1608
+ http_res,
1609
+ )
1610
+
1611
+ async def get_countries_async(
1612
+ self,
1613
+ *,
1614
+ account_id: str,
1615
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1616
+ server_url: Optional[str] = None,
1617
+ timeout_ms: Optional[int] = None,
1618
+ http_headers: Optional[Mapping[str, str]] = None,
1619
+ ) -> operations.GetAccountCountriesResponse:
1620
+ r"""Retrieve the specified countries of operation for an account.
1621
+
1622
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
1623
+ you'll need to specify the `/accounts/{accountID}/profile.read` scope.
1624
+
1625
+ :param account_id:
1626
+ :param retries: Override the default retry configuration for this method
1627
+ :param server_url: Override the default server URL for this method
1628
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1629
+ :param http_headers: Additional headers to set or replace on requests.
1630
+ """
1631
+ base_url = None
1632
+ url_variables = None
1633
+ if timeout_ms is None:
1634
+ timeout_ms = self.sdk_configuration.timeout_ms
1635
+
1636
+ if server_url is not None:
1637
+ base_url = server_url
1638
+ else:
1639
+ base_url = self._get_url(base_url, url_variables)
1640
+
1641
+ request = operations.GetAccountCountriesRequest(
1642
+ account_id=account_id,
1643
+ )
1644
+
1645
+ req = self._build_request_async(
1646
+ method="GET",
1647
+ path="/accounts/{accountID}/countries",
1648
+ base_url=base_url,
1649
+ url_variables=url_variables,
1650
+ request=request,
1651
+ request_body_required=False,
1652
+ request_has_path_params=True,
1653
+ request_has_query_params=True,
1654
+ user_agent_header="user-agent",
1655
+ accept_header_value="application/json",
1656
+ http_headers=http_headers,
1657
+ _globals=operations.GetAccountCountriesGlobals(
1658
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1659
+ ),
1660
+ security=self.sdk_configuration.security,
1661
+ timeout_ms=timeout_ms,
1662
+ )
1663
+
1664
+ if retries == UNSET:
1665
+ if self.sdk_configuration.retry_config is not UNSET:
1666
+ retries = self.sdk_configuration.retry_config
1667
+
1668
+ retry_config = None
1669
+ if isinstance(retries, utils.RetryConfig):
1670
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1671
+
1672
+ http_res = await self.do_request_async(
1673
+ hook_ctx=HookContext(
1674
+ base_url=base_url or "",
1675
+ operation_id="getAccountCountries",
1676
+ oauth2_scopes=[],
1677
+ security_source=get_security_from_env(
1678
+ self.sdk_configuration.security, components.Security
1679
+ ),
1680
+ ),
1681
+ request=req,
1682
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
1683
+ retry_config=retry_config,
1684
+ )
1685
+
1686
+ if utils.match_response(http_res, "200", "application/json"):
1687
+ return operations.GetAccountCountriesResponse(
1688
+ result=utils.unmarshal_json(http_res.text, components.AccountCountries),
1689
+ headers=utils.get_response_headers(http_res.headers),
1690
+ )
1691
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1692
+ http_res_text = await utils.stream_to_text_async(http_res)
1693
+ raise errors.APIError(
1694
+ "API error occurred", http_res.status_code, http_res_text, http_res
1695
+ )
1696
+ if utils.match_response(http_res, ["500", "504"], "*"):
1697
+ http_res_text = await utils.stream_to_text_async(http_res)
1698
+ raise errors.APIError(
1699
+ "API error occurred", http_res.status_code, http_res_text, http_res
1700
+ )
1701
+ if utils.match_response(http_res, "4XX", "*"):
1702
+ http_res_text = await utils.stream_to_text_async(http_res)
1703
+ raise errors.APIError(
1704
+ "API error occurred", http_res.status_code, http_res_text, http_res
1705
+ )
1706
+ if utils.match_response(http_res, "5XX", "*"):
1707
+ http_res_text = await utils.stream_to_text_async(http_res)
1708
+ raise errors.APIError(
1709
+ "API error occurred", http_res.status_code, http_res_text, http_res
1710
+ )
1711
+
1712
+ content_type = http_res.headers.get("Content-Type")
1713
+ http_res_text = await utils.stream_to_text_async(http_res)
1714
+ raise errors.APIError(
1715
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1716
+ http_res.status_code,
1717
+ http_res_text,
1718
+ http_res,
1719
+ )
1720
+
1721
+ def assign_countries(
1722
+ self,
1723
+ *,
1724
+ account_id: str,
1725
+ countries: List[str],
1726
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1727
+ server_url: Optional[str] = None,
1728
+ timeout_ms: Optional[int] = None,
1729
+ http_headers: Optional[Mapping[str, str]] = None,
1730
+ ) -> operations.AssignAccountCountriesResponse:
1731
+ r"""Assign the countries of operation for an account.
1732
+
1733
+ This endpoint will always overwrite the previously assigned values.
1734
+
1735
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
1736
+ you'll need to specify the `/accounts/{accountID}/profile.write` scope.
1737
+
1738
+ :param account_id:
1739
+ :param countries:
1740
+ :param retries: Override the default retry configuration for this method
1741
+ :param server_url: Override the default server URL for this method
1742
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1743
+ :param http_headers: Additional headers to set or replace on requests.
1744
+ """
1745
+ base_url = None
1746
+ url_variables = None
1747
+ if timeout_ms is None:
1748
+ timeout_ms = self.sdk_configuration.timeout_ms
1749
+
1750
+ if server_url is not None:
1751
+ base_url = server_url
1752
+ else:
1753
+ base_url = self._get_url(base_url, url_variables)
1754
+
1755
+ request = operations.AssignAccountCountriesRequest(
1756
+ account_id=account_id,
1757
+ account_countries=components.AccountCountries(
1758
+ countries=countries,
1759
+ ),
1760
+ )
1761
+
1762
+ req = self._build_request(
1763
+ method="PUT",
1764
+ path="/accounts/{accountID}/countries",
1765
+ base_url=base_url,
1766
+ url_variables=url_variables,
1767
+ request=request,
1768
+ request_body_required=True,
1769
+ request_has_path_params=True,
1770
+ request_has_query_params=True,
1771
+ user_agent_header="user-agent",
1772
+ accept_header_value="application/json",
1773
+ http_headers=http_headers,
1774
+ _globals=operations.AssignAccountCountriesGlobals(
1775
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1776
+ ),
1777
+ security=self.sdk_configuration.security,
1778
+ get_serialized_body=lambda: utils.serialize_request_body(
1779
+ request.account_countries,
1780
+ False,
1781
+ False,
1782
+ "json",
1783
+ components.AccountCountries,
1784
+ ),
1785
+ timeout_ms=timeout_ms,
1786
+ )
1787
+
1788
+ if retries == UNSET:
1789
+ if self.sdk_configuration.retry_config is not UNSET:
1790
+ retries = self.sdk_configuration.retry_config
1791
+
1792
+ retry_config = None
1793
+ if isinstance(retries, utils.RetryConfig):
1794
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1795
+
1796
+ http_res = self.do_request(
1797
+ hook_ctx=HookContext(
1798
+ base_url=base_url or "",
1799
+ operation_id="assignAccountCountries",
1800
+ oauth2_scopes=[],
1801
+ security_source=get_security_from_env(
1802
+ self.sdk_configuration.security, components.Security
1803
+ ),
1804
+ ),
1805
+ request=req,
1806
+ error_status_codes=[
1807
+ "400",
1808
+ "401",
1809
+ "403",
1810
+ "404",
1811
+ "409",
1812
+ "422",
1813
+ "429",
1814
+ "4XX",
1815
+ "500",
1816
+ "504",
1817
+ "5XX",
1818
+ ],
1819
+ retry_config=retry_config,
1820
+ )
1821
+
1822
+ response_data: Any = None
1823
+ if utils.match_response(http_res, "200", "application/json"):
1824
+ return operations.AssignAccountCountriesResponse(
1825
+ result=utils.unmarshal_json(http_res.text, components.AccountCountries),
1826
+ headers=utils.get_response_headers(http_res.headers),
1827
+ )
1828
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
1829
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1830
+ raise errors.GenericError(data=response_data)
1831
+ if utils.match_response(http_res, "422", "application/json"):
1832
+ response_data = utils.unmarshal_json(
1833
+ http_res.text, errors.AssignCountriesErrorData
1834
+ )
1835
+ raise errors.AssignCountriesError(data=response_data)
1836
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1837
+ http_res_text = utils.stream_to_text(http_res)
1838
+ raise errors.APIError(
1839
+ "API error occurred", http_res.status_code, http_res_text, http_res
1840
+ )
1841
+ if utils.match_response(http_res, ["500", "504"], "*"):
1842
+ http_res_text = utils.stream_to_text(http_res)
1843
+ raise errors.APIError(
1844
+ "API error occurred", http_res.status_code, http_res_text, http_res
1845
+ )
1846
+ if utils.match_response(http_res, "4XX", "*"):
1847
+ http_res_text = utils.stream_to_text(http_res)
1848
+ raise errors.APIError(
1849
+ "API error occurred", http_res.status_code, http_res_text, http_res
1850
+ )
1851
+ if utils.match_response(http_res, "5XX", "*"):
1852
+ http_res_text = utils.stream_to_text(http_res)
1853
+ raise errors.APIError(
1854
+ "API error occurred", http_res.status_code, http_res_text, http_res
1855
+ )
1856
+
1857
+ content_type = http_res.headers.get("Content-Type")
1858
+ http_res_text = utils.stream_to_text(http_res)
1859
+ raise errors.APIError(
1860
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1861
+ http_res.status_code,
1862
+ http_res_text,
1863
+ http_res,
1864
+ )
1865
+
1866
+ async def assign_countries_async(
1867
+ self,
1868
+ *,
1869
+ account_id: str,
1870
+ countries: List[str],
1871
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1872
+ server_url: Optional[str] = None,
1873
+ timeout_ms: Optional[int] = None,
1874
+ http_headers: Optional[Mapping[str, str]] = None,
1875
+ ) -> operations.AssignAccountCountriesResponse:
1876
+ r"""Assign the countries of operation for an account.
1877
+
1878
+ This endpoint will always overwrite the previously assigned values.
1879
+
1880
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
1881
+ you'll need to specify the `/accounts/{accountID}/profile.write` scope.
1882
+
1883
+ :param account_id:
1884
+ :param countries:
1885
+ :param retries: Override the default retry configuration for this method
1886
+ :param server_url: Override the default server URL for this method
1887
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1888
+ :param http_headers: Additional headers to set or replace on requests.
1889
+ """
1890
+ base_url = None
1891
+ url_variables = None
1892
+ if timeout_ms is None:
1893
+ timeout_ms = self.sdk_configuration.timeout_ms
1894
+
1895
+ if server_url is not None:
1896
+ base_url = server_url
1897
+ else:
1898
+ base_url = self._get_url(base_url, url_variables)
1899
+
1900
+ request = operations.AssignAccountCountriesRequest(
1901
+ account_id=account_id,
1902
+ account_countries=components.AccountCountries(
1903
+ countries=countries,
1904
+ ),
1905
+ )
1906
+
1907
+ req = self._build_request_async(
1908
+ method="PUT",
1909
+ path="/accounts/{accountID}/countries",
1910
+ base_url=base_url,
1911
+ url_variables=url_variables,
1912
+ request=request,
1913
+ request_body_required=True,
1914
+ request_has_path_params=True,
1915
+ request_has_query_params=True,
1916
+ user_agent_header="user-agent",
1917
+ accept_header_value="application/json",
1918
+ http_headers=http_headers,
1919
+ _globals=operations.AssignAccountCountriesGlobals(
1920
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
1921
+ ),
1922
+ security=self.sdk_configuration.security,
1923
+ get_serialized_body=lambda: utils.serialize_request_body(
1924
+ request.account_countries,
1925
+ False,
1926
+ False,
1927
+ "json",
1928
+ components.AccountCountries,
1929
+ ),
1930
+ timeout_ms=timeout_ms,
1931
+ )
1932
+
1933
+ if retries == UNSET:
1934
+ if self.sdk_configuration.retry_config is not UNSET:
1935
+ retries = self.sdk_configuration.retry_config
1936
+
1937
+ retry_config = None
1938
+ if isinstance(retries, utils.RetryConfig):
1939
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1940
+
1941
+ http_res = await self.do_request_async(
1942
+ hook_ctx=HookContext(
1943
+ base_url=base_url or "",
1944
+ operation_id="assignAccountCountries",
1945
+ oauth2_scopes=[],
1946
+ security_source=get_security_from_env(
1947
+ self.sdk_configuration.security, components.Security
1948
+ ),
1949
+ ),
1950
+ request=req,
1951
+ error_status_codes=[
1952
+ "400",
1953
+ "401",
1954
+ "403",
1955
+ "404",
1956
+ "409",
1957
+ "422",
1958
+ "429",
1959
+ "4XX",
1960
+ "500",
1961
+ "504",
1962
+ "5XX",
1963
+ ],
1964
+ retry_config=retry_config,
1965
+ )
1966
+
1967
+ response_data: Any = None
1968
+ if utils.match_response(http_res, "200", "application/json"):
1969
+ return operations.AssignAccountCountriesResponse(
1970
+ result=utils.unmarshal_json(http_res.text, components.AccountCountries),
1971
+ headers=utils.get_response_headers(http_res.headers),
1972
+ )
1973
+ if utils.match_response(http_res, ["400", "409"], "application/json"):
1974
+ response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
1975
+ raise errors.GenericError(data=response_data)
1976
+ if utils.match_response(http_res, "422", "application/json"):
1977
+ response_data = utils.unmarshal_json(
1978
+ http_res.text, errors.AssignCountriesErrorData
1979
+ )
1980
+ raise errors.AssignCountriesError(data=response_data)
1981
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
1982
+ http_res_text = await utils.stream_to_text_async(http_res)
1983
+ raise errors.APIError(
1984
+ "API error occurred", http_res.status_code, http_res_text, http_res
1985
+ )
1986
+ if utils.match_response(http_res, ["500", "504"], "*"):
1987
+ http_res_text = await utils.stream_to_text_async(http_res)
1988
+ raise errors.APIError(
1989
+ "API error occurred", http_res.status_code, http_res_text, http_res
1990
+ )
1991
+ if utils.match_response(http_res, "4XX", "*"):
1992
+ http_res_text = await utils.stream_to_text_async(http_res)
1993
+ raise errors.APIError(
1994
+ "API error occurred", http_res.status_code, http_res_text, http_res
1995
+ )
1996
+ if utils.match_response(http_res, "5XX", "*"):
1997
+ http_res_text = await utils.stream_to_text_async(http_res)
1998
+ raise errors.APIError(
1999
+ "API error occurred", http_res.status_code, http_res_text, http_res
2000
+ )
2001
+
2002
+ content_type = http_res.headers.get("Content-Type")
2003
+ http_res_text = await utils.stream_to_text_async(http_res)
2004
+ raise errors.APIError(
2005
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
2006
+ http_res.status_code,
2007
+ http_res_text,
2008
+ http_res,
2009
+ )
2010
+
2011
+ def get_merchant_processing_agreement(
2012
+ self,
2013
+ *,
2014
+ account_id: str,
2015
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
2016
+ server_url: Optional[str] = None,
2017
+ timeout_ms: Optional[int] = None,
2018
+ http_headers: Optional[Mapping[str, str]] = None,
2019
+ ) -> operations.GetMerchantProcessingAgreementResponse:
2020
+ r"""Retrieve a merchant account's processing agreement.
2021
+
2022
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
2023
+ you'll need to specify the `/accounts/{accountID}/profile.read` scope.
2024
+
2025
+ :param account_id:
2026
+ :param retries: Override the default retry configuration for this method
2027
+ :param server_url: Override the default server URL for this method
2028
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
2029
+ :param http_headers: Additional headers to set or replace on requests.
2030
+ """
2031
+ base_url = None
2032
+ url_variables = None
2033
+ if timeout_ms is None:
2034
+ timeout_ms = self.sdk_configuration.timeout_ms
2035
+
2036
+ if server_url is not None:
2037
+ base_url = server_url
2038
+ else:
2039
+ base_url = self._get_url(base_url, url_variables)
2040
+
2041
+ request = operations.GetMerchantProcessingAgreementRequest(
2042
+ account_id=account_id,
2043
+ )
2044
+
2045
+ req = self._build_request(
2046
+ method="GET",
2047
+ path="/accounts/{accountID}/merchant-agreement",
2048
+ base_url=base_url,
2049
+ url_variables=url_variables,
2050
+ request=request,
2051
+ request_body_required=False,
2052
+ request_has_path_params=True,
2053
+ request_has_query_params=True,
2054
+ user_agent_header="user-agent",
2055
+ accept_header_value="application/pdf",
2056
+ http_headers=http_headers,
2057
+ _globals=operations.GetMerchantProcessingAgreementGlobals(
2058
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
2059
+ ),
2060
+ security=self.sdk_configuration.security,
2061
+ timeout_ms=timeout_ms,
2062
+ )
2063
+
2064
+ if retries == UNSET:
2065
+ if self.sdk_configuration.retry_config is not UNSET:
2066
+ retries = self.sdk_configuration.retry_config
2067
+
2068
+ retry_config = None
2069
+ if isinstance(retries, utils.RetryConfig):
2070
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
2071
+
2072
+ http_res = self.do_request(
2073
+ hook_ctx=HookContext(
2074
+ base_url=base_url or "",
2075
+ operation_id="getMerchantProcessingAgreement",
2076
+ oauth2_scopes=[],
2077
+ security_source=get_security_from_env(
2078
+ self.sdk_configuration.security, components.Security
2079
+ ),
2080
+ ),
2081
+ request=req,
2082
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
2083
+ stream=True,
2084
+ retry_config=retry_config,
2085
+ )
2086
+
2087
+ if utils.match_response(http_res, "200", "application/pdf"):
2088
+ return operations.GetMerchantProcessingAgreementResponse(
2089
+ result=http_res, headers=utils.get_response_headers(http_res.headers)
2090
+ )
2091
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
2092
+ http_res_text = utils.stream_to_text(http_res)
2093
+ raise errors.APIError(
2094
+ "API error occurred", http_res.status_code, http_res_text, http_res
2095
+ )
2096
+ if utils.match_response(http_res, ["500", "504"], "*"):
2097
+ http_res_text = utils.stream_to_text(http_res)
2098
+ raise errors.APIError(
2099
+ "API error occurred", http_res.status_code, http_res_text, http_res
2100
+ )
2101
+ if utils.match_response(http_res, "4XX", "*"):
2102
+ http_res_text = utils.stream_to_text(http_res)
2103
+ raise errors.APIError(
2104
+ "API error occurred", http_res.status_code, http_res_text, http_res
2105
+ )
2106
+ if utils.match_response(http_res, "5XX", "*"):
2107
+ http_res_text = utils.stream_to_text(http_res)
2108
+ raise errors.APIError(
2109
+ "API error occurred", http_res.status_code, http_res_text, http_res
2110
+ )
2111
+
2112
+ content_type = http_res.headers.get("Content-Type")
2113
+ http_res_text = utils.stream_to_text(http_res)
2114
+ raise errors.APIError(
2115
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
2116
+ http_res.status_code,
2117
+ http_res_text,
2118
+ http_res,
2119
+ )
2120
+
2121
+ async def get_merchant_processing_agreement_async(
2122
+ self,
2123
+ *,
2124
+ account_id: str,
2125
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
2126
+ server_url: Optional[str] = None,
2127
+ timeout_ms: Optional[int] = None,
2128
+ http_headers: Optional[Mapping[str, str]] = None,
2129
+ ) -> operations.GetMerchantProcessingAgreementResponse:
2130
+ r"""Retrieve a merchant account's processing agreement.
2131
+
2132
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
2133
+ you'll need to specify the `/accounts/{accountID}/profile.read` scope.
2134
+
2135
+ :param account_id:
2136
+ :param retries: Override the default retry configuration for this method
2137
+ :param server_url: Override the default server URL for this method
2138
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
2139
+ :param http_headers: Additional headers to set or replace on requests.
2140
+ """
2141
+ base_url = None
2142
+ url_variables = None
2143
+ if timeout_ms is None:
2144
+ timeout_ms = self.sdk_configuration.timeout_ms
2145
+
2146
+ if server_url is not None:
2147
+ base_url = server_url
2148
+ else:
2149
+ base_url = self._get_url(base_url, url_variables)
2150
+
2151
+ request = operations.GetMerchantProcessingAgreementRequest(
2152
+ account_id=account_id,
2153
+ )
2154
+
2155
+ req = self._build_request_async(
2156
+ method="GET",
2157
+ path="/accounts/{accountID}/merchant-agreement",
2158
+ base_url=base_url,
2159
+ url_variables=url_variables,
2160
+ request=request,
2161
+ request_body_required=False,
2162
+ request_has_path_params=True,
2163
+ request_has_query_params=True,
2164
+ user_agent_header="user-agent",
2165
+ accept_header_value="application/pdf",
2166
+ http_headers=http_headers,
2167
+ _globals=operations.GetMerchantProcessingAgreementGlobals(
2168
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
2169
+ ),
2170
+ security=self.sdk_configuration.security,
2171
+ timeout_ms=timeout_ms,
2172
+ )
2173
+
2174
+ if retries == UNSET:
2175
+ if self.sdk_configuration.retry_config is not UNSET:
2176
+ retries = self.sdk_configuration.retry_config
2177
+
2178
+ retry_config = None
2179
+ if isinstance(retries, utils.RetryConfig):
2180
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
2181
+
2182
+ http_res = await self.do_request_async(
2183
+ hook_ctx=HookContext(
2184
+ base_url=base_url or "",
2185
+ operation_id="getMerchantProcessingAgreement",
2186
+ oauth2_scopes=[],
2187
+ security_source=get_security_from_env(
2188
+ self.sdk_configuration.security, components.Security
2189
+ ),
2190
+ ),
2191
+ request=req,
2192
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
2193
+ stream=True,
2194
+ retry_config=retry_config,
2195
+ )
2196
+
2197
+ if utils.match_response(http_res, "200", "application/pdf"):
2198
+ return operations.GetMerchantProcessingAgreementResponse(
2199
+ result=http_res, headers=utils.get_response_headers(http_res.headers)
2200
+ )
2201
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
2202
+ http_res_text = await utils.stream_to_text_async(http_res)
2203
+ raise errors.APIError(
2204
+ "API error occurred", http_res.status_code, http_res_text, http_res
2205
+ )
2206
+ if utils.match_response(http_res, ["500", "504"], "*"):
2207
+ http_res_text = await utils.stream_to_text_async(http_res)
2208
+ raise errors.APIError(
2209
+ "API error occurred", http_res.status_code, http_res_text, http_res
2210
+ )
2211
+ if utils.match_response(http_res, "4XX", "*"):
2212
+ http_res_text = await utils.stream_to_text_async(http_res)
2213
+ raise errors.APIError(
2214
+ "API error occurred", http_res.status_code, http_res_text, http_res
2215
+ )
2216
+ if utils.match_response(http_res, "5XX", "*"):
2217
+ http_res_text = await utils.stream_to_text_async(http_res)
2218
+ raise errors.APIError(
2219
+ "API error occurred", http_res.status_code, http_res_text, http_res
2220
+ )
2221
+
2222
+ content_type = http_res.headers.get("Content-Type")
2223
+ http_res_text = await utils.stream_to_text_async(http_res)
2224
+ raise errors.APIError(
2225
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
2226
+ http_res.status_code,
2227
+ http_res_text,
2228
+ http_res,
2229
+ )
2230
+
2231
+ def get_terms_of_service_token(
2232
+ self,
2233
+ *,
2234
+ origin: Optional[str] = None,
2235
+ referer: Optional[str] = None,
2236
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
2237
+ server_url: Optional[str] = None,
2238
+ timeout_ms: Optional[int] = None,
2239
+ http_headers: Optional[Mapping[str, str]] = None,
2240
+ ) -> operations.GetTermsOfServiceTokenResponse:
2241
+ r"""Generates a non-expiring token that can then be used to accept Moov's terms of service.
2242
+
2243
+ This token can only be generated via API. Any Moov account requesting the collect funds, send funds, wallet,
2244
+ or card issuing capabilities must accept Moov's terms of service, then have the generated terms of service
2245
+ token patched to the account. Read more in our [documentation](https://docs.moov.io/guides/accounts/requirements/platform-agreement/).
2246
+
2247
+ :param origin: Indicates the domain from which the request originated. Required if referer header is not present.
2248
+ :param referer: Specifies the URL of the resource from which the request originated. Required if origin header is not present.
2249
+ :param retries: Override the default retry configuration for this method
2250
+ :param server_url: Override the default server URL for this method
2251
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
2252
+ :param http_headers: Additional headers to set or replace on requests.
2253
+ """
2254
+ base_url = None
2255
+ url_variables = None
2256
+ if timeout_ms is None:
2257
+ timeout_ms = self.sdk_configuration.timeout_ms
2258
+
2259
+ if server_url is not None:
2260
+ base_url = server_url
2261
+ else:
2262
+ base_url = self._get_url(base_url, url_variables)
2263
+
2264
+ request = operations.GetTermsOfServiceTokenRequest(
2265
+ origin=origin,
2266
+ referer=referer,
2267
+ )
2268
+
2269
+ req = self._build_request(
2270
+ method="GET",
2271
+ path="/tos-token",
2272
+ base_url=base_url,
2273
+ url_variables=url_variables,
2274
+ request=request,
2275
+ request_body_required=False,
2276
+ request_has_path_params=False,
2277
+ request_has_query_params=True,
2278
+ user_agent_header="user-agent",
2279
+ accept_header_value="application/json",
2280
+ http_headers=http_headers,
2281
+ _globals=operations.GetTermsOfServiceTokenGlobals(
2282
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
2283
+ ),
2284
+ security=self.sdk_configuration.security,
2285
+ timeout_ms=timeout_ms,
2286
+ )
2287
+
2288
+ if retries == UNSET:
2289
+ if self.sdk_configuration.retry_config is not UNSET:
2290
+ retries = self.sdk_configuration.retry_config
2291
+
2292
+ retry_config = None
2293
+ if isinstance(retries, utils.RetryConfig):
2294
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
2295
+
2296
+ http_res = self.do_request(
2297
+ hook_ctx=HookContext(
2298
+ base_url=base_url or "",
2299
+ operation_id="getTermsOfServiceToken",
2300
+ oauth2_scopes=[],
2301
+ security_source=get_security_from_env(
2302
+ self.sdk_configuration.security, components.Security
2303
+ ),
2304
+ ),
2305
+ request=req,
2306
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
2307
+ retry_config=retry_config,
2308
+ )
2309
+
2310
+ if utils.match_response(http_res, "200", "application/json"):
2311
+ return operations.GetTermsOfServiceTokenResponse(
2312
+ result=utils.unmarshal_json(
2313
+ http_res.text, components.TermsOfServiceToken
2314
+ ),
2315
+ headers=utils.get_response_headers(http_res.headers),
2316
+ )
2317
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
2318
+ http_res_text = utils.stream_to_text(http_res)
2319
+ raise errors.APIError(
2320
+ "API error occurred", http_res.status_code, http_res_text, http_res
2321
+ )
2322
+ if utils.match_response(http_res, ["500", "504"], "*"):
2323
+ http_res_text = utils.stream_to_text(http_res)
2324
+ raise errors.APIError(
2325
+ "API error occurred", http_res.status_code, http_res_text, http_res
2326
+ )
2327
+ if utils.match_response(http_res, "4XX", "*"):
2328
+ http_res_text = utils.stream_to_text(http_res)
2329
+ raise errors.APIError(
2330
+ "API error occurred", http_res.status_code, http_res_text, http_res
2331
+ )
2332
+ if utils.match_response(http_res, "5XX", "*"):
2333
+ http_res_text = utils.stream_to_text(http_res)
2334
+ raise errors.APIError(
2335
+ "API error occurred", http_res.status_code, http_res_text, http_res
2336
+ )
2337
+
2338
+ content_type = http_res.headers.get("Content-Type")
2339
+ http_res_text = utils.stream_to_text(http_res)
2340
+ raise errors.APIError(
2341
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
2342
+ http_res.status_code,
2343
+ http_res_text,
2344
+ http_res,
2345
+ )
2346
+
2347
+ async def get_terms_of_service_token_async(
2348
+ self,
2349
+ *,
2350
+ origin: Optional[str] = None,
2351
+ referer: Optional[str] = None,
2352
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
2353
+ server_url: Optional[str] = None,
2354
+ timeout_ms: Optional[int] = None,
2355
+ http_headers: Optional[Mapping[str, str]] = None,
2356
+ ) -> operations.GetTermsOfServiceTokenResponse:
2357
+ r"""Generates a non-expiring token that can then be used to accept Moov's terms of service.
2358
+
2359
+ This token can only be generated via API. Any Moov account requesting the collect funds, send funds, wallet,
2360
+ or card issuing capabilities must accept Moov's terms of service, then have the generated terms of service
2361
+ token patched to the account. Read more in our [documentation](https://docs.moov.io/guides/accounts/requirements/platform-agreement/).
2362
+
2363
+ :param origin: Indicates the domain from which the request originated. Required if referer header is not present.
2364
+ :param referer: Specifies the URL of the resource from which the request originated. Required if origin header is not present.
2365
+ :param retries: Override the default retry configuration for this method
2366
+ :param server_url: Override the default server URL for this method
2367
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
2368
+ :param http_headers: Additional headers to set or replace on requests.
2369
+ """
2370
+ base_url = None
2371
+ url_variables = None
2372
+ if timeout_ms is None:
2373
+ timeout_ms = self.sdk_configuration.timeout_ms
2374
+
2375
+ if server_url is not None:
2376
+ base_url = server_url
2377
+ else:
2378
+ base_url = self._get_url(base_url, url_variables)
2379
+
2380
+ request = operations.GetTermsOfServiceTokenRequest(
2381
+ origin=origin,
2382
+ referer=referer,
2383
+ )
2384
+
2385
+ req = self._build_request_async(
2386
+ method="GET",
2387
+ path="/tos-token",
2388
+ base_url=base_url,
2389
+ url_variables=url_variables,
2390
+ request=request,
2391
+ request_body_required=False,
2392
+ request_has_path_params=False,
2393
+ request_has_query_params=True,
2394
+ user_agent_header="user-agent",
2395
+ accept_header_value="application/json",
2396
+ http_headers=http_headers,
2397
+ _globals=operations.GetTermsOfServiceTokenGlobals(
2398
+ x_moov_version=self.sdk_configuration.globals.x_moov_version,
2399
+ ),
2400
+ security=self.sdk_configuration.security,
2401
+ timeout_ms=timeout_ms,
2402
+ )
2403
+
2404
+ if retries == UNSET:
2405
+ if self.sdk_configuration.retry_config is not UNSET:
2406
+ retries = self.sdk_configuration.retry_config
2407
+
2408
+ retry_config = None
2409
+ if isinstance(retries, utils.RetryConfig):
2410
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
2411
+
2412
+ http_res = await self.do_request_async(
2413
+ hook_ctx=HookContext(
2414
+ base_url=base_url or "",
2415
+ operation_id="getTermsOfServiceToken",
2416
+ oauth2_scopes=[],
2417
+ security_source=get_security_from_env(
2418
+ self.sdk_configuration.security, components.Security
2419
+ ),
2420
+ ),
2421
+ request=req,
2422
+ error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
2423
+ retry_config=retry_config,
2424
+ )
2425
+
2426
+ if utils.match_response(http_res, "200", "application/json"):
2427
+ return operations.GetTermsOfServiceTokenResponse(
2428
+ result=utils.unmarshal_json(
2429
+ http_res.text, components.TermsOfServiceToken
2430
+ ),
2431
+ headers=utils.get_response_headers(http_res.headers),
2432
+ )
2433
+ if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
2434
+ http_res_text = await utils.stream_to_text_async(http_res)
2435
+ raise errors.APIError(
2436
+ "API error occurred", http_res.status_code, http_res_text, http_res
2437
+ )
2438
+ if utils.match_response(http_res, ["500", "504"], "*"):
2439
+ http_res_text = await utils.stream_to_text_async(http_res)
2440
+ raise errors.APIError(
2441
+ "API error occurred", http_res.status_code, http_res_text, http_res
2442
+ )
2443
+ if utils.match_response(http_res, "4XX", "*"):
2444
+ http_res_text = await utils.stream_to_text_async(http_res)
2445
+ raise errors.APIError(
2446
+ "API error occurred", http_res.status_code, http_res_text, http_res
2447
+ )
2448
+ if utils.match_response(http_res, "5XX", "*"):
2449
+ http_res_text = await utils.stream_to_text_async(http_res)
2450
+ raise errors.APIError(
2451
+ "API error occurred", http_res.status_code, http_res_text, http_res
2452
+ )
2453
+
2454
+ content_type = http_res.headers.get("Content-Type")
2455
+ http_res_text = await utils.stream_to_text_async(http_res)
2456
+ raise errors.APIError(
2457
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
2458
+ http_res.status_code,
2459
+ http_res_text,
2460
+ http_res,
2461
+ )