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 d dlmZ d dlmZmZmZ d dl m!Z!m"Z"m#Z# G dd deZ$dS )    )Customer)!CustomerBalanceTransactionService)CustomerCashBalanceService)%CustomerCashBalanceTransactionService)"CustomerFundingInstructionsService)CustomerPaymentMethodService)CustomerPaymentSourceService)CustomerTaxIdService)Discount)
ListObject)RequestOptions)SearchResultObject)StripeService)sanitize_id)DictListcast)LiteralNotRequired	TypedDictc                	       s  e Zd Z fdd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 d-d. d.eZG d/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZi i fd9e d:d;d<e!d=e"fd>d?Z#i i fd9e d:d;d<e!d=e"fd@dAZ$i i fd9e d:dBd<e!d=e"fdCdDZ%i i fd9e d:dBd<e!d=e"fdEdFZ&i i fd9e d:dGd<e!d=e"fdHdIZ'i i fd9e d:dGd<e!d=e"fdJdKZ(i i fd9e d:dLd<e!d=e)fdMdNZ*i i fd9e d:dLd<e!d=e)fdOdPZ+i i fd:dQd<e!d=e,e" fdRdSZ-i i fd:dQd<e!d=e,e" fdTdUZ.i i fd:dVd<e!d=e"fdWdXZ/i i fd:dVd<e!d=e"fdYdZZ0i fd:d[d<e!d=e1e" fd\d]Z2i fd:d[d<e!d=e1e" fd^d_Z3  Z4S )`CustomerServicec                    sd   t  | t| j| _t| j| _t| j| _t	| j| _
t| j| _t| j| _t| j| _d S )N)super__init__r   
_requestorcash_balancer   balance_transactionsr   cash_balance_transactionsr   payment_sourcesr	   tax_idsr   payment_methodsr   funding_instructions)self	requestor	__class__ X/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_customer_service.pyr       s   
zCustomerService.__init__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 )!CustomerService.CreateParamsz/Literal['']|CustomerService.CreateParamsAddressaddressbalance'CustomerService.CreateParamsCashBalancer   coupondescriptionemailexpandinvoice_prefix+CustomerService.CreateParamsInvoiceSettingsinvoice_settingsLiteral['']|Dict[str, str]metadatanamenext_invoice_sequencepayment_methodphonepreferred_localespromotion_codez0Literal['']|CustomerService.CreateParamsShippingshippingsourceCustomerService.CreateParamsTaxtax0Literal['']|Literal['exempt', 'none', 'reverse']
tax_exempt&CustomerService.CreateParamsTaxIdDatumtax_id_data
test_clockvalidateN	__name__
__module____qualname__r   __annotations__intstrr   boolr%   r%   r%   r&   CreateParams0   sf   
 rL   c                   @   `   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#CustomerService.CreateParamsAddresscitycountryline1line2postal_codestateNrE   rF   rG   r   rJ   rH   r%   r%   r%   r&   CreateParamsAddress      
 rU   c                   @      e Zd ZU ed ed< dS )r*   /CustomerService.CreateParamsCashBalanceSettingssettingsNrE   rF   rG   r   rH   r%   r%   r%   r&   CreateParamsCashBalance   
   
 r[   c                   @      e Zd ZU eed  ed< dS )rX   	automaticmanualmerchant_defaultreconciliation_modeNrE   rF   rG   r   r   rH   r%   r%   r%   r&   CreateParamsCashBalanceSettings   
   
 rd   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 )r0   zHLiteral['']|List[CustomerService.CreateParamsInvoiceSettingsCustomField]custom_fieldsdefault_payment_methodfooterzGLiteral['']|CustomerService.CreateParamsInvoiceSettingsRenderingOptionsrendering_optionsNrE   rF   rG   r   rH   rJ   r%   r%   r%   r&   CreateParamsInvoiceSettings      
 rl   c                   @       e Zd ZU eed< 	 eed< dS )z6CustomerService.CreateParamsInvoiceSettingsCustomFieldr4   valueNrE   rF   rG   rJ   rH   r%   r%   r%   r&   &CreateParamsInvoiceSettingsCustomField   
   
 rq   c                   @   (   e Zd ZU ed ed< 	 ee ed< dS )z;CustomerService.CreateParamsInvoiceSettingsRenderingOptions;Literal['']|Literal['exclude_tax', 'include_inclusive_tax']amount_tax_displaytemplateNrk   r%   r%   r%   r&   +CreateParamsInvoiceSettingsRenderingOptions      
 rw   c                   @   .   e Zd ZU ded< 	 eed< 	 ee ed< dS )z$CustomerService.CreateParamsShipping+CustomerService.CreateParamsShippingAddressr(   r4   r7   NrE   rF   rG   rH   rJ   r   r%   r%   r%   r&   CreateParamsShipping      
 r|   c                   @   rM   )rz   rN   rO   rP   rQ   rR   rS   NrT   r%   r%   r%   r&   CreateParamsShippingAddress   rV   r~   c                   @   ,   e Zd ZU ed ed< 	 eed  ed< dS )r<   Literal['']|str
ip_addressdeferredimmediatelyvalidate_locationNrE   rF   rG   r   rH   r   r%   r%   r%   r&   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_vattypero   N)rE   rF   rG   r   rH   rJ   r%   r%   r%   r&   CreateParamsTaxIdDatum  s   
 Lr   c                   @      e Zd ZdS )$CustomerService.DeleteDiscountParamsNrE   rF   rG   r%   r%   r%   r&   DeleteDiscountParamsh      r   c                   @   r   )CustomerService.DeleteParamsNr   r%   r%   r%   r&   DeleteParamsk  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 )
CustomerService.ListParamsz%CustomerService.ListParamsCreated|intcreatedr-   ending_beforer.   limitstarting_afterrB   N)rE   rF   rG   r   rH   rJ   r   rI   r%   r%   r%   r&   
ListParamsn  s   
 r   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!CustomerService.ListParamsCreatedgtgteltlteN)rE   rF   rG   r   rI   rH   r%   r%   r%   r&   ListParamsCreated  s   
 r   c                   @   s   e Zd ZU eee  ed< dS )CustomerService.RetrieveParamsr.   N)rE   rF   rG   r   r   rJ   rH   r%   r%   r%   r&   RetrieveParams  s   
 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 )CustomerService.SearchParamsr.   r   pagequeryN)rE   rF   rG   r   r   rJ   rH   rI   r%   r%   r%   r&   SearchParams  s   
 r   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 )CustomerService.UpdateParamsz/Literal['']|CustomerService.UpdateParamsAddressr(   r)   'CustomerService.UpdateParamsCashBalancer   r+   default_sourcer,   r-   r.   r/   +CustomerService.UpdateParamsInvoiceSettingsr1   r2   r3   r4   r5   r7   r8   r9   z0Literal['']|CustomerService.UpdateParamsShippingr:   r;   CustomerService.UpdateParamsTaxr=   r>   r?   rC   NrD   r%   r%   r%   r&   UpdateParams  s\   
 r   c                   @   rM   )z#CustomerService.UpdateParamsAddressrN   rO   rP   rQ   rR   rS   NrT   r%   r%   r%   r&   UpdateParamsAddress  rV   r   c                   @   rW   )r   /CustomerService.UpdateParamsCashBalanceSettingsrY   NrZ   r%   r%   r%   r&   UpdateParamsCashBalance'  r\   r   c                   @   r]   )r   r^   rb   Nrc   r%   r%   r%   r&   UpdateParamsCashBalanceSettings0  re   r   c                   @   rf   )r   zHLiteral['']|List[CustomerService.UpdateParamsInvoiceSettingsCustomField]rg   rh   ri   zGLiteral['']|CustomerService.UpdateParamsInvoiceSettingsRenderingOptionsrj   Nrk   r%   r%   r%   r&   UpdateParamsInvoiceSettings8  rm   r   c                   @   rn   )z6CustomerService.UpdateParamsInvoiceSettingsCustomFieldr4   ro   Nrp   r%   r%   r%   r&   &UpdateParamsInvoiceSettingsCustomFieldN  rr   r   c                   @   rs   )z;CustomerService.UpdateParamsInvoiceSettingsRenderingOptionsrt   ru   rv   Nrk   r%   r%   r%   r&   +UpdateParamsInvoiceSettingsRenderingOptionsX  rx   r   c                   @   ry   )z$CustomerService.UpdateParamsShipping+CustomerService.UpdateParamsShippingAddressr(   r4   r7   Nr{   r%   r%   r%   r&   UpdateParamsShippingd  r}   r   c                   @   rM   )r   rN   rO   rP   rQ   rR   rS   NrT   r%   r%   r%   r&   UpdateParamsShippingAddressr  rV   r   c                   @   r   )r   r   r   r   r   Nr   r%   r%   r%   r&   UpdateParamsTax  r   r   customerparamsr   optionsreturnc              	   C   &   t t| jddjt|dd||dS )
        Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
        delete/v1/customers/{customer}r   apibase_addressr   r   r   r   _requestformatr   r!   r   r   r   r%   r%   r&   r       	zCustomerService.deletec              	      .   t t| jddjt|dd||dI dH S )r  r  r  r  r  r  Nr   r   _request_asyncr  r   r  r%   r%   r&   delete_async     	
zCustomerService.delete_asyncr   c              	   C   r  ).
        Retrieves a Customer object.
        getr  r  r  r  r
  r  r%   r%   r&   retrieve  r  zCustomerService.retrievec              	      r  )r  r  r  r  r  r  Nr  r  r%   r%   r&   retrieve_async  r  zCustomerService.retrieve_asyncr   c              	   C   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.
        postr  r  r  r  r
  r  r%   r%   r&   update  s   zCustomerService.updatec              	      r  )r  r  r  r  r  r  Nr  r  r%   r%   r&   update_async  s   
zCustomerService.update_asyncr   c              	   C   r  )G
        Removes the currently applied discount on a customer.
        r  !/v1/customers/{customer}/discountr  r  r  )r   r
   r  r  r   r  r%   r%   r&   delete_discount  r  zCustomerService.delete_discountc              	      r  )r  r  r  r  r  r  N)r   r
   r  r  r   r  r%   r%   r&   delete_discount_async4  r  z%CustomerService.delete_discount_asyncr   c              	   C      t tt | jddd||dS )
        Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
        r  /v1/customersr  r  )r   r   r   r  r!   r   r   r%   r%   r&   listJ  s   zCustomerService.listc              	      &   t tt | jddd||dI dH S )r!  r  r"  r  r  N)r   r   r   r  r#  r%   r%   r&   
list_async]  s   
zCustomerService.list_asyncr'   c              	   C   s   t t| jddd||dS )0
        Creates a new customer object.
        r  r"  r  r  )r   r   r  r#  r%   r%   r&   createp  s   zCustomerService.createc              	      s"   t t| jddd||dI dH S )r'  r  r"  r  r  N)r   r   r  r#  r%   r%   r&   create_async  s   
zCustomerService.create_asyncr   c              	   C   r   )  
        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.
        r  /v1/customers/searchr  r  )r   r   r   r  r#  r%   r%   r&   search  s   zCustomerService.searchc              	      r%  )r*  r  r+  r  r  N)r   r   r   r  r#  r%   r%   r&   search_async  s   
zCustomerService.search_async)5rE   rF   rG   r   r   rL   rU   r[   rd   rl   rq   rw   r|   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rJ   r   r   r  r  r  r  r  r  r
   r  r  r   r$  r&  r(  r)  r   r,  r-  __classcell__r%   r%   r#   r&   r      sR   Z	

UW	













r   N)%stripe._customerr   ,stripe._customer_balance_transaction_servicer   %stripe._customer_cash_balance_servicer   1stripe._customer_cash_balance_transaction_servicer   -stripe._customer_funding_instructions_servicer   'stripe._customer_payment_method_servicer   'stripe._customer_payment_source_servicer   stripe._customer_tax_id_servicer	   stripe._discountr
   stripe._list_objectr   stripe._request_optionsr   stripe._search_result_objectr   stripe._stripe_servicer   stripe._utilr   typingr   r   r   typing_extensionsr   r   r   r   r%   r%   r%   r&   <module>   s"   