o
    Bi                    @   s  d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZmZ d dlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ d dl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+ e+rd dl,m-Z- d dl.m/Z/ d dl0m1Z1 d dl2m3Z3 d dl4m5Z5 d dl6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z= d dl>m?Z? d dl@mAZA d dlBmCZC d dlDmEZE edededed G d!d" d"ed" ed" e	d" ed" ed" ZFeFeFjG_Hd#S )$    )CreateableAPIResource)DeletableAPIResource)ExpandableField)
ListObject)ListableAPIResource)nested_resource_class_methods)RequestOptions)SearchResultObject)SearchableAPIResource)StripeObject)APIResourceTestHelpers)UpdateableAPIResource)class_method_variantsanitize_id)	AsyncIteratorClassVarDictIteratorListOptionalUnioncastoverload)LiteralNotRequiredType	TypedDictUnpackTYPE_CHECKING)Account)BankAccount)Card)CashBalance)CustomerBalanceTransaction)CustomerCashBalanceTransaction)Discount)FundingInstructions)PaymentMethod)Source)Subscription)TaxId)	TestClockbalance_transactioncash_balance_transactionsourcetax_idc                
   @   s  e Zd ZU dZdZeed  ed< G dd deZ	G dd deZ
G dd	 d	eZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG d d! d!eZG d"d# d#eZG d$d% d%eZG d&d' d'eZG d(d) d)eZG d*d+ d+eZG d,d- d-eZG d.d/ d/eZ G d0d1 d1eZ!G d2d3 d3eZ"G d4d5 d5eZ#G d6d7 d7eZ$G d8d9 d9eZ%G d:d; d;eZ&G d<d= d=eZ'G d>d? d?eZ(G d@dA dAeZ)G dBdC dCeZ*G dDdE dEeZ+G dFdG dGeZ,G dHdI dIeZ-G dJdK dKeZ.G dLdM dMeZ/G dNdO dOeZ0G dPdQ dQeZ1G dRdS dSeZ2G dTdU dUeZ3G dVdW dWeZ4G dXdY dYeZ5G dZd[ d[eZ6G d\d] d]eZ7G d^d_ d_eZ8G d`da daeZ9G dbdc dceZ:G ddde deeZ;G dfdg dgeZ<G dhdi dieZ=G djdk dkeZ>G dldm dmeZ?G dndo doeZ@G dpdq dqeZAG drds dseZBG dtdu dueZCeDe	 edv< 	 eDeE edw< 	 eDdx edy< 	 eEedz< 	 eDeF ed{< 	 eDeGeHd|   ed}< 	 eDeI ed~< 	 eDeF ed< 	 eDd ed< 	 eDeF ed< 	 eFed< 	 eDeJeFeEf  ed< 	 eDeF ed< 	 eDe
 ed< eIed< 	 eDeJeFeFf  ed< 	 eDeF ed< 	 eDeE ed< 	 ed ed< 	 eDeF ed< 	 eDeKeF  ed< 	 eDe ed< 	 eDeLeHd|   ed< 	 eDeLd  ed< 	 eDe ed< eDed  ed< 	 eDeLd  ed< 	 eDeGd  ed< 	 eDed  ed< 	 eMdeNd dd fddZOeMdeNd dd fddZPeMdeFdeNd ddfddZQeReSdeFdeNd ddfddZTeRdeNd ddfddZTeUddeNd ddfddZTeMdeFdeNd ddfddZVeReSdeFdeNd ddfddZWeRdeNd ddfddZWeUddeNd ddfddZWeMdeFdeNd dd fddZXeReSdeFdeNd dd fddZYeRdeNd dd fddZYeUddeNd dd fddZYeMdeFdeNd dd fddZZeReSdeFdeNd dd fddZ[eRdeNd dd fddZ[eUddeNd dd fddZ[eMdeFdeNd ddfddĄZ\eReSdeFdeNd ddfddƄZ]eRdeNd ddfddƄZ]eUdȃdeNd ddfddƄZ]eMdeFdeNd ddfdd˄Z^eReSdeFdeNd ddfdd̈́Z_eRdeNd ddfdd̈́Z_eUdσdeNd ddfdd̈́Z_eMdeNd deLd  fddӄZ`eMdeNd deLd  fddՄZaeMdeFdeNd deLd fddلZbeReSdeFdeNd deLd fddۄZceRdeNd deLd fddۄZceUd݃deNd deLd fddۄZceMdeFdeNd deLd fddZdeReSdeFdeNd deLd fddZeeRdeNd deLd fddZeeUddeNd deLd fddZeeMdeFdeNd dd fddZfeMdeFdeNd dd fddZgeMdeFdeNd dd fddZheMdeFdeNd dd fddZieMdeFdeFdeNd ddfddZjeReSdeFdeFdeNd ddfddZkeRdeFdeNd ddfddZkeUddeFdeNd ddfddZkeMdeFdeFdeNd ddfddZleReSdeFdeFdeNd ddfddZmeRdeFdeNd ddfddZmeUddeFdeNd ddfddZmeMd eNd dend  fddZoeMd eNd dend  fddZpeMd eNd deqd  fddZreMd eNd desd  fdd	ZteMdeFdeNd
 ddfddZueMdeFdeNd
 ddfddZveMdeFdeFdeNd ddfddZweMdeFdeFdeNd ddfddZxeMdeFdeFdeNd ddfddZyeMdeFdeFdeNd ddfddZzeMdeFdeNd deLd fddZ{eMdeFdeNd deLd fddZ|eMdeFdeFdeNd  dd!fd"d#Z}eMdeFdeFdeNd  dd!fd$d%Z~eMdeFdeNd& deLd! fd'd(ZeMdeFdeNd& deLd! fd)d*ZeMdeFdeNd+ deHd| fd,d-ZeMdeFdeNd+ deHd| fd.d/ZeMdeFdeFdeNd0 deHd| fd1d2ZeMdeFdeFdeNd0 deHd| fd3d4ZeMdeFdeFdeNd5 deHd| fd6d7ZeMdeFdeFdeNd5 deHd| fd8d9ZeMdeFdeFdeNd: deHd| fd;d<ZeMdeFdeFdeNd: deHd| fd=d>ZeMdeFdeNd? deLeHd|  fd@dAZeMdeFdeNd? deLeHd|  fdBdCZeMdeFdeNdD ddfdEdFZeMdeFdeNdD ddfdGdHZeMdeFdeFdeNdI ddfdJdKZeMdeFdeFdeNdI ddfdLdMZeMdeFdeFdeNdN ddfdOdPZeMdeFdeFdeNdN ddfdQdRZeMdeFdeNdS deLd fdTdUZeMdeFdeNdS deLd fdVdWZeMdeFdeNdX ddxfdYdZZeMdeFdeNdX ddxfd[d\ZeMdeFdeNd] ddxfd^d_ZeMdeFdeNd] ddxfd`daZG dbdc dced  Zeddde Ze	e
eedfZdgS (h  Customerz
    This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer.

    Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment)
    customerOBJECT_NAMEc                   @   `   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )zCustomer.Addresscitycountryline1line2postal_codestateN__name__
__module____qualname__r   str__annotations__ r@   r@   P/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_customer.pyAddressI      
 rB   c                   @   sx   e Zd ZU G dd deZG dd deZeee  ed< 	 ee	d  ed< 	 ee
 ed< 	 ee ed	< 	 eed
ZdS )zCustomer.InvoiceSettingsc                   @       e Zd ZU eed< 	 eed< dS )z$Customer.InvoiceSettings.CustomFieldnamevalueNr;   r<   r=   r>   r?   r@   r@   r@   rA   CustomFieldd   
   
 rH   c                   @   s(   e Zd ZU ee ed< 	 ee ed< dS )z)Customer.InvoiceSettings.RenderingOptionsamount_tax_displaytemplateNr:   r@   r@   r@   rA   RenderingOptionsn   s
   
 rL   custom_fieldsr'   default_payment_methodfooterrendering_options)rM   rP   N)r;   r<   r=   r   rH   rL   r   r   r?   r   r>   _inner_class_typesr@   r@   r@   rA   InvoiceSettingsc   s   
 


rR   c                   @   sj   e Zd ZU G dd deZee ed< ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 deiZdS )	zCustomer.Shippingc                   @   r3   )zCustomer.Shipping.Addressr4   r5   r6   r7   r8   r9   Nr:   r@   r@   r@   rA   rB      rC   rB   addresscarrierrE   phonetracking_numberN)	r;   r<   r=   r   rB   r   r?   r>   rQ   r@   r@   r@   rA   Shipping   s   
 rW   c                   @   sP   e Zd ZU G dd deZed ed< 	 ee ed< 	 ee ed< 	 deiZ	dS )zCustomer.Taxc                   @   s2   e Zd ZU eed< 	 ed ed< 	 ee ed< dS )zCustomer.Tax.Locationr5   )billing_address
ip_addresspayment_methodshipping_destinationr.   r9   N)r;   r<   r=   r>   r?   r   r   r@   r@   r@   rA   Location   s   
 r\   )failednot_collecting	supportedunrecognized_locationautomatic_taxrY   locationN)
r;   r<   r=   r   r\   r   r?   r   r>   rQ   r@   r@   r@   rA   Tax   s   
 rc   c                   @   sN   e Zd ZU eed< 	 eed< 	 ee ed< 	 eee  ed< 	 ed ed< dS )'Customer.CreateBalanceTransactionParamsamountcurrencydescriptionexpandLiteral['']|Dict[str, str]metadataNr;   r<   r=   intr?   r>   r   r   r@   r@   r@   rA   CreateBalanceTransactionParams   s   
 rm   c                   @   s@   e Zd ZU ded< 	 eed< 	 eee  ed< 	 ed ed< dS )(Customer.CreateFundingInstructionsParams4Customer.CreateFundingInstructionsParamsBankTransferbank_transferrf   rh   funding_typeN)r;   r<   r=   r?   r>   r   r   r   r@   r@   r@   rA   CreateFundingInstructionsParams      
 rr   c                   @   s>   e Zd ZU ed ed< 	 eeed   ed< 	 ed ed< dS )ro   BCustomer.CreateFundingInstructionsParamsBankTransferEuBankTransfereu_bank_transfer)iban	sort_codespeizenginrequested_address_types)ru   gb_bank_transferjp_bank_transfermx_bank_transferus_bank_transfertypeN)r;   r<   r=   r   r?   r   r   r@   r@   r@   rA   +CreateFundingInstructionsParamsBankTransfer  s   
 
r   c                   @   s   e Zd ZU eed< dS )rt   r5   NrG   r@   r@   r@   rA   9CreateFundingInstructionsParamsBankTransferEuBankTransfer!  s   
 r   c                   @   sT  e Zd ZU ed ed< 	 ee ed< 	 ed ed< 	 ee ed< ee ed< 	 ee ed< 	 eee  ed	< 	 ee ed
< 	 ed ed< 	 ed ed< 	 ee ed< 	 ee ed< 	 ee ed< ee ed< 	 eee  ed< 	 ee ed< 	 ed ed< 	 ee ed< ed ed< 	 ed ed< 	 eed  ed< 	 ee ed< 	 ee ed< d S )!Customer.CreateParamsz(Literal['']|Customer.CreateParamsAddressrS   balance Customer.CreateParamsCashBalancecash_balancecouponrg   emailrh   invoice_prefix$Customer.CreateParamsInvoiceSettingsinvoice_settingsri   rj   rE   next_invoice_sequencerZ   rU   preferred_localespromotion_codez)Literal['']|Customer.CreateParamsShippingshippingr.   Customer.CreateParamsTaxtax0Literal['']|Literal['exempt', 'none', 'reverse']
tax_exemptCustomer.CreateParamsTaxIdDatumtax_id_data
test_clockvalidateN	r;   r<   r=   r   r?   rl   r>   r   boolr@   r@   r@   rA   CreateParams'  sZ   
 r   c                   @   r3   )zCustomer.CreateParamsAddressr4   r5   r6   r7   r8   r9   Nr;   r<   r=   r   r>   r?   r@   r@   r@   rA   CreateParamsAddress{  rC   r   c                   @      e Zd ZU ed ed< dS )r   (Customer.CreateParamsCashBalanceSettingssettingsNr;   r<   r=   r   r?   r@   r@   r@   rA   CreateParamsCashBalance     
 r   c                   @      e Zd ZU eed  ed< dS )r   	automaticmanualmerchant_defaultreconciliation_modeNr;   r<   r=   r   r   r?   r@   r@   r@   rA   CreateParamsCashBalanceSettings  
   
 r   c                   @   D   e Zd ZU ed ed< 	 ee ed< 	 ee ed< 	 ed ed< dS )r   zALiteral['']|List[Customer.CreateParamsInvoiceSettingsCustomField]rM   rN   rO   z@Literal['']|Customer.CreateParamsInvoiceSettingsRenderingOptionsrP   Nr;   r<   r=   r   r?   r>   r@   r@   r@   rA   CreateParamsInvoiceSettings     
 r   c                   @   rD   )z/Customer.CreateParamsInvoiceSettingsCustomFieldrE   rF   NrG   r@   r@   r@   rA   &CreateParamsInvoiceSettingsCustomField  rI   r   c                   @   (   e Zd ZU ed ed< 	 ee ed< dS )z4Customer.CreateParamsInvoiceSettingsRenderingOptions;Literal['']|Literal['exclude_tax', 'include_inclusive_tax']rJ   rK   Nr   r@   r@   r@   rA   +CreateParamsInvoiceSettingsRenderingOptions     
 r   c                   @   .   e Zd ZU ded< 	 eed< 	 ee ed< dS )zCustomer.CreateParamsShipping$Customer.CreateParamsShippingAddressrS   rE   rU   Nr;   r<   r=   r?   r>   r   r@   r@   r@   rA   CreateParamsShipping     
 r   c                   @   r3   )r   r4   r5   r6   r7   r8   r9   Nr   r@   r@   r@   rA   CreateParamsShippingAddress  rC   r   c                   @   ,   e Zd ZU ed ed< 	 eed  ed< dS )r   Literal['']|strrY   deferredimmediatelyvalidate_locationNr;   r<   r=   r   r?   r   r@   r@   r@   rA   CreateParamsTax  
   
 r   c                   @   s$   e Zd ZU ed ed< 	 eed< dS )r   Jad_nrtae_trnar_cuitau_abnau_arnbg_uicbh_vatbo_tinbr_cnpjbr_cpfca_bn
ca_gst_hst	ca_pst_bc	ca_pst_mb	ca_pst_skca_qstch_uidch_vatcl_tincn_tinco_nitcr_tinde_stndo_rcnec_ruceg_tines_cif
eu_oss_vateu_vatgb_vatge_vathk_brhr_oibhu_tinid_npwpil_vatin_gstis_vatjp_cnjp_rnjp_trnke_pinkr_brnkz_binli_uidmx_rfcmy_frpmy_itnmy_sstng_tinno_vatno_voecnz_gstom_vatpe_rucph_tinro_tinrs_pibru_innru_kppsa_vatsg_gstsg_uensi_tinsv_nitth_vattr_tintw_vatua_vatus_einuy_rucve_rifvn_tinza_vatr   rF   N)r;   r<   r=   r   r?   r>   r@   r@   r@   rA   CreateParamsTaxIdDatum  s   
 Lr  c                   @   sL   e Zd ZU eee  ed< 	 eeeef  ed< 	 eed< 	 ee ed< dS )Customer.CreateSourceParamsrh   rj   r.   r   N)	r;   r<   r=   r   r   r>   r?   r   r   r@   r@   r@   rA   CreateSourceParamsW  s   
 r  c                   @   s6   e Zd ZU eee  ed< 	 ed ed< 	 eed< dS )Customer.CreateTaxIdParamsrh   r   r   rF   N)r;   r<   r=   r   r   r>   r?   r   r@   r@   r@   rA   CreateTaxIdParamsf  s   
 Lr  c                   @      e Zd ZdS )Customer.DeleteDiscountParamsNr;   r<   r=   r@   r@   r@   rA   DeleteDiscountParams      r  c                   @   r  )Customer.DeleteParamsNr  r@   r@   r@   rA   DeleteParams  r  r  c                   @      e Zd ZU eee  ed< dS )Customer.DeleteSourceParamsrh   Nr;   r<   r=   r   r   r>   r?   r@   r@   r@   rA   DeleteSourceParams     
 r  c                   @   r  )Customer.DeleteTaxIdParamsNr  r@   r@   r@   rA   DeleteTaxIdParams  r  r   c                   @   s@   e Zd ZU eed< 	 eed< 	 eee  ed< 	 ee ed< dS )Customer.FundCashBalanceParamsre   rf   rh   	referenceNrk   r@   r@   r@   rA   FundCashBalanceParams  rs   r#  c                   @   H   e Zd ZU ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< dS )&Customer.ListBalanceTransactionsParamsending_beforerh   limitstarting_afterNr;   r<   r=   r   r>   r?   r   rl   r@   r@   r@   rA   ListBalanceTransactionsParams     
 r*  c                   @   r$  )*Customer.ListCashBalanceTransactionsParamsr&  rh   r'  r(  Nr)  r@   r@   r@   rA   !ListCashBalanceTransactionsParams  r+  r-  c                   @   sr   e Zd ZU ed ed< 	 ee ed< 	 ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< 	 ee ed< d	S )
Customer.ListParamszCustomer.ListParamsCreated|intcreatedr   r&  rh   r'  r(  r   N)r;   r<   r=   r   r?   r>   r   rl   r@   r@   r@   rA   
ListParams  s   
 r0  c                   @   sD   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )zCustomer.ListParamsCreatedgtgteltlteN)r;   r<   r=   r   rl   r?   r@   r@   r@   rA   ListParamsCreated"     
 r5  c                   @   sl   e Zd ZU eed  ed< 	 ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< 	 eed  ed< d	S )
!Customer.ListPaymentMethodsParams)alwayslimitedunspecifiedallow_redisplayr&  rh   r'  r(  )%
acss_debitaffirmafterpay_clearpayalipay
amazon_payau_becs_debit
bacs_debit
bancontactblikboletocardcashappcustomer_balanceepsfpxgiropaygrabpayidealklarnakonbinilink	mobilepay
multibancooxxop24paynowpaypalpix	promptpayrevolut_pay
sepa_debitsofortswishtwintus_bank_account
wechat_payzipr   N)	r;   r<   r=   r   r   r?   r>   r   rl   r@   r@   r@   rA   ListPaymentMethodsParams4  s&   
 )ra  c                   @   sV   e Zd ZU ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )Customer.ListSourcesParamsr&  rh   r'  objectr(  Nr)  r@   r@   r@   rA   ListSourcesParamsx  s   
 rd  c                   @   r$  )Customer.ListTaxIdsParamsr&  rh   r'  r(  Nr)  r@   r@   r@   rA   ListTaxIdsParams  r+  rf  c                   @   s:   e Zd ZU ee ed< 	 eee  ed< 	 ed ed< dS )'Customer.ModifyBalanceTransactionParamsrg   rh   ri   rj   N)r;   r<   r=   r   r>   r?   r   r@   r@   r@   rA   ModifyBalanceTransactionParams  s   
 rh  c                   @   s,   e Zd ZU eee  ed< 	 ed ed< dS ) Customer.ModifyCashBalanceParamsrh   (Customer.ModifyCashBalanceParamsSettingsr   Nr  r@   r@   r@   rA   ModifyCashBalanceParams  s
   
 rk  c                   @   r   )rj  r   r   Nr   r@   r@   r@   rA   ModifyCashBalanceParamsSettings  r   rl  c                   @   s6  e Zd ZU ed ed< 	 ee ed< 	 ed ed< 	 ee ed< ee ed< 	 ee ed< 	 ee ed	< 	 eee  ed
< 	 ee ed< 	 ed ed< 	 ed ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 eee  ed< 	 ee ed< 	 ed ed< 	 ee ed< ed ed< 	 ed ed< 	 ee ed< dS )Customer.ModifyParamsz(Literal['']|Customer.ModifyParamsAddressrS   r    Customer.ModifyParamsCashBalancer   r   default_sourcerg   r   rh   r   $Customer.ModifyParamsInvoiceSettingsr   ri   rj   rE   r   rU   r   r   z)Literal['']|Customer.ModifyParamsShippingr   r.   Customer.ModifyParamsTaxr   r   r   r   Nr   r@   r@   r@   rA   ModifyParams  sT   
 rr  c                   @   r3   )zCustomer.ModifyParamsAddressr4   r5   r6   r7   r8   r9   Nr   r@   r@   r@   rA   ModifyParamsAddress  rC   rs  c                   @   r   )rn  (Customer.ModifyParamsCashBalanceSettingsr   Nr   r@   r@   r@   rA   ModifyParamsCashBalance-  r   ru  c                   @   r   )rt  r   r   Nr   r@   r@   r@   rA   ModifyParamsCashBalanceSettings4  r   rv  c                   @   r   )rp  zALiteral['']|List[Customer.ModifyParamsInvoiceSettingsCustomField]rM   rN   rO   z@Literal['']|Customer.ModifyParamsInvoiceSettingsRenderingOptionsrP   Nr   r@   r@   r@   rA   ModifyParamsInvoiceSettings<  r   rw  c                   @   rD   )z/Customer.ModifyParamsInvoiceSettingsCustomFieldrE   rF   NrG   r@   r@   r@   rA   &ModifyParamsInvoiceSettingsCustomFieldR  rI   rx  c                   @   r   )z4Customer.ModifyParamsInvoiceSettingsRenderingOptionsr   rJ   rK   Nr   r@   r@   r@   rA   +ModifyParamsInvoiceSettingsRenderingOptions\  r   ry  c                   @   r   )zCustomer.ModifyParamsShipping$Customer.ModifyParamsShippingAddressrS   rE   rU   Nr   r@   r@   r@   rA   ModifyParamsShippingh  r   r{  c                   @   r3   )rz  r4   r5   r6   r7   r8   r9   Nr   r@   r@   r@   rA   ModifyParamsShippingAddressv  rC   r|  c                   @   r   )rq  r   rY   r   r   Nr   r@   r@   r@   rA   ModifyParamsTax  r   r}  c                   @   s   e Zd ZU ee ed< 	 eed  ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed	< 	 ee ed
< 	 ee ed< 	 eee  ed< 	 ed ed< 	 ee ed< 	 ed ed< dS )Customer.ModifySourceParamsaccount_holder_name)company
individualaccount_holder_typeaddress_cityaddress_countryaddress_line1address_line2address_stateaddress_zip	exp_monthexp_yearrh   ri   rj   rE    Customer.ModifySourceParamsOwnerownerN)r;   r<   r=   r   r>   r?   r   r   r@   r@   r@   rA   ModifySourceParams  s8   
 r  c                   @   sD   e Zd ZU ed ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )r  'Customer.ModifySourceParamsOwnerAddressrS   r   rE   rU   Nr   r@   r@   r@   rA   ModifySourceParamsOwner  r6  r  c                   @   r3   )r  r4   r5   r6   r7   r8   r9   Nr   r@   r@   r@   rA   ModifySourceParamsOwnerAddress  rC   r  c                   @   r  ))Customer.RetrieveBalanceTransactionParamsrh   Nr  r@   r@   r@   rA    RetrieveBalanceTransactionParams  r  r  c                   @   r  )"Customer.RetrieveCashBalanceParamsrh   Nr  r@   r@   r@   rA   RetrieveCashBalanceParams  r  r  c                   @   r  )-Customer.RetrieveCashBalanceTransactionParamsrh   Nr  r@   r@   r@   rA   $RetrieveCashBalanceTransactionParams	  r  r  c                   @   r  )Customer.RetrieveParamsrh   Nr  r@   r@   r@   rA   RetrieveParams  r  r  c                   @   r  )$Customer.RetrievePaymentMethodParamsrh   Nr  r@   r@   r@   rA   RetrievePaymentMethodParams  r  r  c                   @   r  )Customer.RetrieveSourceParamsrh   Nr  r@   r@   r@   rA   RetrieveSourceParams  r  r  c                   @   r  )Customer.RetrieveTaxIdParamsrh   Nr  r@   r@   r@   rA   RetrieveTaxIdParams!  r  r  c                   @   sD   e Zd ZU eee  ed< 	 ee ed< 	 ee ed< 	 eed< dS )Customer.SearchParamsrh   r'  pagequeryN)r;   r<   r=   r   r   r>   r?   rl   r@   r@   r@   rA   SearchParams'  s   
 r  rS   r   r"   r   r/  rf   r   r    r!   r(   ro  
delinquentrg   r%   discountr   idinvoice_credit_balancer   r   livemoderj   rE   r   rc  rU   r   r   sourcesr)   subscriptionsr   )exemptnonereverser   r*   tax_idsr+   r   Tdeletedparamsr   returnc                 K   s   t d| jd|  |dS )0
        Creates a new customer object.
        r0   postr  )r   _static_request	class_urlclsr  r@   r@   rA   create  s   zCustomer.createc                    s"   t d| jd|  |dI dH S )r  r0   r  r  N)r   _static_request_asyncr  r  r@   r@   rA   create_async  s   
zCustomer.create_asyncrn   r&   c                 K   "   t d| jddjt|d|dS )  
        Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
        funding instructions will be created. If funding instructions have already been created for a given customer, the same
        funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
        r&   r  -/v1/customers/{customer}/funding_instructionsr1   r  r   r  formatr   r  r1   r  r@   r@   rA    _cls_create_funding_instructions  s   z)Customer._cls_create_funding_instructionsc                 K      dS r  Nr@   r1   r  r@   r@   rA   create_funding_instructions  s   z$Customer.create_funding_instructionsc                 K   r  r  r@   selfr  r@   r@   rA   r       	r  c              	   K   (   t d| jddjt| dd|dS )r  r&   r  r  r  r  r  r   _requestr  r   getr  r@   r@   rA   r    s   	c                    *   t d| jddjt|d|dI dH S )r  r&   r  r  r  r  Nr   r  r  r   r  r@   r@   rA   &_cls_create_funding_instructions_async  s   
z/Customer._cls_create_funding_instructions_asyncc                       dS r  r@   r  r@   r@   rA   !create_funding_instructions_async(  s   z*Customer.create_funding_instructions_asyncc                    r  r  r@   r  r@   r@   rA   r  5     	r  c              	      0   t d| jddjt| dd|dI dH S )r  r&   r  r  r  r  r  Nr   _request_asyncr  r   r  r  r@   r@   rA   r  @  s   	
sidr  c                 K   *   d|   t|f }td| jd||dS )
        Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
        %s/%sr0   deleter  r  r   r   r  r  r  r  urlr@   r@   rA   _cls_deleteT  s   zCustomer._cls_deletec                 K   r  r  Nr@   r  r  r@   r@   rA   r  e     zCustomer.deletec                 K   r  r  r@   r  r@   r@   rA   r  o  s   r  c                 K   s   | j d|  |dS )r  r  r  )_request_and_refreshinstance_urlr  r@   r@   rA   r  v  s
   c                    2   d|   t|f }td| jd||dI dH S )r  r  r0   r  r  Nr  r   r   r  r  r@   r@   rA   _cls_delete_async  s   
zCustomer._cls_delete_asyncc                    r  r  r@   r  r@   r@   rA   delete_async     zCustomer.delete_asyncc                    r  r  r@   r  r@   r@   rA   r       r  c                    s   | j d|  |dI dH S )r  r  r  N)_request_and_refresh_asyncr  r  r@   r@   rA   r    s   r  c                 K   r  )G
        Removes the currently applied discount on a customer.
        r%   r  !/v1/customers/{customer}/discountr  r  r  r  r@   r@   rA   _cls_delete_discount     zCustomer._cls_delete_discountc                 K   r  r  Nr@   r  r@   r@   rA   delete_discount  r  zCustomer.delete_discountc                 K   r  r  r@   r  r@   r@   rA   r       r  c              	   K   r  )r  r%   r  r  r  r  r  r  r  r@   r@   rA   r    s   c                    r  )r  r%   r  r  r  r  Nr  r  r@   r@   rA   _cls_delete_discount_async     
z#Customer._cls_delete_discount_asyncc                    r  r  r@   r  r@   r@   rA   delete_discount_async  r  zCustomer.delete_discount_asyncc                    r  r  r@   r  r@   r@   rA   r    r  r  c              	      r  )r  r%   r  r  r  r  r  Nr  r  r@   r@   rA   r    s   
r.  c                 K   s4   | j d|  |d}t|tstdt|j |S )
        Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
        r  r  %Expected list object from API, got %s)r  r  
isinstancer   	TypeErrorr   r;   r  r  resultr@   r@   rA   list"  s   
zCustomer.listc                    s<   | j d|  |dI dH }t|tstdt|j |S )r  r  r  Nr  )r  r  r  r   r  r   r;   r  r@   r@   rA   
list_async6  s   
zCustomer.list_asyncr7  r'   c                 K   &   t td | jddjt|d|dS )G
        Returns a list of PaymentMethods for a given Customer
        r'   r  (/v1/customers/{customer}/payment_methodsr  r  r   r   r  r  r   r  r@   r@   rA   _cls_list_payment_methodsJ     	z"Customer._cls_list_payment_methodsc                 K   r  r   Nr@   r  r@   r@   rA   list_payment_methods^  r  zCustomer.list_payment_methodsc                 K   r  r  r@   r  r@   r@   rA   r  h  r  r  c              	   K   s,   t td | jddjt| dd|dS )r   r'   r  r  r  r  r  )r   r   r  r  r   r  r  r@   r@   rA   r  q  s   c                    .   t td | jddjt|d|dI dH S )r   r'   r  r  r  r  Nr   r   r  r  r   r  r@   r@   rA   _cls_list_payment_methods_async     	
z(Customer._cls_list_payment_methods_asyncc                    r  r  r@   r  r@   r@   rA   list_payment_methods_async  r  z#Customer.list_payment_methods_asyncc                    r  r  r@   r  r@   r@   rA   r    r  r	  c              	      s4   t td | jddjt| dd|dI dH S )r   r'   r  r  r  r  r  N)r   r   r  r  r   r  r  r@   r@   rA   r    s   
rm  c                 K   r  )w  
        Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.

        This request accepts mostly the same arguments as the customer creation call.
        r  r0   r  r  r  r  r  r  r  r@   r@   rA   modify  s   	zCustomer.modifyc                    r  )r  r  r0   r  r  Nr  r  r@   r@   rA   modify_async  s   	
zCustomer.modify_asyncr  c                 K   s   | |fi |}|   |S ).
        Retrieves a Customer object.
        )refreshr  r  r  instancer@   r@   rA   retrieve  s   zCustomer.retrievec                    s$   | |fi |}|  I dH  |S )r  N)refresh_asyncr  r@   r@   rA   retrieve_async  s   zCustomer.retrieve_asyncrZ   r  c                 K   (   t d| jddjt|t|d|dS )H
        Retrieves a PaymentMethod object for a given Customer.
        r'   r  9/v1/customers/{customer}/payment_methods/{payment_method}r1   rZ   r  r  r  r1   rZ   r  r@   r@   rA   _cls_retrieve_payment_method     
z%Customer._cls_retrieve_payment_methodc                 K   r  r  Nr@   r1   rZ   r  r@   r@   rA   retrieve_payment_method  s   
z Customer.retrieve_payment_methodc                 K   r  r  r@   r  rZ   r  r@   r@   rA   r     r  r  c              	   K   s.   t d| jddjt| dt|d|dS )r  r'   r  r  r  r  r  r  r!  r@   r@   rA   r   %  s   	c                    0   t d| jddjt|t|d|dI dH S )r  r'   r  r  r  r  Nr  r  r@   r@   rA   "_cls_retrieve_payment_method_async:     

z+Customer._cls_retrieve_payment_method_asyncc                    r  r  r@   r  r@   r@   rA   retrieve_payment_method_asyncP  s   
z&Customer.retrieve_payment_method_asyncc                    r  r  r@   r!  r@   r@   rA   r%  \  r  r#  c              	      s6   t d| jddjt| dt|d|dI dH S )r  r'   r  r  r  r  r  Nr  r!  r@   r@   rA   r%  g  s   	
kwargsr  c                 O   s   | j |ddi|S )  
        Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
        Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
        conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
        to an hour behind during outages. Search functionality is not available to merchants in India.
        
search_url/v1/customers/search)_searchr  argsr&  r@   r@   rA   search|  s   
zCustomer.searchc                    s   | j |ddi|I dH S )r'  r(  r)  N)_search_asyncr+  r@   r@   rA   search_async  s   
zCustomer.search_asyncc                 O   s   | j |i | S N)r-  auto_paging_iterr+  r@   r@   rA   search_auto_paging_iter  s   z Customer.search_auto_paging_iterc                    s   | j |i |I d H  S r0  )r/  r1  r+  r@   r@   rA   search_auto_paging_iter_async  s   z&Customer.search_auto_paging_iter_asyncrd   r#   c                 K   r  )
        Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance).
        r#   r  -/v1/customers/{customer}/balance_transactionsr  r  r  r  r@   r@   rA   create_balance_transaction     	z#Customer.create_balance_transactionc                    r  )r4  r#   r  r5  r  r  Nr  r  r@   r@   rA    create_balance_transaction_async     	
z)Customer.create_balance_transaction_asynctransactionr  c                 K   r  )
        Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance).
        r#   r  ;/v1/customers/{customer}/balance_transactions/{transaction}r1   r:  r  r  r  r1   r:  r  r@   r@   rA   retrieve_balance_transaction  r  z%Customer.retrieve_balance_transactionc                    r"  )r;  r#   r  r<  r=  r  Nr  r>  r@   r@   rA   "retrieve_balance_transaction_async  r$  z+Customer.retrieve_balance_transaction_asyncrg  c                 K   r  )x
        Most credit balance transaction fields are immutable, but you may update its description and metadata.
        r#   r  r<  r=  r  r  r>  r@   r@   rA   modify_balance_transaction  r  z#Customer.modify_balance_transactionc                    r"  )rA  r#   r  r<  r=  r  Nr  r>  r@   r@   rA    modify_balance_transaction_async	  r$  z)Customer.modify_balance_transaction_asyncr%  c                 K   r  )
        Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance).
        r#   r  r5  r  r  r  r  r@   r@   rA   list_balance_transactions"	  r  z"Customer.list_balance_transactionsc                    r  )rD  r#   r  r5  r  r  Nr  r  r@   r@   rA   list_balance_transactions_async6	  r
  z(Customer.list_balance_transactions_asyncr  r$   c                 K   r  )
        Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance).
        r$   r  @/v1/customers/{customer}/cash_balance_transactions/{transaction}r=  r  r  r>  r@   r@   rA   !retrieve_cash_balance_transactionJ	  r  z*Customer.retrieve_cash_balance_transactionc                    r"  )rG  r$   r  rH  r=  r  Nr  r>  r@   r@   rA   'retrieve_cash_balance_transaction_async`	  r$  z0Customer.retrieve_cash_balance_transaction_asyncr,  c                 K   r  )
        Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance).
        r$   r  2/v1/customers/{customer}/cash_balance_transactionsr  r  r  r  r@   r@   rA   list_cash_balance_transactionsv	  r  z'Customer.list_cash_balance_transactionsc                    r  )rK  r$   r  rL  r  r  Nr  r  r@   r@   rA   $list_cash_balance_transactions_async	  r
  z-Customer.list_cash_balance_transactions_asyncr  c                 K   r  )  
        When you create a new credit card, you must specify a customer or recipient on which to create it.

        If the card's owner has no default card, then the new card will become the default.
        However, if the owner already has a default, then it will not change.
        To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source.
        r  r   /v1/customers/{customer}/sourcesr  r  r   r   r  r  r   r  r@   r@   rA   create_source	  s   zCustomer.create_sourcec                    r  )rO  r  r  rP  r  r  Nr   r   r  r  r   r  r@   r@   rA   create_source_async	  s   
zCustomer.create_source_asyncr  c                 K   ,   t td | jddjt|t|d|dS )C
        Retrieve a specified source for a given customer.
        r  r  %/v1/customers/{customer}/sources/{id}r1   r  r  rQ  r  r1   r  r  r@   r@   rA   retrieve_source	     
zCustomer.retrieve_sourcec                    4   t td | jddjt|t|d|dI dH S )rV  r  r  rW  rX  r  NrS  rY  r@   r@   rA   retrieve_source_async	     

zCustomer.retrieve_source_asyncr~  c                 K   rU  )A
        Update a specified source for a given customer.
        r  r  rW  rX  r  rQ  rY  r@   r@   rA   modify_source	  r[  zCustomer.modify_sourcec                    r\  )r_  r  r  rW  rX  r  NrS  rY  r@   r@   rA   modify_source_async	
  r^  zCustomer.modify_source_asyncr  c                 K   rU  )A
        Delete a specified source for a given customer.
        r  r  rW  rX  r  rQ  rY  r@   r@   rA   delete_source
  r[  zCustomer.delete_sourcec                    r\  )rb  r  r  rW  rX  r  NrS  rY  r@   r@   rA   delete_source_async3
  r^  zCustomer.delete_source_asyncrb  c                 K   s*   t ttd  | jddjt|d|dS )8
        List sources for a specified customer.
        r  r  rP  r  r  )r   r   r   r  r  r   r  r@   r@   rA   list_sourcesH
  s   
zCustomer.list_sourcesc                    s2   t ttd  | jddjt|d|dI dH S )re  r  r  rP  r  r  N)r   r   r   r  r  r   r  r@   r@   rA   list_sources_asyncZ
  s   

zCustomer.list_sources_asyncr  c                 K   r  )=
        Creates a new tax_id object for a customer.
        r*   r   /v1/customers/{customer}/tax_idsr  r  r  r  r@   r@   rA   create_tax_idl
  r  zCustomer.create_tax_idc                    r  )rh  r*   r  ri  r  r  Nr  r  r@   r@   rA   create_tax_id_async~
  r  zCustomer.create_tax_id_asyncr  c                 K   r  )H
        Retrieves the tax_id object with the given identifier.
        r*   r  %/v1/customers/{customer}/tax_ids/{id}rX  r  r  rY  r@   r@   rA   retrieve_tax_id
     
zCustomer.retrieve_tax_idc                    r"  )rl  r*   r  rm  rX  r  Nr  rY  r@   r@   rA   retrieve_tax_id_async
     

zCustomer.retrieve_tax_id_asyncr  c                 K   r  )4
        Deletes an existing tax_id object.
        r*   r  rm  rX  r  r  rY  r@   r@   rA   delete_tax_id
  ro  zCustomer.delete_tax_idc                    r"  )rr  r*   r  rm  rX  r  Nr  rY  r@   r@   rA   delete_tax_id_async
  rq  zCustomer.delete_tax_id_asyncre  c                 K   r  );
        Returns a list of tax IDs for a customer.
        r*   r  ri  r  r  r  r  r@   r@   rA   list_tax_ids
  s   zCustomer.list_tax_idsc                    r  )ru  r*   r  ri  r  r  Nr  r  r@   r@   rA   list_tax_ids_async
  s   
zCustomer.list_tax_ids_asyncr  c                 K   r  )6
        Retrieves a customer's cash balance.
        r"   r  %/v1/customers/{customer}/cash_balancer  r  r  r  r@   r@   rA   retrieve_cash_balance  r7  zCustomer.retrieve_cash_balancec                    r  )rx  r"   r  ry  r  r  Nr  r  r@   r@   rA   retrieve_cash_balance_async  r9  z$Customer.retrieve_cash_balance_asyncri  c                 K   r  )D
        Changes the settings on a customer's cash balance.
        r"   r  ry  r  r  r  r  r@   r@   rA   modify_cash_balance0  r7  zCustomer.modify_cash_balancec                    r  )r|  r"   r  ry  r  r  Nr  r  r@   r@   rA   modify_cash_balance_asyncD  r9  z"Customer.modify_cash_balance_asyncc                   @   s
  e Zd ZU ed ed< ededed ddfdd	Ze	e
deded ddfd
dZe	ded ddfddZedded ddfddZededed ddfddZe	e
deded ddfddZe	ded ddfddZedded ddfddZdS )zCustomer.TestHelpersr0   _resource_clsr1   r  r!  r  r$   c                 K   r  )C
            Create an incoming testmode bank transfer
            r$   r  7/v1/test_helpers/customers/{customer}/fund_cash_balancer  r  r  r  r@   r@   rA   _cls_fund_cash_balance[  r7  z+Customer.TestHelpers._cls_fund_cash_balancec                 K   r  r  Nr@   r  r@   r@   rA   fund_cash_balanceo  r  z&Customer.TestHelpers.fund_cash_balancec                 K   r  r  r@   r  r@   r@   rA   r  y  r  r  c              	   K   s,   t d| jjddjt| jdd|dS )r  r$   r  r  r  r  r  )r   resourcer  r  r   r  r  r@   r@   rA   r    s   c                    r  )r  r$   r  r  r  r  Nr  r  r@   r@   rA   _cls_fund_cash_balance_async  r9  z1Customer.TestHelpers._cls_fund_cash_balance_asyncc                    r  r  r@   r  r@   r@   rA   fund_cash_balance_async  r  z,Customer.TestHelpers.fund_cash_balance_asyncc                    r  r  r@   r  r@   r@   rA   r    r  r  c              	      s4   t d| jjddjt| jdd|dI dH S )r  r$   r  r  r  r  r  N)r   r  r  r  r   r  r  r@   r@   rA   r    s   
N)r;   r<   r=   r   r?   classmethodr>   r   r  r   staticmethodr  r   r  r  r@   r@   r@   rA   TestHelpersX  sx   
 r  c                 C   s
   |  | S r0  )r  )r  r@   r@   rA   test_helpers  s   
zCustomer.test_helpers)rS   r   r   r   N)r;   r<   r=   __doc__r2   r   r   r?   r   rB   rR   rW   rc   r   rm   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r   r#  r*  r-  r0  r5  ra  rd  rf  rh  rk  rl  rr  rs  ru  rv  rw  rx  ry  r{  r|  r}  r  r  r  r  r  r  r  r  r  r  r  r   rl   r>   r   r   r   r   r   r   r  r   r  r  r  r   r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r  r   r#  r%  r	   r-  r/  r   r2  r   r3  r6  r8  r?  r@  rB  rC  rE  rF  rI  rJ  rM  rN  rR  rT  rZ  r]  r`  ra  rc  rd  rf  rg  rj  rk  rn  rp  rs  rt  rv  rw  rz  r{  r}  r~  r   r  propertyr  rQ   r@   r@   r@   rA   r0   6   sT  
 *.$T

UYD
S

7











ur0   N)Istripe._createable_api_resourcer   stripe._deletable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   %stripe._nested_resource_class_methodsr   stripe._request_optionsr   stripe._search_result_objectr	   stripe._searchable_api_resourcer
   stripe._stripe_objectr   stripe._test_helpersr   stripe._updateable_api_resourcer   stripe._utilr   r   typingr   r   r   r   r   r   r   r   r   typing_extensionsr   r   r   r   r   r   stripe._accountr   stripe._bank_accountr    stripe._cardr!   stripe._cash_balancer"   $stripe._customer_balance_transactionr#   )stripe._customer_cash_balance_transactionr$   stripe._discountr%   stripe._funding_instructionsr&   stripe._payment_methodr'   stripe._sourcer(   stripe._subscriptionr)   stripe._tax_idr*   stripe.test_helpers._test_clockr+   r0   r  r  r@   r@   r@   rA   <module>   s   , 	
                       6