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.
- moovio_sdk/__init__.py +17 -0
- moovio_sdk/_hooks/__init__.py +5 -0
- moovio_sdk/_hooks/registration.py +13 -0
- moovio_sdk/_hooks/sdkhooks.py +76 -0
- moovio_sdk/_hooks/types.py +106 -0
- moovio_sdk/_version.py +15 -0
- moovio_sdk/accounts.py +2461 -0
- moovio_sdk/adjustments.py +463 -0
- moovio_sdk/apple_pay.py +1417 -0
- moovio_sdk/authentication.py +531 -0
- moovio_sdk/avatars.py +231 -0
- moovio_sdk/bank_accounts.py +2445 -0
- moovio_sdk/basesdk.py +363 -0
- moovio_sdk/branding.py +1089 -0
- moovio_sdk/capabilities.py +1001 -0
- moovio_sdk/card_issuing.py +1351 -0
- moovio_sdk/cards.py +1469 -0
- moovio_sdk/disputes.py +2985 -0
- moovio_sdk/end_to_end_encryption.py +453 -0
- moovio_sdk/enriched_address.py +307 -0
- moovio_sdk/enriched_profile.py +235 -0
- moovio_sdk/fee_plans.py +1759 -0
- moovio_sdk/files.py +775 -0
- moovio_sdk/httpclient.py +136 -0
- moovio_sdk/industries.py +239 -0
- moovio_sdk/institutions.py +261 -0
- moovio_sdk/issuing_transactions.py +1228 -0
- moovio_sdk/models/__init__.py +4 -0
- moovio_sdk/models/components/__init__.py +1411 -0
- moovio_sdk/models/components/account.py +96 -0
- moovio_sdk/models/components/accountcapability.py +20 -0
- moovio_sdk/models/components/accountcountries.py +18 -0
- moovio_sdk/models/components/accountnameverification.py +28 -0
- moovio_sdk/models/components/accounttype.py +11 -0
- moovio_sdk/models/components/accountverificationstatus.py +19 -0
- moovio_sdk/models/components/achcreditsamedaypaymentmethod.py +38 -0
- moovio_sdk/models/components/achcreditstandardpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitcollectpaymentmethod.py +38 -0
- moovio_sdk/models/components/achdebitfundpaymentmethod.py +38 -0
- moovio_sdk/models/components/achexception.py +20 -0
- moovio_sdk/models/components/achlocation.py +26 -0
- moovio_sdk/models/components/achparticipant.py +93 -0
- moovio_sdk/models/components/achpaymentdetails.py +30 -0
- moovio_sdk/models/components/achpaymentdetailserror.py +22 -0
- moovio_sdk/models/components/achpaymentsettings.py +16 -0
- moovio_sdk/models/components/achreturncode.py +51 -0
- moovio_sdk/models/components/achtransactiondetails.py +94 -0
- moovio_sdk/models/components/achtransactionstatus.py +15 -0
- moovio_sdk/models/components/addcapabilities.py +15 -0
- moovio_sdk/models/components/address.py +30 -0
- moovio_sdk/models/components/addresserror.py +32 -0
- moovio_sdk/models/components/addresssuggestion.py +34 -0
- moovio_sdk/models/components/addressupdate.py +32 -0
- moovio_sdk/models/components/adjustment.py +29 -0
- moovio_sdk/models/components/amount.py +26 -0
- moovio_sdk/models/components/amountdecimal.py +27 -0
- moovio_sdk/models/components/amountupdate.py +27 -0
- moovio_sdk/models/components/amountvalidationerror.py +17 -0
- moovio_sdk/models/components/applebillingcontact.py +53 -0
- moovio_sdk/models/components/applepayheader.py +41 -0
- moovio_sdk/models/components/applepaymerchantdomains.py +32 -0
- moovio_sdk/models/components/applepaypaymentmethod.py +33 -0
- moovio_sdk/models/components/applepayresponse.py +70 -0
- moovio_sdk/models/components/applicationscope.py +41 -0
- moovio_sdk/models/components/asynccreatedrefund.py +26 -0
- moovio_sdk/models/components/asynctransfer.py +18 -0
- moovio_sdk/models/components/authorizeduser.py +21 -0
- moovio_sdk/models/components/authtoken.py +36 -0
- moovio_sdk/models/components/authtokenrequest.py +46 -0
- moovio_sdk/models/components/bankaccount.py +98 -0
- moovio_sdk/models/components/bankaccountexception.py +96 -0
- moovio_sdk/models/components/bankaccountholdertype.py +11 -0
- moovio_sdk/models/components/bankaccountintegration.py +34 -0
- moovio_sdk/models/components/bankaccountpayload.py +21 -0
- moovio_sdk/models/components/bankaccountstatus.py +12 -0
- moovio_sdk/models/components/bankaccountstatusreason.py +23 -0
- moovio_sdk/models/components/bankaccounttype.py +13 -0
- moovio_sdk/models/components/bankaccountverification.py +30 -0
- moovio_sdk/models/components/bankaccountverificationcreated.py +21 -0
- moovio_sdk/models/components/bankaccountverificationmethod.py +9 -0
- moovio_sdk/models/components/bankaccountverificationstatus.py +13 -0
- moovio_sdk/models/components/bankaccountwaitfor.py +9 -0
- moovio_sdk/models/components/basicpaymentmethod.py +24 -0
- moovio_sdk/models/components/billablefee.py +54 -0
- moovio_sdk/models/components/birthdate.py +19 -0
- moovio_sdk/models/components/birthdateerror.py +20 -0
- moovio_sdk/models/components/birthdateupdate.py +20 -0
- moovio_sdk/models/components/birthdatevalidationerror.py +20 -0
- moovio_sdk/models/components/brandcolor.py +15 -0
- moovio_sdk/models/components/brandcolors.py +21 -0
- moovio_sdk/models/components/brandcolorvalidationerror.py +14 -0
- moovio_sdk/models/components/brandproperties.py +16 -0
- moovio_sdk/models/components/businessprofile.py +81 -0
- moovio_sdk/models/components/businesstype.py +19 -0
- moovio_sdk/models/components/calltoaction.py +19 -0
- moovio_sdk/models/components/cancellation.py +22 -0
- moovio_sdk/models/components/cancellationstatus.py +10 -0
- moovio_sdk/models/components/capabilitieserror.py +14 -0
- moovio_sdk/models/components/capability.py +56 -0
- moovio_sdk/models/components/capabilityid.py +18 -0
- moovio_sdk/models/components/capabilityrequirement.py +26 -0
- moovio_sdk/models/components/capabilitystatus.py +13 -0
- moovio_sdk/models/components/card.py +164 -0
- moovio_sdk/models/components/cardaccountupdater.py +28 -0
- moovio_sdk/models/components/cardacquiringdispute.py +26 -0
- moovio_sdk/models/components/cardacquiringmodel.py +11 -0
- moovio_sdk/models/components/cardacquiringrefund.py +42 -0
- moovio_sdk/models/components/cardaddress.py +32 -0
- moovio_sdk/models/components/cardbrand.py +14 -0
- moovio_sdk/models/components/cardexpiration.py +20 -0
- moovio_sdk/models/components/cardexpirationerror.py +17 -0
- moovio_sdk/models/components/cardissuingnetwork.py +12 -0
- moovio_sdk/models/components/cardpaymentdetails.py +23 -0
- moovio_sdk/models/components/cardpaymentdetailserror.py +17 -0
- moovio_sdk/models/components/cardpaymentpaymentmethod.py +33 -0
- moovio_sdk/models/components/cardpaymentsettings.py +23 -0
- moovio_sdk/models/components/cardtransactiondetails.py +94 -0
- moovio_sdk/models/components/cardtransactionfailurecode.py +32 -0
- moovio_sdk/models/components/cardtransactionstatus.py +15 -0
- moovio_sdk/models/components/cardtype.py +13 -0
- moovio_sdk/models/components/cardupdatereason.py +16 -0
- moovio_sdk/models/components/cardverification.py +38 -0
- moovio_sdk/models/components/cardverificationresult.py +12 -0
- moovio_sdk/models/components/cardvolumedistribution.py +29 -0
- moovio_sdk/models/components/cardvolumedistributionerror.py +32 -0
- moovio_sdk/models/components/collectionpaymentmethodtype.py +12 -0
- moovio_sdk/models/components/colorsvalidationerror.py +21 -0
- moovio_sdk/models/components/completebankaccountverification.py +15 -0
- moovio_sdk/models/components/completedmicrodeposits.py +14 -0
- moovio_sdk/models/components/completemicrodeposits.py +20 -0
- moovio_sdk/models/components/countrieserrors.py +14 -0
- moovio_sdk/models/components/createaccount.py +78 -0
- moovio_sdk/models/components/createaccounterror.py +44 -0
- moovio_sdk/models/components/createaccountsettings.py +40 -0
- moovio_sdk/models/components/createapplepaysession.py +21 -0
- moovio_sdk/models/components/createauthorizeduser.py +26 -0
- moovio_sdk/models/components/createauthorizedusererror.py +24 -0
- moovio_sdk/models/components/createauthorizeduserupdate.py +28 -0
- moovio_sdk/models/components/createbusinesserror.py +88 -0
- moovio_sdk/models/components/createbusinessprofile.py +69 -0
- moovio_sdk/models/components/createevidencefilemultipart.py +63 -0
- moovio_sdk/models/components/createevidencetext.py +20 -0
- moovio_sdk/models/components/createfeeplanagreement.py +14 -0
- moovio_sdk/models/components/createindividualerror.py +72 -0
- moovio_sdk/models/components/createindividualprofile.py +37 -0
- moovio_sdk/models/components/createpaymentlink.py +95 -0
- moovio_sdk/models/components/createprofile.py +22 -0
- moovio_sdk/models/components/createprofileerror.py +19 -0
- moovio_sdk/models/components/createrefund.py +26 -0
- moovio_sdk/models/components/createrefundresponse.py +18 -0
- moovio_sdk/models/components/createrepresentative.py +50 -0
- moovio_sdk/models/components/createreversal.py +15 -0
- moovio_sdk/models/components/createsweepconfig.py +41 -0
- moovio_sdk/models/components/createterminalapplication.py +42 -0
- moovio_sdk/models/components/createtransfer.py +49 -0
- moovio_sdk/models/components/createtransferdestination.py +37 -0
- moovio_sdk/models/components/createtransferdestinationach.py +26 -0
- moovio_sdk/models/components/createtransferdestinationcard.py +19 -0
- moovio_sdk/models/components/createtransferoptions.py +24 -0
- moovio_sdk/models/components/createtransfersource.py +48 -0
- moovio_sdk/models/components/createtransfersourceach.py +40 -0
- moovio_sdk/models/components/createtransfersourcecard.py +35 -0
- moovio_sdk/models/components/customersupport.py +33 -0
- moovio_sdk/models/components/customersupporterror.py +25 -0
- moovio_sdk/models/components/debitholdperiod.py +12 -0
- moovio_sdk/models/components/disbursementpaymentmethodtype.py +13 -0
- moovio_sdk/models/components/displayoptionserror.py +23 -0
- moovio_sdk/models/components/dispute.py +76 -0
- moovio_sdk/models/components/disputeevidenceresponse.py +49 -0
- moovio_sdk/models/components/disputephase.py +13 -0
- moovio_sdk/models/components/disputestatus.py +20 -0
- moovio_sdk/models/components/disputetransferdetails.py +16 -0
- moovio_sdk/models/components/document.py +37 -0
- moovio_sdk/models/components/documenttype.py +13 -0
- moovio_sdk/models/components/domesticpullfromcard.py +12 -0
- moovio_sdk/models/components/domesticpushtocard.py +13 -0
- moovio_sdk/models/components/e2eetoken.py +25 -0
- moovio_sdk/models/components/e2eetokenupdate.py +26 -0
- moovio_sdk/models/components/end2endencryptionerror.py +14 -0
- moovio_sdk/models/components/enrichedaddressresponse.py +15 -0
- moovio_sdk/models/components/enrichedbusinessprofile.py +37 -0
- moovio_sdk/models/components/enrichedbusinessresponse.py +18 -0
- moovio_sdk/models/components/enrichedindustries.py +15 -0
- moovio_sdk/models/components/enrichedindustry.py +32 -0
- moovio_sdk/models/components/enrichedindustrycodes.py +17 -0
- moovio_sdk/models/components/evidencetextresponse.py +28 -0
- moovio_sdk/models/components/evidencetype.py +15 -0
- moovio_sdk/models/components/evidenceuploadresponse.py +50 -0
- moovio_sdk/models/components/facilitatorfee.py +48 -0
- moovio_sdk/models/components/feecategory.py +16 -0
- moovio_sdk/models/components/feemodel.py +12 -0
- moovio_sdk/models/components/feeplan.py +43 -0
- moovio_sdk/models/components/feeplanagreement.py +51 -0
- moovio_sdk/models/components/feeplanagreementstatus.py +9 -0
- moovio_sdk/models/components/feeproperties.py +49 -0
- moovio_sdk/models/components/filedetails.py +55 -0
- moovio_sdk/models/components/filepurpose.py +15 -0
- moovio_sdk/models/components/filestatus.py +12 -0
- moovio_sdk/models/components/fileuploadrequestmultipart.py +69 -0
- moovio_sdk/models/components/financialinstitutions.py +18 -0
- moovio_sdk/models/components/fulfillmentdetails.py +24 -0
- moovio_sdk/models/components/fulfillmentdetailserror.py +20 -0
- moovio_sdk/models/components/fullissuedcard.py +92 -0
- moovio_sdk/models/components/generatedby.py +39 -0
- moovio_sdk/models/components/generatedbyaccountid.py +15 -0
- moovio_sdk/models/components/generatedbybankaccountid.py +17 -0
- moovio_sdk/models/components/generatedbycardid.py +15 -0
- moovio_sdk/models/components/generatedbydisputeid.py +15 -0
- moovio_sdk/models/components/generatedbytransferid.py +15 -0
- moovio_sdk/models/components/governmentid.py +40 -0
- moovio_sdk/models/components/governmentiderror.py +40 -0
- moovio_sdk/models/components/granttype.py +15 -0
- moovio_sdk/models/components/incurredfee.py +44 -0
- moovio_sdk/models/components/individualname.py +32 -0
- moovio_sdk/models/components/individualnameerror.py +24 -0
- moovio_sdk/models/components/individualnameupdate.py +32 -0
- moovio_sdk/models/components/individualprofile.py +45 -0
- moovio_sdk/models/components/industrycodes.py +20 -0
- moovio_sdk/models/components/issuedcard.py +78 -0
- moovio_sdk/models/components/issuedcardauthorization.py +53 -0
- moovio_sdk/models/components/issuedcardauthorizationevent.py +37 -0
- moovio_sdk/models/components/issuedcardauthorizationeventresult.py +12 -0
- moovio_sdk/models/components/issuedcardeventtype.py +15 -0
- moovio_sdk/models/components/issuedcardformfactor.py +10 -0
- moovio_sdk/models/components/issuedcardstate.py +19 -0
- moovio_sdk/models/components/issuedcardtransaction.py +42 -0
- moovio_sdk/models/components/issuingauthorizationstatus.py +14 -0
- moovio_sdk/models/components/issuingcontrols.py +25 -0
- moovio_sdk/models/components/issuingcontrolserror.py +22 -0
- moovio_sdk/models/components/issuingintervallimit.py +10 -0
- moovio_sdk/models/components/issuingmerchantdata.py +47 -0
- moovio_sdk/models/components/issuingvelocitylimit.py +21 -0
- moovio_sdk/models/components/issuingvelocitylimiterror.py +17 -0
- moovio_sdk/models/components/jsonwebkey.py +103 -0
- moovio_sdk/models/components/linkapplepay.py +54 -0
- moovio_sdk/models/components/linkapplepaymentdata.py +51 -0
- moovio_sdk/models/components/linkapplepaymentmethod.py +38 -0
- moovio_sdk/models/components/linkapplepaytoken.py +63 -0
- moovio_sdk/models/components/linkbankaccount.py +26 -0
- moovio_sdk/models/components/linkcard.py +54 -0
- moovio_sdk/models/components/linkcardwaitfor.py +8 -0
- moovio_sdk/models/components/linkedapplepaypaymentmethod.py +30 -0
- moovio_sdk/models/components/listfeesfetchrequest.py +19 -0
- moovio_sdk/models/components/manualtermsofservice.py +34 -0
- moovio_sdk/models/components/manualtermsofserviceupdate.py +41 -0
- moovio_sdk/models/components/microdepositstatus.py +8 -0
- moovio_sdk/models/components/mode.py +11 -0
- moovio_sdk/models/components/moovfeedetails.py +36 -0
- moovio_sdk/models/components/moovwalletpaymentmethod.py +31 -0
- moovio_sdk/models/components/mxauthorizationcode.py +26 -0
- moovio_sdk/models/components/mxpayload.py +46 -0
- moovio_sdk/models/components/occurrence.py +44 -0
- moovio_sdk/models/components/occurrencesresponse.py +80 -0
- moovio_sdk/models/components/occurrencestatus.py +12 -0
- moovio_sdk/models/components/onboardinginvite.py +91 -0
- moovio_sdk/models/components/onboardinginviterequest.py +57 -0
- moovio_sdk/models/components/onboardingpartneraccount.py +31 -0
- moovio_sdk/models/components/partnerpricing.py +46 -0
- moovio_sdk/models/components/partnerpricingagreement.py +56 -0
- moovio_sdk/models/components/patchaccount.py +138 -0
- moovio_sdk/models/components/patchaccounterror.py +38 -0
- moovio_sdk/models/components/patchbusiness.py +72 -0
- moovio_sdk/models/components/patchindividual.py +43 -0
- moovio_sdk/models/components/patchprofile.py +29 -0
- moovio_sdk/models/components/patchsweepconfig.py +147 -0
- moovio_sdk/models/components/patchtransfer.py +51 -0
- moovio_sdk/models/components/paymentdetailserror.py +35 -0
- moovio_sdk/models/components/paymentlink.py +125 -0
- moovio_sdk/models/components/paymentlinkcustomeroptions.py +31 -0
- moovio_sdk/models/components/paymentlinkdisplayoptions.py +39 -0
- moovio_sdk/models/components/paymentlinkdisplayoptionsupdate.py +42 -0
- moovio_sdk/models/components/paymentlinkpaymentdetails.py +40 -0
- moovio_sdk/models/components/paymentlinkpaymentdetailsupdate.py +41 -0
- moovio_sdk/models/components/paymentlinkpayoutdetails.py +32 -0
- moovio_sdk/models/components/paymentlinkpayoutdetailsupdate.py +33 -0
- moovio_sdk/models/components/paymentlinkstatus.py +11 -0
- moovio_sdk/models/components/paymentmethod.py +82 -0
- moovio_sdk/models/components/paymentmethodsbankaccount.py +65 -0
- moovio_sdk/models/components/paymentmethodscard.py +121 -0
- moovio_sdk/models/components/paymentmethodswallet.py +14 -0
- moovio_sdk/models/components/paymentmethodtype.py +19 -0
- moovio_sdk/models/components/payoutdetailserror.py +21 -0
- moovio_sdk/models/components/payoutrecipient.py +23 -0
- moovio_sdk/models/components/payoutrecipienterror.py +14 -0
- moovio_sdk/models/components/payoutrecipientupdate.py +24 -0
- moovio_sdk/models/components/phonenumber.py +18 -0
- moovio_sdk/models/components/phonenumbererror.py +18 -0
- moovio_sdk/models/components/plaidintegration.py +39 -0
- moovio_sdk/models/components/plaidlinkintegration.py +36 -0
- moovio_sdk/models/components/plaidlinkpayload.py +45 -0
- moovio_sdk/models/components/plaidpayload.py +42 -0
- moovio_sdk/models/components/primaryregulator.py +13 -0
- moovio_sdk/models/components/profile.py +27 -0
- moovio_sdk/models/components/pullfromcardpaymentmethod.py +33 -0
- moovio_sdk/models/components/pushtocardpaymentmethod.py +33 -0
- moovio_sdk/models/components/qrcode.py +16 -0
- moovio_sdk/models/components/receiptkind.py +10 -0
- moovio_sdk/models/components/receiptrequest.py +75 -0
- moovio_sdk/models/components/receiptresponse.py +95 -0
- moovio_sdk/models/components/recur.py +40 -0
- moovio_sdk/models/components/refundcarddetails.py +44 -0
- moovio_sdk/models/components/refundcardstatus.py +12 -0
- moovio_sdk/models/components/refundstatus.py +11 -0
- moovio_sdk/models/components/registerapplepaymerchantdomains.py +22 -0
- moovio_sdk/models/components/representative.py +71 -0
- moovio_sdk/models/components/representativeresponsibilities.py +42 -0
- moovio_sdk/models/components/representativeresponsibilitieserror.py +26 -0
- moovio_sdk/models/components/requestcard.py +44 -0
- moovio_sdk/models/components/requirementerror.py +24 -0
- moovio_sdk/models/components/requirementerrorcode.py +25 -0
- moovio_sdk/models/components/requirementid.py +71 -0
- moovio_sdk/models/components/returnpolicytype.py +11 -0
- moovio_sdk/models/components/reversal.py +23 -0
- moovio_sdk/models/components/reversedwithcancellation.py +14 -0
- moovio_sdk/models/components/reversedwithrefund.py +16 -0
- moovio_sdk/models/components/revoketokenrequest.py +40 -0
- moovio_sdk/models/components/rtpcreditpaymentmethod.py +38 -0
- moovio_sdk/models/components/rtpfailurecode.py +19 -0
- moovio_sdk/models/components/rtprejectioncode.py +25 -0
- moovio_sdk/models/components/rtptransactiondetails.py +56 -0
- moovio_sdk/models/components/rtptransactionstatus.py +13 -0
- moovio_sdk/models/components/runtransfer.py +34 -0
- moovio_sdk/models/components/schedulepaymentmethod.py +56 -0
- moovio_sdk/models/components/scheduleresponse.py +60 -0
- moovio_sdk/models/components/seccode.py +13 -0
- moovio_sdk/models/components/security.py +32 -0
- moovio_sdk/models/components/sentreceipt.py +27 -0
- moovio_sdk/models/components/settings.py +30 -0
- moovio_sdk/models/components/sourcedestinationoptions.py +20 -0
- moovio_sdk/models/components/sweep.py +80 -0
- moovio_sdk/models/components/sweepconfig.py +81 -0
- moovio_sdk/models/components/sweepconfigpaymentmethod.py +31 -0
- moovio_sdk/models/components/sweepconfigstatus.py +9 -0
- moovio_sdk/models/components/sweepstatus.py +13 -0
- moovio_sdk/models/components/taxid.py +25 -0
- moovio_sdk/models/components/taxidupdate.py +26 -0
- moovio_sdk/models/components/terminalapplication.py +55 -0
- moovio_sdk/models/components/terminalapplicationplatform.py +12 -0
- moovio_sdk/models/components/terminalapplicationstatus.py +13 -0
- moovio_sdk/models/components/termsofservice.py +26 -0
- moovio_sdk/models/components/termsofserviceerror.py +39 -0
- moovio_sdk/models/components/termsofservicetoken.py +17 -0
- moovio_sdk/models/components/termsofservicetokenupdate.py +18 -0
- moovio_sdk/models/components/tokentype.py +10 -0
- moovio_sdk/models/components/transactionsource.py +16 -0
- moovio_sdk/models/components/transfer.py +126 -0
- moovio_sdk/models/components/transferaccount.py +20 -0
- moovio_sdk/models/components/transferdestination.py +83 -0
- moovio_sdk/models/components/transferfailurereason.py +14 -0
- moovio_sdk/models/components/transferoptions.py +23 -0
- moovio_sdk/models/components/transferresponse.py +15 -0
- moovio_sdk/models/components/transfersource.py +80 -0
- moovio_sdk/models/components/transferstatus.py +16 -0
- moovio_sdk/models/components/transferwaitfor.py +8 -0
- moovio_sdk/models/components/underwriting.py +56 -0
- moovio_sdk/models/components/underwritingstatus.py +16 -0
- moovio_sdk/models/components/updateapplepaymerchantdomains.py +26 -0
- moovio_sdk/models/components/updatebrand.py +15 -0
- moovio_sdk/models/components/updatecard.py +51 -0
- moovio_sdk/models/components/updatecardaddress.py +32 -0
- moovio_sdk/models/components/updatecardexpiration.py +17 -0
- moovio_sdk/models/components/updatecolor.py +14 -0
- moovio_sdk/models/components/updatecolors.py +18 -0
- moovio_sdk/models/components/updateevidence.py +23 -0
- moovio_sdk/models/components/updateissuedcard.py +44 -0
- moovio_sdk/models/components/updatepaymentlink.py +98 -0
- moovio_sdk/models/components/updaterepresentative.py +224 -0
- moovio_sdk/models/components/updateunderwriting.py +43 -0
- moovio_sdk/models/components/upsertschedule.py +26 -0
- moovio_sdk/models/components/verification.py +54 -0
- moovio_sdk/models/components/verificationstatus.py +17 -0
- moovio_sdk/models/components/verificationstatusdetail.py +23 -0
- moovio_sdk/models/components/volumebycustomertype.py +21 -0
- moovio_sdk/models/components/volumebycustomertypeerror.py +22 -0
- moovio_sdk/models/components/wallet.py +27 -0
- moovio_sdk/models/components/walletavailablebalance.py +30 -0
- moovio_sdk/models/components/wallettransaction.py +114 -0
- moovio_sdk/models/components/wallettransactionsourcetype.py +13 -0
- moovio_sdk/models/components/wallettransactionstatus.py +11 -0
- moovio_sdk/models/components/wallettransactiontype.py +32 -0
- moovio_sdk/models/errors/__init__.py +155 -0
- moovio_sdk/models/errors/addcapabilitieserror.py +23 -0
- moovio_sdk/models/errors/apierror.py +22 -0
- moovio_sdk/models/errors/assigncountrieserror.py +20 -0
- moovio_sdk/models/errors/authtokenrequesterror.py +22 -0
- moovio_sdk/models/errors/bankaccountvalidationerror.py +30 -0
- moovio_sdk/models/errors/brandvalidationerror.py +23 -0
- moovio_sdk/models/errors/cardacquiringrefund.py +44 -0
- moovio_sdk/models/errors/createaccount.py +24 -0
- moovio_sdk/models/errors/createpaymentlinkerror.py +46 -0
- moovio_sdk/models/errors/createsweepconfigerror.py +40 -0
- moovio_sdk/models/errors/feeplanagreementerror.py +22 -0
- moovio_sdk/models/errors/fileuploadvalidationerror.py +35 -0
- moovio_sdk/models/errors/filevalidationerror.py +28 -0
- moovio_sdk/models/errors/genericerror.py +19 -0
- moovio_sdk/models/errors/linkapplepayerror.py +36 -0
- moovio_sdk/models/errors/linkcarderror.py +47 -0
- moovio_sdk/models/errors/microdepositvalidationerror.py +20 -0
- moovio_sdk/models/errors/onboardinginviteerror.py +34 -0
- moovio_sdk/models/errors/patchsweepconfigerror.py +38 -0
- moovio_sdk/models/errors/receiptvalidationerror.py +40 -0
- moovio_sdk/models/errors/refundvalidationerror.py +23 -0
- moovio_sdk/models/errors/representativevalidationerror.py +68 -0
- moovio_sdk/models/errors/requestcarderror.py +42 -0
- moovio_sdk/models/errors/reversalvalidationerror.py +20 -0
- moovio_sdk/models/errors/revoketokenrequesterror.py +22 -0
- moovio_sdk/models/errors/schedulevalidationerror.py +24 -0
- moovio_sdk/models/errors/terminalapplicationerror.py +30 -0
- moovio_sdk/models/errors/transfer.py +108 -0
- moovio_sdk/models/errors/transferoptionsvalidationerror.py +24 -0
- moovio_sdk/models/errors/transfervalidationerror.py +49 -0
- moovio_sdk/models/errors/updateaccount.py +24 -0
- moovio_sdk/models/errors/updatecarderror.py +43 -0
- moovio_sdk/models/errors/updateissuedcarderror.py +32 -0
- moovio_sdk/models/errors/updatepaymentlinkerror.py +36 -0
- moovio_sdk/models/errors/updateunderwritingerror.py +70 -0
- moovio_sdk/models/internal/__init__.py +6 -0
- moovio_sdk/models/internal/globals.py +40 -0
- moovio_sdk/models/operations/__init__.py +1824 -0
- moovio_sdk/models/operations/acceptdispute.py +71 -0
- moovio_sdk/models/operations/assignaccountcountries.py +75 -0
- moovio_sdk/models/operations/cancelschedule.py +67 -0
- moovio_sdk/models/operations/completebankaccountverification.py +85 -0
- moovio_sdk/models/operations/completemicrodeposits.py +87 -0
- moovio_sdk/models/operations/createaccesstoken.py +52 -0
- moovio_sdk/models/operations/createaccount.py +52 -0
- moovio_sdk/models/operations/createapplepaysession.py +81 -0
- moovio_sdk/models/operations/createbrand.py +75 -0
- moovio_sdk/models/operations/createcancellation.py +75 -0
- moovio_sdk/models/operations/createfeeplanagreements.py +80 -0
- moovio_sdk/models/operations/createonboardinginvite.py +52 -0
- moovio_sdk/models/operations/createpaymentlink.py +78 -0
- moovio_sdk/models/operations/createreceipts.py +52 -0
- moovio_sdk/models/operations/createrepresentative.py +80 -0
- moovio_sdk/models/operations/createreversal.py +98 -0
- moovio_sdk/models/operations/createschedule.py +78 -0
- moovio_sdk/models/operations/createsweepconfig.py +78 -0
- moovio_sdk/models/operations/createterminalapplication.py +54 -0
- moovio_sdk/models/operations/createtransfer.py +125 -0
- moovio_sdk/models/operations/createtransferoptions.py +52 -0
- moovio_sdk/models/operations/deletedisputeevidencefile.py +74 -0
- moovio_sdk/models/operations/deleterepresentative.py +71 -0
- moovio_sdk/models/operations/deleteterminalapplication.py +60 -0
- moovio_sdk/models/operations/disablebankaccount.py +67 -0
- moovio_sdk/models/operations/disablecapability.py +76 -0
- moovio_sdk/models/operations/disablecard.py +67 -0
- moovio_sdk/models/operations/disablepaymentlink.py +67 -0
- moovio_sdk/models/operations/disconnectaccount.py +60 -0
- moovio_sdk/models/operations/generateendtoendkey.py +60 -0
- moovio_sdk/models/operations/getaccount.py +64 -0
- moovio_sdk/models/operations/getaccountcountries.py +64 -0
- moovio_sdk/models/operations/getadjustment.py +71 -0
- moovio_sdk/models/operations/getapplepaymerchantdomains.py +68 -0
- moovio_sdk/models/operations/getavatar.py +66 -0
- moovio_sdk/models/operations/getbankaccount.py +71 -0
- moovio_sdk/models/operations/getbankaccountverification.py +73 -0
- moovio_sdk/models/operations/getbrand.py +64 -0
- moovio_sdk/models/operations/getcancellation.py +84 -0
- moovio_sdk/models/operations/getcapability.py +82 -0
- moovio_sdk/models/operations/getcard.py +71 -0
- moovio_sdk/models/operations/getdispute.py +71 -0
- moovio_sdk/models/operations/getdisputeevidence.py +80 -0
- moovio_sdk/models/operations/getdisputeevidencedata.py +90 -0
- moovio_sdk/models/operations/getenrichmentaddress.py +178 -0
- moovio_sdk/models/operations/getenrichmentprofile.py +64 -0
- moovio_sdk/models/operations/getfiledetails.py +71 -0
- moovio_sdk/models/operations/getfullissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcard.py +73 -0
- moovio_sdk/models/operations/getissuedcardauthorization.py +75 -0
- moovio_sdk/models/operations/getissuedcardtransaction.py +75 -0
- moovio_sdk/models/operations/getmerchantprocessingagreement.py +64 -0
- moovio_sdk/models/operations/getonboardinginvite.py +62 -0
- moovio_sdk/models/operations/getpaymentlink.py +71 -0
- moovio_sdk/models/operations/getpaymentlinkqrcode.py +84 -0
- moovio_sdk/models/operations/getpaymentmethod.py +71 -0
- moovio_sdk/models/operations/getrefund.py +84 -0
- moovio_sdk/models/operations/getrepresentative.py +75 -0
- moovio_sdk/models/operations/getscheduledoccurrence.py +92 -0
- moovio_sdk/models/operations/getschedules.py +71 -0
- moovio_sdk/models/operations/getsweep.py +78 -0
- moovio_sdk/models/operations/getsweepconfig.py +71 -0
- moovio_sdk/models/operations/getterminalapplication.py +66 -0
- moovio_sdk/models/operations/gettermsofservicetoken.py +75 -0
- moovio_sdk/models/operations/gettransfer.py +73 -0
- moovio_sdk/models/operations/getunderwriting.py +64 -0
- moovio_sdk/models/operations/getwallet.py +71 -0
- moovio_sdk/models/operations/getwallettransaction.py +80 -0
- moovio_sdk/models/operations/initiatebankaccountverification.py +89 -0
- moovio_sdk/models/operations/initiatemicrodeposits.py +67 -0
- moovio_sdk/models/operations/initiaterefund.py +131 -0
- moovio_sdk/models/operations/linkapplepaytoken.py +80 -0
- moovio_sdk/models/operations/linkbankaccount.py +96 -0
- moovio_sdk/models/operations/linkcard.py +96 -0
- moovio_sdk/models/operations/listaccounts.py +171 -0
- moovio_sdk/models/operations/listadjustments.py +78 -0
- moovio_sdk/models/operations/listbankaccounts.py +64 -0
- moovio_sdk/models/operations/listcapabilities.py +64 -0
- moovio_sdk/models/operations/listcards.py +64 -0
- moovio_sdk/models/operations/listdisputeevidence.py +73 -0
- moovio_sdk/models/operations/listdisputes.py +172 -0
- moovio_sdk/models/operations/listfeeplanagreements.py +101 -0
- moovio_sdk/models/operations/listfeeplans.py +78 -0
- moovio_sdk/models/operations/listfeesfetch.py +80 -0
- moovio_sdk/models/operations/listfiles.py +64 -0
- moovio_sdk/models/operations/listindustries.py +62 -0
- moovio_sdk/models/operations/listinstitutions.py +92 -0
- moovio_sdk/models/operations/listissuedcardauthorizationevents.py +94 -0
- moovio_sdk/models/operations/listissuedcardauthorizations.py +126 -0
- moovio_sdk/models/operations/listissuedcards.py +94 -0
- moovio_sdk/models/operations/listissuedcardtransactions.py +113 -0
- moovio_sdk/models/operations/listonboardinginvites.py +60 -0
- moovio_sdk/models/operations/listpartnerpricing.py +78 -0
- moovio_sdk/models/operations/listpartnerpricingagreements.py +101 -0
- moovio_sdk/models/operations/listpaymentlinks.py +64 -0
- moovio_sdk/models/operations/listpaymentmethods.py +98 -0
- moovio_sdk/models/operations/listreceipts.py +65 -0
- moovio_sdk/models/operations/listrefunds.py +75 -0
- moovio_sdk/models/operations/listrepresentatives.py +66 -0
- moovio_sdk/models/operations/listschedules.py +81 -0
- moovio_sdk/models/operations/listsweepconfigs.py +64 -0
- moovio_sdk/models/operations/listsweeps.py +108 -0
- moovio_sdk/models/operations/listterminalapplications.py +62 -0
- moovio_sdk/models/operations/listtransfers.py +145 -0
- moovio_sdk/models/operations/listwallets.py +64 -0
- moovio_sdk/models/operations/listwallettransactions.py +189 -0
- moovio_sdk/models/operations/ping.py +56 -0
- moovio_sdk/models/operations/registerapplepaymerchantdomains.py +80 -0
- moovio_sdk/models/operations/requestcapabilities.py +78 -0
- moovio_sdk/models/operations/requestcard.py +80 -0
- moovio_sdk/models/operations/retrievefees.py +117 -0
- moovio_sdk/models/operations/revokeaccesstoken.py +48 -0
- moovio_sdk/models/operations/revokeonboardinginvite.py +58 -0
- moovio_sdk/models/operations/submitdisputeevidence.py +71 -0
- moovio_sdk/models/operations/testendtoendtoken.py +56 -0
- moovio_sdk/models/operations/updateaccount.py +78 -0
- moovio_sdk/models/operations/updateapplepaymerchantdomains.py +78 -0
- moovio_sdk/models/operations/updatebrand.py +78 -0
- moovio_sdk/models/operations/updatecard.py +85 -0
- moovio_sdk/models/operations/updatedisputeevidence.py +92 -0
- moovio_sdk/models/operations/updateissuedcard.py +81 -0
- moovio_sdk/models/operations/updatepaymentlink.py +85 -0
- moovio_sdk/models/operations/updaterepresentative.py +89 -0
- moovio_sdk/models/operations/updateschedule.py +85 -0
- moovio_sdk/models/operations/updatesweepconfig.py +85 -0
- moovio_sdk/models/operations/updatetransfer.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencefile.py +87 -0
- moovio_sdk/models/operations/uploaddisputeevidencetext.py +85 -0
- moovio_sdk/models/operations/uploadfile.py +80 -0
- moovio_sdk/models/operations/upsertbrand.py +75 -0
- moovio_sdk/models/operations/upsertunderwriting.py +78 -0
- moovio_sdk/onboarding.py +965 -0
- moovio_sdk/payment_links.py +1694 -0
- moovio_sdk/payment_methods.py +475 -0
- moovio_sdk/ping.py +233 -0
- moovio_sdk/py.typed +1 -0
- moovio_sdk/receipts.py +507 -0
- moovio_sdk/representatives.py +1513 -0
- moovio_sdk/scheduling.py +1565 -0
- moovio_sdk/sdk.py +242 -0
- moovio_sdk/sdkconfiguration.py +59 -0
- moovio_sdk/sweeps.py +1617 -0
- moovio_sdk/terminal_applications.py +1013 -0
- moovio_sdk/transfers.py +3040 -0
- moovio_sdk/types/__init__.py +21 -0
- moovio_sdk/types/basemodel.py +39 -0
- moovio_sdk/underwriting.py +581 -0
- moovio_sdk/utils/__init__.py +101 -0
- moovio_sdk/utils/annotations.py +55 -0
- moovio_sdk/utils/enums.py +34 -0
- moovio_sdk/utils/eventstreaming.py +238 -0
- moovio_sdk/utils/forms.py +202 -0
- moovio_sdk/utils/headers.py +136 -0
- moovio_sdk/utils/logger.py +27 -0
- moovio_sdk/utils/metadata.py +118 -0
- moovio_sdk/utils/queryparams.py +205 -0
- moovio_sdk/utils/requestbodies.py +66 -0
- moovio_sdk/utils/retries.py +217 -0
- moovio_sdk/utils/security.py +195 -0
- moovio_sdk/utils/serializers.py +215 -0
- moovio_sdk/utils/url.py +155 -0
- moovio_sdk/utils/values.py +137 -0
- moovio_sdk/wallet_transactions.py +558 -0
- moovio_sdk/wallets.py +465 -0
- moovio_sdk-0.3.8.dist-info/METADATA +1920 -0
- moovio_sdk-0.3.8.dist-info/RECORD +586 -0
- moovio_sdk-0.3.8.dist-info/WHEEL +4 -0
@@ -0,0 +1,1513 @@
|
|
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, List, Mapping, Optional, Union
|
10
|
+
|
11
|
+
|
12
|
+
class Representatives(BaseSDK):
|
13
|
+
def create(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
account_id: str,
|
17
|
+
name: Union[components.IndividualName, components.IndividualNameTypedDict],
|
18
|
+
phone: Optional[
|
19
|
+
Union[components.PhoneNumber, components.PhoneNumberTypedDict]
|
20
|
+
] = None,
|
21
|
+
email: Optional[str] = None,
|
22
|
+
address: Optional[
|
23
|
+
Union[components.Address, components.AddressTypedDict]
|
24
|
+
] = None,
|
25
|
+
birth_date: Optional[
|
26
|
+
Union[components.BirthDate, components.BirthDateTypedDict]
|
27
|
+
] = None,
|
28
|
+
government_id: Optional[
|
29
|
+
Union[components.GovernmentID, components.GovernmentIDTypedDict]
|
30
|
+
] = None,
|
31
|
+
responsibilities: Optional[
|
32
|
+
Union[
|
33
|
+
components.RepresentativeResponsibilities,
|
34
|
+
components.RepresentativeResponsibilitiesTypedDict,
|
35
|
+
]
|
36
|
+
] = None,
|
37
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
38
|
+
server_url: Optional[str] = None,
|
39
|
+
timeout_ms: Optional[int] = None,
|
40
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
41
|
+
) -> operations.CreateRepresentativeResponse:
|
42
|
+
r"""Moov accounts associated with businesses require information regarding individuals who represent the business.
|
43
|
+
You can provide this information by creating a representative. Each account is allowed a maximum of 7 representatives.
|
44
|
+
Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
45
|
+
|
46
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
47
|
+
you'll need to specify the `/accounts/{accountID}/representatives.write` scope.
|
48
|
+
|
49
|
+
:param account_id: ID of the account.
|
50
|
+
:param name:
|
51
|
+
:param phone:
|
52
|
+
:param email:
|
53
|
+
:param address:
|
54
|
+
:param birth_date:
|
55
|
+
:param government_id:
|
56
|
+
:param responsibilities: Describes the job responsibilities of a business representative.
|
57
|
+
:param retries: Override the default retry configuration for this method
|
58
|
+
:param server_url: Override the default server URL for this method
|
59
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
60
|
+
:param http_headers: Additional headers to set or replace on requests.
|
61
|
+
"""
|
62
|
+
base_url = None
|
63
|
+
url_variables = None
|
64
|
+
if timeout_ms is None:
|
65
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
66
|
+
|
67
|
+
if server_url is not None:
|
68
|
+
base_url = server_url
|
69
|
+
else:
|
70
|
+
base_url = self._get_url(base_url, url_variables)
|
71
|
+
|
72
|
+
request = operations.CreateRepresentativeRequest(
|
73
|
+
account_id=account_id,
|
74
|
+
create_representative=components.CreateRepresentative(
|
75
|
+
name=utils.get_pydantic_model(name, components.IndividualName),
|
76
|
+
phone=utils.get_pydantic_model(phone, Optional[components.PhoneNumber]),
|
77
|
+
email=email,
|
78
|
+
address=utils.get_pydantic_model(address, Optional[components.Address]),
|
79
|
+
birth_date=utils.get_pydantic_model(
|
80
|
+
birth_date, Optional[components.BirthDate]
|
81
|
+
),
|
82
|
+
government_id=utils.get_pydantic_model(
|
83
|
+
government_id, Optional[components.GovernmentID]
|
84
|
+
),
|
85
|
+
responsibilities=utils.get_pydantic_model(
|
86
|
+
responsibilities,
|
87
|
+
Optional[components.RepresentativeResponsibilities],
|
88
|
+
),
|
89
|
+
),
|
90
|
+
)
|
91
|
+
|
92
|
+
req = self._build_request(
|
93
|
+
method="POST",
|
94
|
+
path="/accounts/{accountID}/representatives",
|
95
|
+
base_url=base_url,
|
96
|
+
url_variables=url_variables,
|
97
|
+
request=request,
|
98
|
+
request_body_required=True,
|
99
|
+
request_has_path_params=True,
|
100
|
+
request_has_query_params=True,
|
101
|
+
user_agent_header="user-agent",
|
102
|
+
accept_header_value="application/json",
|
103
|
+
http_headers=http_headers,
|
104
|
+
_globals=operations.CreateRepresentativeGlobals(
|
105
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
106
|
+
),
|
107
|
+
security=self.sdk_configuration.security,
|
108
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
109
|
+
request.create_representative,
|
110
|
+
False,
|
111
|
+
False,
|
112
|
+
"json",
|
113
|
+
components.CreateRepresentative,
|
114
|
+
),
|
115
|
+
timeout_ms=timeout_ms,
|
116
|
+
)
|
117
|
+
|
118
|
+
if retries == UNSET:
|
119
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
120
|
+
retries = self.sdk_configuration.retry_config
|
121
|
+
|
122
|
+
retry_config = None
|
123
|
+
if isinstance(retries, utils.RetryConfig):
|
124
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
125
|
+
|
126
|
+
http_res = self.do_request(
|
127
|
+
hook_ctx=HookContext(
|
128
|
+
base_url=base_url or "",
|
129
|
+
operation_id="createRepresentative",
|
130
|
+
oauth2_scopes=[],
|
131
|
+
security_source=get_security_from_env(
|
132
|
+
self.sdk_configuration.security, components.Security
|
133
|
+
),
|
134
|
+
),
|
135
|
+
request=req,
|
136
|
+
error_status_codes=[
|
137
|
+
"400",
|
138
|
+
"401",
|
139
|
+
"403",
|
140
|
+
"404",
|
141
|
+
"409",
|
142
|
+
"422",
|
143
|
+
"429",
|
144
|
+
"4XX",
|
145
|
+
"500",
|
146
|
+
"504",
|
147
|
+
"5XX",
|
148
|
+
],
|
149
|
+
retry_config=retry_config,
|
150
|
+
)
|
151
|
+
|
152
|
+
response_data: Any = None
|
153
|
+
if utils.match_response(http_res, "200", "application/json"):
|
154
|
+
return operations.CreateRepresentativeResponse(
|
155
|
+
result=utils.unmarshal_json(http_res.text, components.Representative),
|
156
|
+
headers=utils.get_response_headers(http_res.headers),
|
157
|
+
)
|
158
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
159
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
160
|
+
raise errors.GenericError(data=response_data)
|
161
|
+
if utils.match_response(http_res, "422", "application/json"):
|
162
|
+
response_data = utils.unmarshal_json(
|
163
|
+
http_res.text, errors.RepresentativeValidationErrorData
|
164
|
+
)
|
165
|
+
raise errors.RepresentativeValidationError(data=response_data)
|
166
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
167
|
+
http_res_text = utils.stream_to_text(http_res)
|
168
|
+
raise errors.APIError(
|
169
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
170
|
+
)
|
171
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
172
|
+
http_res_text = utils.stream_to_text(http_res)
|
173
|
+
raise errors.APIError(
|
174
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
175
|
+
)
|
176
|
+
if utils.match_response(http_res, "4XX", "*"):
|
177
|
+
http_res_text = utils.stream_to_text(http_res)
|
178
|
+
raise errors.APIError(
|
179
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
180
|
+
)
|
181
|
+
if utils.match_response(http_res, "5XX", "*"):
|
182
|
+
http_res_text = utils.stream_to_text(http_res)
|
183
|
+
raise errors.APIError(
|
184
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
185
|
+
)
|
186
|
+
|
187
|
+
content_type = http_res.headers.get("Content-Type")
|
188
|
+
http_res_text = utils.stream_to_text(http_res)
|
189
|
+
raise errors.APIError(
|
190
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
191
|
+
http_res.status_code,
|
192
|
+
http_res_text,
|
193
|
+
http_res,
|
194
|
+
)
|
195
|
+
|
196
|
+
async def create_async(
|
197
|
+
self,
|
198
|
+
*,
|
199
|
+
account_id: str,
|
200
|
+
name: Union[components.IndividualName, components.IndividualNameTypedDict],
|
201
|
+
phone: Optional[
|
202
|
+
Union[components.PhoneNumber, components.PhoneNumberTypedDict]
|
203
|
+
] = None,
|
204
|
+
email: Optional[str] = None,
|
205
|
+
address: Optional[
|
206
|
+
Union[components.Address, components.AddressTypedDict]
|
207
|
+
] = None,
|
208
|
+
birth_date: Optional[
|
209
|
+
Union[components.BirthDate, components.BirthDateTypedDict]
|
210
|
+
] = None,
|
211
|
+
government_id: Optional[
|
212
|
+
Union[components.GovernmentID, components.GovernmentIDTypedDict]
|
213
|
+
] = None,
|
214
|
+
responsibilities: Optional[
|
215
|
+
Union[
|
216
|
+
components.RepresentativeResponsibilities,
|
217
|
+
components.RepresentativeResponsibilitiesTypedDict,
|
218
|
+
]
|
219
|
+
] = None,
|
220
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
221
|
+
server_url: Optional[str] = None,
|
222
|
+
timeout_ms: Optional[int] = None,
|
223
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
224
|
+
) -> operations.CreateRepresentativeResponse:
|
225
|
+
r"""Moov accounts associated with businesses require information regarding individuals who represent the business.
|
226
|
+
You can provide this information by creating a representative. Each account is allowed a maximum of 7 representatives.
|
227
|
+
Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
228
|
+
|
229
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
230
|
+
you'll need to specify the `/accounts/{accountID}/representatives.write` scope.
|
231
|
+
|
232
|
+
:param account_id: ID of the account.
|
233
|
+
:param name:
|
234
|
+
:param phone:
|
235
|
+
:param email:
|
236
|
+
:param address:
|
237
|
+
:param birth_date:
|
238
|
+
:param government_id:
|
239
|
+
:param responsibilities: Describes the job responsibilities of a business representative.
|
240
|
+
:param retries: Override the default retry configuration for this method
|
241
|
+
:param server_url: Override the default server URL for this method
|
242
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
243
|
+
:param http_headers: Additional headers to set or replace on requests.
|
244
|
+
"""
|
245
|
+
base_url = None
|
246
|
+
url_variables = None
|
247
|
+
if timeout_ms is None:
|
248
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
249
|
+
|
250
|
+
if server_url is not None:
|
251
|
+
base_url = server_url
|
252
|
+
else:
|
253
|
+
base_url = self._get_url(base_url, url_variables)
|
254
|
+
|
255
|
+
request = operations.CreateRepresentativeRequest(
|
256
|
+
account_id=account_id,
|
257
|
+
create_representative=components.CreateRepresentative(
|
258
|
+
name=utils.get_pydantic_model(name, components.IndividualName),
|
259
|
+
phone=utils.get_pydantic_model(phone, Optional[components.PhoneNumber]),
|
260
|
+
email=email,
|
261
|
+
address=utils.get_pydantic_model(address, Optional[components.Address]),
|
262
|
+
birth_date=utils.get_pydantic_model(
|
263
|
+
birth_date, Optional[components.BirthDate]
|
264
|
+
),
|
265
|
+
government_id=utils.get_pydantic_model(
|
266
|
+
government_id, Optional[components.GovernmentID]
|
267
|
+
),
|
268
|
+
responsibilities=utils.get_pydantic_model(
|
269
|
+
responsibilities,
|
270
|
+
Optional[components.RepresentativeResponsibilities],
|
271
|
+
),
|
272
|
+
),
|
273
|
+
)
|
274
|
+
|
275
|
+
req = self._build_request_async(
|
276
|
+
method="POST",
|
277
|
+
path="/accounts/{accountID}/representatives",
|
278
|
+
base_url=base_url,
|
279
|
+
url_variables=url_variables,
|
280
|
+
request=request,
|
281
|
+
request_body_required=True,
|
282
|
+
request_has_path_params=True,
|
283
|
+
request_has_query_params=True,
|
284
|
+
user_agent_header="user-agent",
|
285
|
+
accept_header_value="application/json",
|
286
|
+
http_headers=http_headers,
|
287
|
+
_globals=operations.CreateRepresentativeGlobals(
|
288
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
289
|
+
),
|
290
|
+
security=self.sdk_configuration.security,
|
291
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
292
|
+
request.create_representative,
|
293
|
+
False,
|
294
|
+
False,
|
295
|
+
"json",
|
296
|
+
components.CreateRepresentative,
|
297
|
+
),
|
298
|
+
timeout_ms=timeout_ms,
|
299
|
+
)
|
300
|
+
|
301
|
+
if retries == UNSET:
|
302
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
303
|
+
retries = self.sdk_configuration.retry_config
|
304
|
+
|
305
|
+
retry_config = None
|
306
|
+
if isinstance(retries, utils.RetryConfig):
|
307
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
308
|
+
|
309
|
+
http_res = await self.do_request_async(
|
310
|
+
hook_ctx=HookContext(
|
311
|
+
base_url=base_url or "",
|
312
|
+
operation_id="createRepresentative",
|
313
|
+
oauth2_scopes=[],
|
314
|
+
security_source=get_security_from_env(
|
315
|
+
self.sdk_configuration.security, components.Security
|
316
|
+
),
|
317
|
+
),
|
318
|
+
request=req,
|
319
|
+
error_status_codes=[
|
320
|
+
"400",
|
321
|
+
"401",
|
322
|
+
"403",
|
323
|
+
"404",
|
324
|
+
"409",
|
325
|
+
"422",
|
326
|
+
"429",
|
327
|
+
"4XX",
|
328
|
+
"500",
|
329
|
+
"504",
|
330
|
+
"5XX",
|
331
|
+
],
|
332
|
+
retry_config=retry_config,
|
333
|
+
)
|
334
|
+
|
335
|
+
response_data: Any = None
|
336
|
+
if utils.match_response(http_res, "200", "application/json"):
|
337
|
+
return operations.CreateRepresentativeResponse(
|
338
|
+
result=utils.unmarshal_json(http_res.text, components.Representative),
|
339
|
+
headers=utils.get_response_headers(http_res.headers),
|
340
|
+
)
|
341
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
342
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
343
|
+
raise errors.GenericError(data=response_data)
|
344
|
+
if utils.match_response(http_res, "422", "application/json"):
|
345
|
+
response_data = utils.unmarshal_json(
|
346
|
+
http_res.text, errors.RepresentativeValidationErrorData
|
347
|
+
)
|
348
|
+
raise errors.RepresentativeValidationError(data=response_data)
|
349
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
350
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
351
|
+
raise errors.APIError(
|
352
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
353
|
+
)
|
354
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
355
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
356
|
+
raise errors.APIError(
|
357
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
358
|
+
)
|
359
|
+
if utils.match_response(http_res, "4XX", "*"):
|
360
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
361
|
+
raise errors.APIError(
|
362
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
363
|
+
)
|
364
|
+
if utils.match_response(http_res, "5XX", "*"):
|
365
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
366
|
+
raise errors.APIError(
|
367
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
368
|
+
)
|
369
|
+
|
370
|
+
content_type = http_res.headers.get("Content-Type")
|
371
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
372
|
+
raise errors.APIError(
|
373
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
374
|
+
http_res.status_code,
|
375
|
+
http_res_text,
|
376
|
+
http_res,
|
377
|
+
)
|
378
|
+
|
379
|
+
def list(
|
380
|
+
self,
|
381
|
+
*,
|
382
|
+
account_id: str,
|
383
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
384
|
+
server_url: Optional[str] = None,
|
385
|
+
timeout_ms: Optional[int] = None,
|
386
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
387
|
+
) -> operations.ListRepresentativesResponse:
|
388
|
+
r"""A Moov account may have multiple representatives depending on the associated business's ownership and management structure.
|
389
|
+
You can use this method to list all the representatives for a given Moov account.
|
390
|
+
Note that Moov accounts associated with an individual do not have representatives.
|
391
|
+
Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
392
|
+
|
393
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
394
|
+
you'll need to specify the `/accounts/{accountID}/representatives.read` scope.
|
395
|
+
|
396
|
+
:param account_id: ID of the account.
|
397
|
+
:param retries: Override the default retry configuration for this method
|
398
|
+
:param server_url: Override the default server URL for this method
|
399
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
400
|
+
:param http_headers: Additional headers to set or replace on requests.
|
401
|
+
"""
|
402
|
+
base_url = None
|
403
|
+
url_variables = None
|
404
|
+
if timeout_ms is None:
|
405
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
406
|
+
|
407
|
+
if server_url is not None:
|
408
|
+
base_url = server_url
|
409
|
+
else:
|
410
|
+
base_url = self._get_url(base_url, url_variables)
|
411
|
+
|
412
|
+
request = operations.ListRepresentativesRequest(
|
413
|
+
account_id=account_id,
|
414
|
+
)
|
415
|
+
|
416
|
+
req = self._build_request(
|
417
|
+
method="GET",
|
418
|
+
path="/accounts/{accountID}/representatives",
|
419
|
+
base_url=base_url,
|
420
|
+
url_variables=url_variables,
|
421
|
+
request=request,
|
422
|
+
request_body_required=False,
|
423
|
+
request_has_path_params=True,
|
424
|
+
request_has_query_params=True,
|
425
|
+
user_agent_header="user-agent",
|
426
|
+
accept_header_value="application/json",
|
427
|
+
http_headers=http_headers,
|
428
|
+
_globals=operations.ListRepresentativesGlobals(
|
429
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
430
|
+
),
|
431
|
+
security=self.sdk_configuration.security,
|
432
|
+
timeout_ms=timeout_ms,
|
433
|
+
)
|
434
|
+
|
435
|
+
if retries == UNSET:
|
436
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
437
|
+
retries = self.sdk_configuration.retry_config
|
438
|
+
|
439
|
+
retry_config = None
|
440
|
+
if isinstance(retries, utils.RetryConfig):
|
441
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
442
|
+
|
443
|
+
http_res = self.do_request(
|
444
|
+
hook_ctx=HookContext(
|
445
|
+
base_url=base_url or "",
|
446
|
+
operation_id="listRepresentatives",
|
447
|
+
oauth2_scopes=[],
|
448
|
+
security_source=get_security_from_env(
|
449
|
+
self.sdk_configuration.security, components.Security
|
450
|
+
),
|
451
|
+
),
|
452
|
+
request=req,
|
453
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
454
|
+
retry_config=retry_config,
|
455
|
+
)
|
456
|
+
|
457
|
+
if utils.match_response(http_res, "200", "application/json"):
|
458
|
+
return operations.ListRepresentativesResponse(
|
459
|
+
result=utils.unmarshal_json(
|
460
|
+
http_res.text, List[components.Representative]
|
461
|
+
),
|
462
|
+
headers=utils.get_response_headers(http_res.headers),
|
463
|
+
)
|
464
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
465
|
+
http_res_text = utils.stream_to_text(http_res)
|
466
|
+
raise errors.APIError(
|
467
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
468
|
+
)
|
469
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
470
|
+
http_res_text = utils.stream_to_text(http_res)
|
471
|
+
raise errors.APIError(
|
472
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
473
|
+
)
|
474
|
+
if utils.match_response(http_res, "4XX", "*"):
|
475
|
+
http_res_text = utils.stream_to_text(http_res)
|
476
|
+
raise errors.APIError(
|
477
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
478
|
+
)
|
479
|
+
if utils.match_response(http_res, "5XX", "*"):
|
480
|
+
http_res_text = utils.stream_to_text(http_res)
|
481
|
+
raise errors.APIError(
|
482
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
483
|
+
)
|
484
|
+
|
485
|
+
content_type = http_res.headers.get("Content-Type")
|
486
|
+
http_res_text = utils.stream_to_text(http_res)
|
487
|
+
raise errors.APIError(
|
488
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
489
|
+
http_res.status_code,
|
490
|
+
http_res_text,
|
491
|
+
http_res,
|
492
|
+
)
|
493
|
+
|
494
|
+
async def list_async(
|
495
|
+
self,
|
496
|
+
*,
|
497
|
+
account_id: str,
|
498
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
499
|
+
server_url: Optional[str] = None,
|
500
|
+
timeout_ms: Optional[int] = None,
|
501
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
502
|
+
) -> operations.ListRepresentativesResponse:
|
503
|
+
r"""A Moov account may have multiple representatives depending on the associated business's ownership and management structure.
|
504
|
+
You can use this method to list all the representatives for a given Moov account.
|
505
|
+
Note that Moov accounts associated with an individual do not have representatives.
|
506
|
+
Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
507
|
+
|
508
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
509
|
+
you'll need to specify the `/accounts/{accountID}/representatives.read` scope.
|
510
|
+
|
511
|
+
:param account_id: ID of the account.
|
512
|
+
:param retries: Override the default retry configuration for this method
|
513
|
+
:param server_url: Override the default server URL for this method
|
514
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
515
|
+
:param http_headers: Additional headers to set or replace on requests.
|
516
|
+
"""
|
517
|
+
base_url = None
|
518
|
+
url_variables = None
|
519
|
+
if timeout_ms is None:
|
520
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
521
|
+
|
522
|
+
if server_url is not None:
|
523
|
+
base_url = server_url
|
524
|
+
else:
|
525
|
+
base_url = self._get_url(base_url, url_variables)
|
526
|
+
|
527
|
+
request = operations.ListRepresentativesRequest(
|
528
|
+
account_id=account_id,
|
529
|
+
)
|
530
|
+
|
531
|
+
req = self._build_request_async(
|
532
|
+
method="GET",
|
533
|
+
path="/accounts/{accountID}/representatives",
|
534
|
+
base_url=base_url,
|
535
|
+
url_variables=url_variables,
|
536
|
+
request=request,
|
537
|
+
request_body_required=False,
|
538
|
+
request_has_path_params=True,
|
539
|
+
request_has_query_params=True,
|
540
|
+
user_agent_header="user-agent",
|
541
|
+
accept_header_value="application/json",
|
542
|
+
http_headers=http_headers,
|
543
|
+
_globals=operations.ListRepresentativesGlobals(
|
544
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
545
|
+
),
|
546
|
+
security=self.sdk_configuration.security,
|
547
|
+
timeout_ms=timeout_ms,
|
548
|
+
)
|
549
|
+
|
550
|
+
if retries == UNSET:
|
551
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
552
|
+
retries = self.sdk_configuration.retry_config
|
553
|
+
|
554
|
+
retry_config = None
|
555
|
+
if isinstance(retries, utils.RetryConfig):
|
556
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
557
|
+
|
558
|
+
http_res = await self.do_request_async(
|
559
|
+
hook_ctx=HookContext(
|
560
|
+
base_url=base_url or "",
|
561
|
+
operation_id="listRepresentatives",
|
562
|
+
oauth2_scopes=[],
|
563
|
+
security_source=get_security_from_env(
|
564
|
+
self.sdk_configuration.security, components.Security
|
565
|
+
),
|
566
|
+
),
|
567
|
+
request=req,
|
568
|
+
error_status_codes=["401", "403", "429", "4XX", "500", "504", "5XX"],
|
569
|
+
retry_config=retry_config,
|
570
|
+
)
|
571
|
+
|
572
|
+
if utils.match_response(http_res, "200", "application/json"):
|
573
|
+
return operations.ListRepresentativesResponse(
|
574
|
+
result=utils.unmarshal_json(
|
575
|
+
http_res.text, List[components.Representative]
|
576
|
+
),
|
577
|
+
headers=utils.get_response_headers(http_res.headers),
|
578
|
+
)
|
579
|
+
if utils.match_response(http_res, ["401", "403", "429"], "*"):
|
580
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
581
|
+
raise errors.APIError(
|
582
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
583
|
+
)
|
584
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
585
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
586
|
+
raise errors.APIError(
|
587
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
588
|
+
)
|
589
|
+
if utils.match_response(http_res, "4XX", "*"):
|
590
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
591
|
+
raise errors.APIError(
|
592
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
593
|
+
)
|
594
|
+
if utils.match_response(http_res, "5XX", "*"):
|
595
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
596
|
+
raise errors.APIError(
|
597
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
598
|
+
)
|
599
|
+
|
600
|
+
content_type = http_res.headers.get("Content-Type")
|
601
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
602
|
+
raise errors.APIError(
|
603
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
604
|
+
http_res.status_code,
|
605
|
+
http_res_text,
|
606
|
+
http_res,
|
607
|
+
)
|
608
|
+
|
609
|
+
def delete(
|
610
|
+
self,
|
611
|
+
*,
|
612
|
+
account_id: str,
|
613
|
+
representative_id: str,
|
614
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
615
|
+
server_url: Optional[str] = None,
|
616
|
+
timeout_ms: Optional[int] = None,
|
617
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
618
|
+
) -> operations.DeleteRepresentativeResponse:
|
619
|
+
r"""Deletes a business representative associated with a Moov account. Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
620
|
+
|
621
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
622
|
+
you'll need to specify the `/accounts/{accountID}/representatives.write` scope.
|
623
|
+
|
624
|
+
:param account_id: ID of the account.
|
625
|
+
:param representative_id: ID of the representative.
|
626
|
+
:param retries: Override the default retry configuration for this method
|
627
|
+
:param server_url: Override the default server URL for this method
|
628
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
629
|
+
:param http_headers: Additional headers to set or replace on requests.
|
630
|
+
"""
|
631
|
+
base_url = None
|
632
|
+
url_variables = None
|
633
|
+
if timeout_ms is None:
|
634
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
635
|
+
|
636
|
+
if server_url is not None:
|
637
|
+
base_url = server_url
|
638
|
+
else:
|
639
|
+
base_url = self._get_url(base_url, url_variables)
|
640
|
+
|
641
|
+
request = operations.DeleteRepresentativeRequest(
|
642
|
+
account_id=account_id,
|
643
|
+
representative_id=representative_id,
|
644
|
+
)
|
645
|
+
|
646
|
+
req = self._build_request(
|
647
|
+
method="DELETE",
|
648
|
+
path="/accounts/{accountID}/representatives/{representativeID}",
|
649
|
+
base_url=base_url,
|
650
|
+
url_variables=url_variables,
|
651
|
+
request=request,
|
652
|
+
request_body_required=False,
|
653
|
+
request_has_path_params=True,
|
654
|
+
request_has_query_params=True,
|
655
|
+
user_agent_header="user-agent",
|
656
|
+
accept_header_value="application/json",
|
657
|
+
http_headers=http_headers,
|
658
|
+
_globals=operations.DeleteRepresentativeGlobals(
|
659
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
660
|
+
),
|
661
|
+
security=self.sdk_configuration.security,
|
662
|
+
timeout_ms=timeout_ms,
|
663
|
+
)
|
664
|
+
|
665
|
+
if retries == UNSET:
|
666
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
667
|
+
retries = self.sdk_configuration.retry_config
|
668
|
+
|
669
|
+
retry_config = None
|
670
|
+
if isinstance(retries, utils.RetryConfig):
|
671
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
672
|
+
|
673
|
+
http_res = self.do_request(
|
674
|
+
hook_ctx=HookContext(
|
675
|
+
base_url=base_url or "",
|
676
|
+
operation_id="deleteRepresentative",
|
677
|
+
oauth2_scopes=[],
|
678
|
+
security_source=get_security_from_env(
|
679
|
+
self.sdk_configuration.security, components.Security
|
680
|
+
),
|
681
|
+
),
|
682
|
+
request=req,
|
683
|
+
error_status_codes=[
|
684
|
+
"400",
|
685
|
+
"401",
|
686
|
+
"403",
|
687
|
+
"404",
|
688
|
+
"409",
|
689
|
+
"429",
|
690
|
+
"4XX",
|
691
|
+
"500",
|
692
|
+
"504",
|
693
|
+
"5XX",
|
694
|
+
],
|
695
|
+
retry_config=retry_config,
|
696
|
+
)
|
697
|
+
|
698
|
+
response_data: Any = None
|
699
|
+
if utils.match_response(http_res, "204", "*"):
|
700
|
+
return operations.DeleteRepresentativeResponse(
|
701
|
+
headers=utils.get_response_headers(http_res.headers)
|
702
|
+
)
|
703
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
704
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
705
|
+
raise errors.GenericError(data=response_data)
|
706
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
707
|
+
http_res_text = utils.stream_to_text(http_res)
|
708
|
+
raise errors.APIError(
|
709
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
710
|
+
)
|
711
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
712
|
+
http_res_text = utils.stream_to_text(http_res)
|
713
|
+
raise errors.APIError(
|
714
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
715
|
+
)
|
716
|
+
if utils.match_response(http_res, "4XX", "*"):
|
717
|
+
http_res_text = utils.stream_to_text(http_res)
|
718
|
+
raise errors.APIError(
|
719
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
720
|
+
)
|
721
|
+
if utils.match_response(http_res, "5XX", "*"):
|
722
|
+
http_res_text = utils.stream_to_text(http_res)
|
723
|
+
raise errors.APIError(
|
724
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
725
|
+
)
|
726
|
+
|
727
|
+
content_type = http_res.headers.get("Content-Type")
|
728
|
+
http_res_text = utils.stream_to_text(http_res)
|
729
|
+
raise errors.APIError(
|
730
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
731
|
+
http_res.status_code,
|
732
|
+
http_res_text,
|
733
|
+
http_res,
|
734
|
+
)
|
735
|
+
|
736
|
+
async def delete_async(
|
737
|
+
self,
|
738
|
+
*,
|
739
|
+
account_id: str,
|
740
|
+
representative_id: str,
|
741
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
742
|
+
server_url: Optional[str] = None,
|
743
|
+
timeout_ms: Optional[int] = None,
|
744
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
745
|
+
) -> operations.DeleteRepresentativeResponse:
|
746
|
+
r"""Deletes a business representative associated with a Moov account. Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
747
|
+
|
748
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
749
|
+
you'll need to specify the `/accounts/{accountID}/representatives.write` scope.
|
750
|
+
|
751
|
+
:param account_id: ID of the account.
|
752
|
+
:param representative_id: ID of the representative.
|
753
|
+
:param retries: Override the default retry configuration for this method
|
754
|
+
:param server_url: Override the default server URL for this method
|
755
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
756
|
+
:param http_headers: Additional headers to set or replace on requests.
|
757
|
+
"""
|
758
|
+
base_url = None
|
759
|
+
url_variables = None
|
760
|
+
if timeout_ms is None:
|
761
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
762
|
+
|
763
|
+
if server_url is not None:
|
764
|
+
base_url = server_url
|
765
|
+
else:
|
766
|
+
base_url = self._get_url(base_url, url_variables)
|
767
|
+
|
768
|
+
request = operations.DeleteRepresentativeRequest(
|
769
|
+
account_id=account_id,
|
770
|
+
representative_id=representative_id,
|
771
|
+
)
|
772
|
+
|
773
|
+
req = self._build_request_async(
|
774
|
+
method="DELETE",
|
775
|
+
path="/accounts/{accountID}/representatives/{representativeID}",
|
776
|
+
base_url=base_url,
|
777
|
+
url_variables=url_variables,
|
778
|
+
request=request,
|
779
|
+
request_body_required=False,
|
780
|
+
request_has_path_params=True,
|
781
|
+
request_has_query_params=True,
|
782
|
+
user_agent_header="user-agent",
|
783
|
+
accept_header_value="application/json",
|
784
|
+
http_headers=http_headers,
|
785
|
+
_globals=operations.DeleteRepresentativeGlobals(
|
786
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
787
|
+
),
|
788
|
+
security=self.sdk_configuration.security,
|
789
|
+
timeout_ms=timeout_ms,
|
790
|
+
)
|
791
|
+
|
792
|
+
if retries == UNSET:
|
793
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
794
|
+
retries = self.sdk_configuration.retry_config
|
795
|
+
|
796
|
+
retry_config = None
|
797
|
+
if isinstance(retries, utils.RetryConfig):
|
798
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
799
|
+
|
800
|
+
http_res = await self.do_request_async(
|
801
|
+
hook_ctx=HookContext(
|
802
|
+
base_url=base_url or "",
|
803
|
+
operation_id="deleteRepresentative",
|
804
|
+
oauth2_scopes=[],
|
805
|
+
security_source=get_security_from_env(
|
806
|
+
self.sdk_configuration.security, components.Security
|
807
|
+
),
|
808
|
+
),
|
809
|
+
request=req,
|
810
|
+
error_status_codes=[
|
811
|
+
"400",
|
812
|
+
"401",
|
813
|
+
"403",
|
814
|
+
"404",
|
815
|
+
"409",
|
816
|
+
"429",
|
817
|
+
"4XX",
|
818
|
+
"500",
|
819
|
+
"504",
|
820
|
+
"5XX",
|
821
|
+
],
|
822
|
+
retry_config=retry_config,
|
823
|
+
)
|
824
|
+
|
825
|
+
response_data: Any = None
|
826
|
+
if utils.match_response(http_res, "204", "*"):
|
827
|
+
return operations.DeleteRepresentativeResponse(
|
828
|
+
headers=utils.get_response_headers(http_res.headers)
|
829
|
+
)
|
830
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
831
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
832
|
+
raise errors.GenericError(data=response_data)
|
833
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
834
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
835
|
+
raise errors.APIError(
|
836
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
837
|
+
)
|
838
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
839
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
840
|
+
raise errors.APIError(
|
841
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
842
|
+
)
|
843
|
+
if utils.match_response(http_res, "4XX", "*"):
|
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, "5XX", "*"):
|
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
|
+
|
854
|
+
content_type = http_res.headers.get("Content-Type")
|
855
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
856
|
+
raise errors.APIError(
|
857
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
858
|
+
http_res.status_code,
|
859
|
+
http_res_text,
|
860
|
+
http_res,
|
861
|
+
)
|
862
|
+
|
863
|
+
def get(
|
864
|
+
self,
|
865
|
+
*,
|
866
|
+
account_id: str,
|
867
|
+
representative_id: str,
|
868
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
869
|
+
server_url: Optional[str] = None,
|
870
|
+
timeout_ms: Optional[int] = None,
|
871
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
872
|
+
) -> operations.GetRepresentativeResponse:
|
873
|
+
r"""Retrieve a specific representative associated with a given Moov account. Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
874
|
+
|
875
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
876
|
+
you'll need to specify the `/accounts/{accountID}/representatives.read` scope.
|
877
|
+
|
878
|
+
:param account_id: ID of the account.
|
879
|
+
:param representative_id: ID of the representative.
|
880
|
+
:param retries: Override the default retry configuration for this method
|
881
|
+
:param server_url: Override the default server URL for this method
|
882
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
883
|
+
:param http_headers: Additional headers to set or replace on requests.
|
884
|
+
"""
|
885
|
+
base_url = None
|
886
|
+
url_variables = None
|
887
|
+
if timeout_ms is None:
|
888
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
889
|
+
|
890
|
+
if server_url is not None:
|
891
|
+
base_url = server_url
|
892
|
+
else:
|
893
|
+
base_url = self._get_url(base_url, url_variables)
|
894
|
+
|
895
|
+
request = operations.GetRepresentativeRequest(
|
896
|
+
account_id=account_id,
|
897
|
+
representative_id=representative_id,
|
898
|
+
)
|
899
|
+
|
900
|
+
req = self._build_request(
|
901
|
+
method="GET",
|
902
|
+
path="/accounts/{accountID}/representatives/{representativeID}",
|
903
|
+
base_url=base_url,
|
904
|
+
url_variables=url_variables,
|
905
|
+
request=request,
|
906
|
+
request_body_required=False,
|
907
|
+
request_has_path_params=True,
|
908
|
+
request_has_query_params=True,
|
909
|
+
user_agent_header="user-agent",
|
910
|
+
accept_header_value="application/json",
|
911
|
+
http_headers=http_headers,
|
912
|
+
_globals=operations.GetRepresentativeGlobals(
|
913
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
914
|
+
),
|
915
|
+
security=self.sdk_configuration.security,
|
916
|
+
timeout_ms=timeout_ms,
|
917
|
+
)
|
918
|
+
|
919
|
+
if retries == UNSET:
|
920
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
921
|
+
retries = self.sdk_configuration.retry_config
|
922
|
+
|
923
|
+
retry_config = None
|
924
|
+
if isinstance(retries, utils.RetryConfig):
|
925
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
926
|
+
|
927
|
+
http_res = self.do_request(
|
928
|
+
hook_ctx=HookContext(
|
929
|
+
base_url=base_url or "",
|
930
|
+
operation_id="getRepresentative",
|
931
|
+
oauth2_scopes=[],
|
932
|
+
security_source=get_security_from_env(
|
933
|
+
self.sdk_configuration.security, components.Security
|
934
|
+
),
|
935
|
+
),
|
936
|
+
request=req,
|
937
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
938
|
+
retry_config=retry_config,
|
939
|
+
)
|
940
|
+
|
941
|
+
if utils.match_response(http_res, "200", "application/json"):
|
942
|
+
return operations.GetRepresentativeResponse(
|
943
|
+
result=utils.unmarshal_json(http_res.text, components.Representative),
|
944
|
+
headers=utils.get_response_headers(http_res.headers),
|
945
|
+
)
|
946
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
947
|
+
http_res_text = utils.stream_to_text(http_res)
|
948
|
+
raise errors.APIError(
|
949
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
950
|
+
)
|
951
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
952
|
+
http_res_text = utils.stream_to_text(http_res)
|
953
|
+
raise errors.APIError(
|
954
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
955
|
+
)
|
956
|
+
if utils.match_response(http_res, "4XX", "*"):
|
957
|
+
http_res_text = utils.stream_to_text(http_res)
|
958
|
+
raise errors.APIError(
|
959
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
960
|
+
)
|
961
|
+
if utils.match_response(http_res, "5XX", "*"):
|
962
|
+
http_res_text = utils.stream_to_text(http_res)
|
963
|
+
raise errors.APIError(
|
964
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
965
|
+
)
|
966
|
+
|
967
|
+
content_type = http_res.headers.get("Content-Type")
|
968
|
+
http_res_text = utils.stream_to_text(http_res)
|
969
|
+
raise errors.APIError(
|
970
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
971
|
+
http_res.status_code,
|
972
|
+
http_res_text,
|
973
|
+
http_res,
|
974
|
+
)
|
975
|
+
|
976
|
+
async def get_async(
|
977
|
+
self,
|
978
|
+
*,
|
979
|
+
account_id: str,
|
980
|
+
representative_id: str,
|
981
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
982
|
+
server_url: Optional[str] = None,
|
983
|
+
timeout_ms: Optional[int] = None,
|
984
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
985
|
+
) -> operations.GetRepresentativeResponse:
|
986
|
+
r"""Retrieve a specific representative associated with a given Moov account. Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
987
|
+
|
988
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
989
|
+
you'll need to specify the `/accounts/{accountID}/representatives.read` scope.
|
990
|
+
|
991
|
+
:param account_id: ID of the account.
|
992
|
+
:param representative_id: ID of the representative.
|
993
|
+
:param retries: Override the default retry configuration for this method
|
994
|
+
:param server_url: Override the default server URL for this method
|
995
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
996
|
+
:param http_headers: Additional headers to set or replace on requests.
|
997
|
+
"""
|
998
|
+
base_url = None
|
999
|
+
url_variables = None
|
1000
|
+
if timeout_ms is None:
|
1001
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1002
|
+
|
1003
|
+
if server_url is not None:
|
1004
|
+
base_url = server_url
|
1005
|
+
else:
|
1006
|
+
base_url = self._get_url(base_url, url_variables)
|
1007
|
+
|
1008
|
+
request = operations.GetRepresentativeRequest(
|
1009
|
+
account_id=account_id,
|
1010
|
+
representative_id=representative_id,
|
1011
|
+
)
|
1012
|
+
|
1013
|
+
req = self._build_request_async(
|
1014
|
+
method="GET",
|
1015
|
+
path="/accounts/{accountID}/representatives/{representativeID}",
|
1016
|
+
base_url=base_url,
|
1017
|
+
url_variables=url_variables,
|
1018
|
+
request=request,
|
1019
|
+
request_body_required=False,
|
1020
|
+
request_has_path_params=True,
|
1021
|
+
request_has_query_params=True,
|
1022
|
+
user_agent_header="user-agent",
|
1023
|
+
accept_header_value="application/json",
|
1024
|
+
http_headers=http_headers,
|
1025
|
+
_globals=operations.GetRepresentativeGlobals(
|
1026
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1027
|
+
),
|
1028
|
+
security=self.sdk_configuration.security,
|
1029
|
+
timeout_ms=timeout_ms,
|
1030
|
+
)
|
1031
|
+
|
1032
|
+
if retries == UNSET:
|
1033
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1034
|
+
retries = self.sdk_configuration.retry_config
|
1035
|
+
|
1036
|
+
retry_config = None
|
1037
|
+
if isinstance(retries, utils.RetryConfig):
|
1038
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1039
|
+
|
1040
|
+
http_res = await self.do_request_async(
|
1041
|
+
hook_ctx=HookContext(
|
1042
|
+
base_url=base_url or "",
|
1043
|
+
operation_id="getRepresentative",
|
1044
|
+
oauth2_scopes=[],
|
1045
|
+
security_source=get_security_from_env(
|
1046
|
+
self.sdk_configuration.security, components.Security
|
1047
|
+
),
|
1048
|
+
),
|
1049
|
+
request=req,
|
1050
|
+
error_status_codes=["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
1051
|
+
retry_config=retry_config,
|
1052
|
+
)
|
1053
|
+
|
1054
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1055
|
+
return operations.GetRepresentativeResponse(
|
1056
|
+
result=utils.unmarshal_json(http_res.text, components.Representative),
|
1057
|
+
headers=utils.get_response_headers(http_res.headers),
|
1058
|
+
)
|
1059
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1060
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1061
|
+
raise errors.APIError(
|
1062
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1063
|
+
)
|
1064
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1065
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1066
|
+
raise errors.APIError(
|
1067
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1068
|
+
)
|
1069
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1070
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1071
|
+
raise errors.APIError(
|
1072
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1073
|
+
)
|
1074
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1075
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1076
|
+
raise errors.APIError(
|
1077
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1078
|
+
)
|
1079
|
+
|
1080
|
+
content_type = http_res.headers.get("Content-Type")
|
1081
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1082
|
+
raise errors.APIError(
|
1083
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1084
|
+
http_res.status_code,
|
1085
|
+
http_res_text,
|
1086
|
+
http_res,
|
1087
|
+
)
|
1088
|
+
|
1089
|
+
def update(
|
1090
|
+
self,
|
1091
|
+
*,
|
1092
|
+
account_id: str,
|
1093
|
+
representative_id: str,
|
1094
|
+
name: Optional[
|
1095
|
+
Union[
|
1096
|
+
components.IndividualNameUpdate,
|
1097
|
+
components.IndividualNameUpdateTypedDict,
|
1098
|
+
]
|
1099
|
+
] = None,
|
1100
|
+
phone: OptionalNullable[
|
1101
|
+
Union[components.Phone, components.PhoneTypedDict]
|
1102
|
+
] = UNSET,
|
1103
|
+
email: OptionalNullable[
|
1104
|
+
Union[components.Email, components.EmailTypedDict]
|
1105
|
+
] = UNSET,
|
1106
|
+
address: OptionalNullable[
|
1107
|
+
Union[
|
1108
|
+
components.UpdateRepresentativeAddress,
|
1109
|
+
components.UpdateRepresentativeAddressTypedDict,
|
1110
|
+
]
|
1111
|
+
] = UNSET,
|
1112
|
+
birth_date: OptionalNullable[
|
1113
|
+
Union[
|
1114
|
+
components.UpdateRepresentativeBirthDate,
|
1115
|
+
components.UpdateRepresentativeBirthDateTypedDict,
|
1116
|
+
]
|
1117
|
+
] = UNSET,
|
1118
|
+
government_id: OptionalNullable[
|
1119
|
+
Union[
|
1120
|
+
components.UpdateRepresentativeGovernmentID,
|
1121
|
+
components.UpdateRepresentativeGovernmentIDTypedDict,
|
1122
|
+
]
|
1123
|
+
] = UNSET,
|
1124
|
+
responsibilities: OptionalNullable[
|
1125
|
+
Union[components.Responsibilities, components.ResponsibilitiesTypedDict]
|
1126
|
+
] = UNSET,
|
1127
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1128
|
+
server_url: Optional[str] = None,
|
1129
|
+
timeout_ms: Optional[int] = None,
|
1130
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1131
|
+
) -> operations.UpdateRepresentativeResponse:
|
1132
|
+
r"""If a representative's information has changed you can patch the information associated with a specific representative ID.
|
1133
|
+
Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
1134
|
+
|
1135
|
+
When **can** profile data be updated:
|
1136
|
+
|
1137
|
+
- For unverified representatives, all profile data can be edited.
|
1138
|
+
- During the verification process, missing or incomplete profile data can be edited.
|
1139
|
+
- Verified representatives can only add missing profile data.
|
1140
|
+
|
1141
|
+
When **can't** profile data be updated:
|
1142
|
+
|
1143
|
+
- Verified representatives cannot change any existing profile data.
|
1144
|
+
|
1145
|
+
If you need to update information in a locked state, please contact Moov support.
|
1146
|
+
|
1147
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1148
|
+
you'll need to specify the `/accounts/{accountID}/representatives.write` scope.
|
1149
|
+
|
1150
|
+
:param account_id: ID of the account.
|
1151
|
+
:param representative_id: ID of the representative.
|
1152
|
+
:param name:
|
1153
|
+
:param phone:
|
1154
|
+
:param email:
|
1155
|
+
:param address:
|
1156
|
+
:param birth_date:
|
1157
|
+
:param government_id:
|
1158
|
+
:param responsibilities:
|
1159
|
+
:param retries: Override the default retry configuration for this method
|
1160
|
+
:param server_url: Override the default server URL for this method
|
1161
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1162
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1163
|
+
"""
|
1164
|
+
base_url = None
|
1165
|
+
url_variables = None
|
1166
|
+
if timeout_ms is None:
|
1167
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1168
|
+
|
1169
|
+
if server_url is not None:
|
1170
|
+
base_url = server_url
|
1171
|
+
else:
|
1172
|
+
base_url = self._get_url(base_url, url_variables)
|
1173
|
+
|
1174
|
+
request = operations.UpdateRepresentativeRequest(
|
1175
|
+
account_id=account_id,
|
1176
|
+
representative_id=representative_id,
|
1177
|
+
update_representative=components.UpdateRepresentative(
|
1178
|
+
name=utils.get_pydantic_model(
|
1179
|
+
name, Optional[components.IndividualNameUpdate]
|
1180
|
+
),
|
1181
|
+
phone=utils.get_pydantic_model(
|
1182
|
+
phone, OptionalNullable[components.Phone]
|
1183
|
+
),
|
1184
|
+
email=utils.get_pydantic_model(
|
1185
|
+
email, OptionalNullable[components.Email]
|
1186
|
+
),
|
1187
|
+
address=utils.get_pydantic_model(
|
1188
|
+
address, OptionalNullable[components.UpdateRepresentativeAddress]
|
1189
|
+
),
|
1190
|
+
birth_date=utils.get_pydantic_model(
|
1191
|
+
birth_date,
|
1192
|
+
OptionalNullable[components.UpdateRepresentativeBirthDate],
|
1193
|
+
),
|
1194
|
+
government_id=utils.get_pydantic_model(
|
1195
|
+
government_id,
|
1196
|
+
OptionalNullable[components.UpdateRepresentativeGovernmentID],
|
1197
|
+
),
|
1198
|
+
responsibilities=utils.get_pydantic_model(
|
1199
|
+
responsibilities, OptionalNullable[components.Responsibilities]
|
1200
|
+
),
|
1201
|
+
),
|
1202
|
+
)
|
1203
|
+
|
1204
|
+
req = self._build_request(
|
1205
|
+
method="PATCH",
|
1206
|
+
path="/accounts/{accountID}/representatives/{representativeID}",
|
1207
|
+
base_url=base_url,
|
1208
|
+
url_variables=url_variables,
|
1209
|
+
request=request,
|
1210
|
+
request_body_required=True,
|
1211
|
+
request_has_path_params=True,
|
1212
|
+
request_has_query_params=True,
|
1213
|
+
user_agent_header="user-agent",
|
1214
|
+
accept_header_value="application/json",
|
1215
|
+
http_headers=http_headers,
|
1216
|
+
_globals=operations.UpdateRepresentativeGlobals(
|
1217
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1218
|
+
),
|
1219
|
+
security=self.sdk_configuration.security,
|
1220
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1221
|
+
request.update_representative,
|
1222
|
+
False,
|
1223
|
+
False,
|
1224
|
+
"json",
|
1225
|
+
components.UpdateRepresentative,
|
1226
|
+
),
|
1227
|
+
timeout_ms=timeout_ms,
|
1228
|
+
)
|
1229
|
+
|
1230
|
+
if retries == UNSET:
|
1231
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1232
|
+
retries = self.sdk_configuration.retry_config
|
1233
|
+
|
1234
|
+
retry_config = None
|
1235
|
+
if isinstance(retries, utils.RetryConfig):
|
1236
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1237
|
+
|
1238
|
+
http_res = self.do_request(
|
1239
|
+
hook_ctx=HookContext(
|
1240
|
+
base_url=base_url or "",
|
1241
|
+
operation_id="updateRepresentative",
|
1242
|
+
oauth2_scopes=[],
|
1243
|
+
security_source=get_security_from_env(
|
1244
|
+
self.sdk_configuration.security, components.Security
|
1245
|
+
),
|
1246
|
+
),
|
1247
|
+
request=req,
|
1248
|
+
error_status_codes=[
|
1249
|
+
"400",
|
1250
|
+
"401",
|
1251
|
+
"403",
|
1252
|
+
"404",
|
1253
|
+
"409",
|
1254
|
+
"429",
|
1255
|
+
"4XX",
|
1256
|
+
"500",
|
1257
|
+
"504",
|
1258
|
+
"5XX",
|
1259
|
+
],
|
1260
|
+
retry_config=retry_config,
|
1261
|
+
)
|
1262
|
+
|
1263
|
+
response_data: Any = None
|
1264
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1265
|
+
return operations.UpdateRepresentativeResponse(
|
1266
|
+
result=utils.unmarshal_json(http_res.text, components.Representative),
|
1267
|
+
headers=utils.get_response_headers(http_res.headers),
|
1268
|
+
)
|
1269
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1270
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1271
|
+
raise errors.GenericError(data=response_data)
|
1272
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1273
|
+
http_res_text = utils.stream_to_text(http_res)
|
1274
|
+
raise errors.APIError(
|
1275
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1276
|
+
)
|
1277
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1278
|
+
http_res_text = utils.stream_to_text(http_res)
|
1279
|
+
raise errors.APIError(
|
1280
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1281
|
+
)
|
1282
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1283
|
+
http_res_text = utils.stream_to_text(http_res)
|
1284
|
+
raise errors.APIError(
|
1285
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1286
|
+
)
|
1287
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1288
|
+
http_res_text = utils.stream_to_text(http_res)
|
1289
|
+
raise errors.APIError(
|
1290
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1291
|
+
)
|
1292
|
+
|
1293
|
+
content_type = http_res.headers.get("Content-Type")
|
1294
|
+
http_res_text = utils.stream_to_text(http_res)
|
1295
|
+
raise errors.APIError(
|
1296
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1297
|
+
http_res.status_code,
|
1298
|
+
http_res_text,
|
1299
|
+
http_res,
|
1300
|
+
)
|
1301
|
+
|
1302
|
+
async def update_async(
|
1303
|
+
self,
|
1304
|
+
*,
|
1305
|
+
account_id: str,
|
1306
|
+
representative_id: str,
|
1307
|
+
name: Optional[
|
1308
|
+
Union[
|
1309
|
+
components.IndividualNameUpdate,
|
1310
|
+
components.IndividualNameUpdateTypedDict,
|
1311
|
+
]
|
1312
|
+
] = None,
|
1313
|
+
phone: OptionalNullable[
|
1314
|
+
Union[components.Phone, components.PhoneTypedDict]
|
1315
|
+
] = UNSET,
|
1316
|
+
email: OptionalNullable[
|
1317
|
+
Union[components.Email, components.EmailTypedDict]
|
1318
|
+
] = UNSET,
|
1319
|
+
address: OptionalNullable[
|
1320
|
+
Union[
|
1321
|
+
components.UpdateRepresentativeAddress,
|
1322
|
+
components.UpdateRepresentativeAddressTypedDict,
|
1323
|
+
]
|
1324
|
+
] = UNSET,
|
1325
|
+
birth_date: OptionalNullable[
|
1326
|
+
Union[
|
1327
|
+
components.UpdateRepresentativeBirthDate,
|
1328
|
+
components.UpdateRepresentativeBirthDateTypedDict,
|
1329
|
+
]
|
1330
|
+
] = UNSET,
|
1331
|
+
government_id: OptionalNullable[
|
1332
|
+
Union[
|
1333
|
+
components.UpdateRepresentativeGovernmentID,
|
1334
|
+
components.UpdateRepresentativeGovernmentIDTypedDict,
|
1335
|
+
]
|
1336
|
+
] = UNSET,
|
1337
|
+
responsibilities: OptionalNullable[
|
1338
|
+
Union[components.Responsibilities, components.ResponsibilitiesTypedDict]
|
1339
|
+
] = UNSET,
|
1340
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1341
|
+
server_url: Optional[str] = None,
|
1342
|
+
timeout_ms: Optional[int] = None,
|
1343
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
1344
|
+
) -> operations.UpdateRepresentativeResponse:
|
1345
|
+
r"""If a representative's information has changed you can patch the information associated with a specific representative ID.
|
1346
|
+
Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more.
|
1347
|
+
|
1348
|
+
When **can** profile data be updated:
|
1349
|
+
|
1350
|
+
- For unverified representatives, all profile data can be edited.
|
1351
|
+
- During the verification process, missing or incomplete profile data can be edited.
|
1352
|
+
- Verified representatives can only add missing profile data.
|
1353
|
+
|
1354
|
+
When **can't** profile data be updated:
|
1355
|
+
|
1356
|
+
- Verified representatives cannot change any existing profile data.
|
1357
|
+
|
1358
|
+
If you need to update information in a locked state, please contact Moov support.
|
1359
|
+
|
1360
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
1361
|
+
you'll need to specify the `/accounts/{accountID}/representatives.write` scope.
|
1362
|
+
|
1363
|
+
:param account_id: ID of the account.
|
1364
|
+
:param representative_id: ID of the representative.
|
1365
|
+
:param name:
|
1366
|
+
:param phone:
|
1367
|
+
:param email:
|
1368
|
+
:param address:
|
1369
|
+
:param birth_date:
|
1370
|
+
:param government_id:
|
1371
|
+
:param responsibilities:
|
1372
|
+
:param retries: Override the default retry configuration for this method
|
1373
|
+
:param server_url: Override the default server URL for this method
|
1374
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1375
|
+
:param http_headers: Additional headers to set or replace on requests.
|
1376
|
+
"""
|
1377
|
+
base_url = None
|
1378
|
+
url_variables = None
|
1379
|
+
if timeout_ms is None:
|
1380
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
1381
|
+
|
1382
|
+
if server_url is not None:
|
1383
|
+
base_url = server_url
|
1384
|
+
else:
|
1385
|
+
base_url = self._get_url(base_url, url_variables)
|
1386
|
+
|
1387
|
+
request = operations.UpdateRepresentativeRequest(
|
1388
|
+
account_id=account_id,
|
1389
|
+
representative_id=representative_id,
|
1390
|
+
update_representative=components.UpdateRepresentative(
|
1391
|
+
name=utils.get_pydantic_model(
|
1392
|
+
name, Optional[components.IndividualNameUpdate]
|
1393
|
+
),
|
1394
|
+
phone=utils.get_pydantic_model(
|
1395
|
+
phone, OptionalNullable[components.Phone]
|
1396
|
+
),
|
1397
|
+
email=utils.get_pydantic_model(
|
1398
|
+
email, OptionalNullable[components.Email]
|
1399
|
+
),
|
1400
|
+
address=utils.get_pydantic_model(
|
1401
|
+
address, OptionalNullable[components.UpdateRepresentativeAddress]
|
1402
|
+
),
|
1403
|
+
birth_date=utils.get_pydantic_model(
|
1404
|
+
birth_date,
|
1405
|
+
OptionalNullable[components.UpdateRepresentativeBirthDate],
|
1406
|
+
),
|
1407
|
+
government_id=utils.get_pydantic_model(
|
1408
|
+
government_id,
|
1409
|
+
OptionalNullable[components.UpdateRepresentativeGovernmentID],
|
1410
|
+
),
|
1411
|
+
responsibilities=utils.get_pydantic_model(
|
1412
|
+
responsibilities, OptionalNullable[components.Responsibilities]
|
1413
|
+
),
|
1414
|
+
),
|
1415
|
+
)
|
1416
|
+
|
1417
|
+
req = self._build_request_async(
|
1418
|
+
method="PATCH",
|
1419
|
+
path="/accounts/{accountID}/representatives/{representativeID}",
|
1420
|
+
base_url=base_url,
|
1421
|
+
url_variables=url_variables,
|
1422
|
+
request=request,
|
1423
|
+
request_body_required=True,
|
1424
|
+
request_has_path_params=True,
|
1425
|
+
request_has_query_params=True,
|
1426
|
+
user_agent_header="user-agent",
|
1427
|
+
accept_header_value="application/json",
|
1428
|
+
http_headers=http_headers,
|
1429
|
+
_globals=operations.UpdateRepresentativeGlobals(
|
1430
|
+
x_moov_version=self.sdk_configuration.globals.x_moov_version,
|
1431
|
+
),
|
1432
|
+
security=self.sdk_configuration.security,
|
1433
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
1434
|
+
request.update_representative,
|
1435
|
+
False,
|
1436
|
+
False,
|
1437
|
+
"json",
|
1438
|
+
components.UpdateRepresentative,
|
1439
|
+
),
|
1440
|
+
timeout_ms=timeout_ms,
|
1441
|
+
)
|
1442
|
+
|
1443
|
+
if retries == UNSET:
|
1444
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
1445
|
+
retries = self.sdk_configuration.retry_config
|
1446
|
+
|
1447
|
+
retry_config = None
|
1448
|
+
if isinstance(retries, utils.RetryConfig):
|
1449
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1450
|
+
|
1451
|
+
http_res = await self.do_request_async(
|
1452
|
+
hook_ctx=HookContext(
|
1453
|
+
base_url=base_url or "",
|
1454
|
+
operation_id="updateRepresentative",
|
1455
|
+
oauth2_scopes=[],
|
1456
|
+
security_source=get_security_from_env(
|
1457
|
+
self.sdk_configuration.security, components.Security
|
1458
|
+
),
|
1459
|
+
),
|
1460
|
+
request=req,
|
1461
|
+
error_status_codes=[
|
1462
|
+
"400",
|
1463
|
+
"401",
|
1464
|
+
"403",
|
1465
|
+
"404",
|
1466
|
+
"409",
|
1467
|
+
"429",
|
1468
|
+
"4XX",
|
1469
|
+
"500",
|
1470
|
+
"504",
|
1471
|
+
"5XX",
|
1472
|
+
],
|
1473
|
+
retry_config=retry_config,
|
1474
|
+
)
|
1475
|
+
|
1476
|
+
response_data: Any = None
|
1477
|
+
if utils.match_response(http_res, "200", "application/json"):
|
1478
|
+
return operations.UpdateRepresentativeResponse(
|
1479
|
+
result=utils.unmarshal_json(http_res.text, components.Representative),
|
1480
|
+
headers=utils.get_response_headers(http_res.headers),
|
1481
|
+
)
|
1482
|
+
if utils.match_response(http_res, ["400", "409"], "application/json"):
|
1483
|
+
response_data = utils.unmarshal_json(http_res.text, errors.GenericErrorData)
|
1484
|
+
raise errors.GenericError(data=response_data)
|
1485
|
+
if utils.match_response(http_res, ["401", "403", "404", "429"], "*"):
|
1486
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1487
|
+
raise errors.APIError(
|
1488
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1489
|
+
)
|
1490
|
+
if utils.match_response(http_res, ["500", "504"], "*"):
|
1491
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1492
|
+
raise errors.APIError(
|
1493
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1494
|
+
)
|
1495
|
+
if utils.match_response(http_res, "4XX", "*"):
|
1496
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1497
|
+
raise errors.APIError(
|
1498
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1499
|
+
)
|
1500
|
+
if utils.match_response(http_res, "5XX", "*"):
|
1501
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1502
|
+
raise errors.APIError(
|
1503
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
1504
|
+
)
|
1505
|
+
|
1506
|
+
content_type = http_res.headers.get("Content-Type")
|
1507
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
1508
|
+
raise errors.APIError(
|
1509
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1510
|
+
http_res.status_code,
|
1511
|
+
http_res_text,
|
1512
|
+
http_res,
|
1513
|
+
)
|