
    jofc                         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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            	           e Zd Z fdZ G d de          Z G d de          Z G d de          Z G d d	e          Z G d
 de          Z	 G d de          Z
 G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d  d!e          Z G d" d#e          Z G d$ d%e          Z G d& d'e          Z G d( d)e          Z G d* d+e          Z G d, d-e          Z G d. d/e          Z G d0 d1e          Z G d2 d3e          Z G d4 d5e          Z G d6 d7e          Zi i fd8e d9d:d;e!d<e"fd=Z#i i fd8e d9d:d;e!d<e"fd>Z$i i fd8e d9d?d;e!d<e"fd@Z%i i fd8e d9d?d;e!d<e"fdAZ&i i fd8e d9dBd;e!d<e"fdCZ'i i fd8e d9dBd;e!d<e"fdDZ(i i fd8e d9dEd;e!d<e)fdFZ*i i fd8e d9dEd;e!d<e)fdGZ+i i fd9dHd;e!d<e,e"         fdIZ-i i fd9dHd;e!d<e,e"         fdJZ.i i fd9dKd;e!d<e"fdLZ/i i fd9dKd;e!d<e"fdMZ0i fd9dNd;e!d<e1e"         fdOZ2i fd9dNd;e!d<e1e"         fdPZ3 xZ4S )QCustomerServicec                    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__s     R/var/www/html/Alfredo/env/lib/python3.11/site-packages/stripe/_customer_service.pyr   zCustomerService.__init__    s    ###6tGG$EO%
 %
! *OO*
 *
&  <DOLL+DO<<;DOLL$FO%
 %
!!!    c                   T   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   bool r(   r'   CreateParamsr*   0   sT        NOOOO	 S!!!!	 ""KLLLL	 C     %%%%	 3	 DI&&&&	 $C((((	 &9
 	
 	
 	
	 :;;;;	 #	  +3////	 $C((((3	 'tCy1111	 $C((((	 >
 	
 	
 	
	 C    :;;;;	  >
 	
 	
 	
	 !9:
 	
 	
 	
	  $$$$	 d######r(   rP   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 )#CustomerService.CreateParamsAddresscitycountryline1line2postal_codestateNrH   rI   rJ   r   rM   rK   rO   r(   r'   CreateParamsAddressrR               #	 S!!!!	 3	 3	 !%%%%	 3	 	r(   rZ   c                   &    e Zd ZU ed         ed<   dS )r-   /CustomerService.CreateParamsCashBalanceSettingssettingsNrH   rI   rJ   r   rK   rO   r(   r'   CreateParamsCashBalancez'CustomerService.CreateParamsCashBalance   0         =
 	
 	
 	
	 	r(   r`   c                   2    e Zd ZU eed                  ed<   dS )r]   	automaticmanualmerchant_defaultreconciliation_modeNrH   rI   rJ   r   r   rK   rO   r(   r'   CreateParamsCashBalanceSettingsz/CustomerService.CreateParamsCashBalanceSettings   6         (=>
 	
 	
 	
	 	r(   ri   c                   n    e Zd ZU ed         ed<   	 ee         ed<   	 ee         ed<   	 ed         ed<   dS )r3   zHLiteral['']|List[CustomerService.CreateParamsInvoiceSettingsCustomField]custom_fieldsdefault_payment_methodfooterzGLiteral['']|CustomerService.CreateParamsInvoiceSettingsRenderingOptionsrendering_optionsNrH   rI   rJ   r   rK   rM   rO   r(   r'   CreateParamsInvoiceSettingsz+CustomerService.CreateParamsInvoiceSettings            "V
 	
 	
 	
	 !,C 0000	 C    	 'U
 	
 	
 	
	 	r(   rq   c                   &    e Zd ZU eed<   	 eed<   dS )6CustomerService.CreateParamsInvoiceSettingsCustomFieldr7   valueNrH   rI   rJ   rM   rK   rO   r(   r'   &CreateParamsInvoiceSettingsCustomFieldrt      /         				 


	 	r(   rw   c                   &    e Zd ZU ed         ed<   dS );CustomerService.CreateParamsInvoiceSettingsRenderingOptions;Literal['']|Literal['exclude_tax', 'include_inclusive_tax']amount_tax_displayNr_   rO   r(   r'   +CreateParamsInvoiceSettingsRenderingOptionsrz      0         'I
 	
 	
 	
	 	r(   r}   c                   >    e Zd ZU ded<   	 eed<   	 ee         ed<   dS )$CustomerService.CreateParamsShipping+CustomerService.CreateParamsShippingAddressr+   r7   r:   NrH   rI   rJ   rK   rM   r   rO   r(   r'   CreateParamsShippingr      J         >>>>	 				 3	 	r(   r   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 )r   rS   rT   rU   rV   rW   rX   NrY   rO   r(   r'   CreateParamsShippingAddressz+CustomerService.CreateParamsShippingAddress   r[   r(   r   c                   J    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rH   rI   rJ   r   rK   r   rO   r(   r'   CreateParamsTaxzCustomerService.CreateParamsTax  F          12222	 'w/H'IJJJJ	 	r(   r   c                   2    e Zd ZU ed         ed<   	 eed<   dS )rC   )I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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typeru   N)rH   rI   rJ   r   rK   rM   rO   r(   r'   CreateParamsTaxIdDatumz&CustomerService.CreateParamsTaxIdDatum  sH         HJ
 J	
 J	
 J	
V	 


	 	r(   r   c                       e Zd ZdS )$CustomerService.DeleteDiscountParamsNrH   rI   rJ   rO   r(   r'   DeleteDiscountParamsr   c          r(   r   c                       e Zd ZdS )CustomerService.DeleteParamsNr   rO   r(   r'   DeleteParamsr   f  r   r(   r   c                       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createdr0   ending_beforer1   limitstarting_afterrE   N)rH   rI   rJ   r   rK   rM   r   rL   rO   r(   r'   
ListParamsr   i  s         DEEEE	 3	 #3''''	 DI&&&&	 3	 $C((((	  $$$$	 	r(   r   c                   n    e Zd ZU ee         ed<   	 ee         ed<   	 ee         ed<   	 ee         ed<   dS )!CustomerService.ListParamsCreatedgtgteltlteN)rH   rI   rJ   r   rL   rK   rO   r(   r'   ListParamsCreatedr     so         	 	 	 	 	r(   r   c                   2    e Zd ZU eee                  ed<   dS )CustomerService.RetrieveParamsr1   N)rH   rI   rJ   r   r   rM   rK   rO   r(   r'   RetrieveParamsr     s+         DI&&&&	 	r(   r   c                   n    e Zd ZU eee                  ed<   	 ee         ed<   	 ee         ed<   	 eed<   dS )CustomerService.SearchParamsr1   r   pagequeryN)rH   rI   rJ   r   r   rM   rK   rL   rO   r(   r'   SearchParamsr     sk         DI&&&&	 3	 #	 


	 	r(   r   c                      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/   r0   r1   r2   +CustomerService.UpdateParamsInvoiceSettingsr4   r5   r6   r7   r8   r:   r;   r<   z0Literal['']|CustomerService.UpdateParamsShippingr=   r>   CustomerService.UpdateParamsTaxr@   rA   rB   rF   NrG   rO   r(   r'   UpdateParamsr     s        NOOOO	 S!!!!	 ""KLLLL	 C    #C((((	 !%%%%	 3	 DI&&&&	 $C((((	 &9
 	
 	
 	
	 :;;;;	 #	  +3////	 3	 'tCy1111	 $C((((	 >
 	
 	
 	
	 C    :;;;;	  >
 	
 	
 	
	 d######r(   r  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 )#CustomerService.UpdateParamsAddressrS   rT   rU   rV   rW   rX   NrY   rO   r(   r'   UpdateParamsAddressr    r[   r(   r  c                   &    e Zd ZU ed         ed<   dS )r   /CustomerService.UpdateParamsCashBalanceSettingsr^   Nr_   rO   r(   r'   UpdateParamsCashBalancez'CustomerService.UpdateParamsCashBalance"  ra   r(   r  c                   2    e Zd ZU eed                  ed<   dS )r  rc   rg   Nrh   rO   r(   r'   UpdateParamsCashBalanceSettingsz/CustomerService.UpdateParamsCashBalanceSettings+  rj   r(   r	  c                   n    e Zd ZU ed         ed<   	 ee         ed<   	 ee         ed<   	 ed         ed<   dS )r   zHLiteral['']|List[CustomerService.UpdateParamsInvoiceSettingsCustomField]rl   rm   rn   zGLiteral['']|CustomerService.UpdateParamsInvoiceSettingsRenderingOptionsro   Nrp   rO   r(   r'   UpdateParamsInvoiceSettingsz+CustomerService.UpdateParamsInvoiceSettings3  rr   r(   r  c                   &    e Zd ZU eed<   	 eed<   dS )6CustomerService.UpdateParamsInvoiceSettingsCustomFieldr7   ru   Nrv   rO   r(   r'   &UpdateParamsInvoiceSettingsCustomFieldr  I  rx   r(   r  c                   &    e Zd ZU ed         ed<   dS );CustomerService.UpdateParamsInvoiceSettingsRenderingOptionsr{   r|   Nr_   rO   r(   r'   +UpdateParamsInvoiceSettingsRenderingOptionsr  S  r~   r(   r  c                   >    e Zd ZU ded<   	 eed<   	 ee         ed<   dS )$CustomerService.UpdateParamsShipping+CustomerService.UpdateParamsShippingAddressr+   r7   r:   Nr   rO   r(   r'   UpdateParamsShippingr  [  r   r(   r  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 )r  rS   rT   rU   rV   rW   rX   NrY   rO   r(   r'   UpdateParamsShippingAddressz+CustomerService.UpdateParamsShippingAddressi  r[   r(   r  c                   J    e Zd ZU ed         ed<   	 eed                  ed<   dS )r   r   r   r   r   Nr   rO   r(   r'   UpdateParamsTaxzCustomerService.UpdateParamsTax  r   r(   r  customerparamsr   optionsreturnc                     t          t          |                     dd                    t	          |                    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  V1apiapi_modebase_addressr  r  r   r   _requestformatr   r$   r  r  r  s       r'   r   zCustomerService.delete  sc     MM*11(22 2   "  	 	
 
 	
r(   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )r  r   r!  r"  r#  r$  r%  Nr   r   _request_asyncr*  r   r+  s       r'   delete_asynczCustomerService.delete_async  s       %%*11(22 2   " & 	 	 	 	 	 	 	 	
 
 	
r(   r   c                     t          t          |                     dd                    t	          |                    dd||                    S ).
        Retrieves a Customer object.
        getr!  r"  r#  r$  r%  r(  r+  s       r'   retrievezCustomerService.retrieve  sc     MM*11(22 2   "  	 	
 
 	
r(   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )r1  r2  r!  r"  r#  r$  r%  Nr-  r+  s       r'   retrieve_asynczCustomerService.retrieve_async  s       %%*11(22 2   " & 	 	 	 	 	 	 	 	
 
 	
r(   r   c                     t          t          |                     dd                    t	          |                    dd||                    S )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+  s       r'   updatezCustomerService.update  sc     MM*11(22 2   "  	 	
 
 	
r(   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )r7  r8  r!  r"  r#  r$  r%  Nr-  r+  s       r'   update_asynczCustomerService.update_async  s       %%*11(22 2   " & 	 	 	 	 	 	 	 	
 
 	
r(   r   c                     t          t          |                     dd                    t	          |                    dd||                    S )G
        Removes the currently applied discount on a customer.
        r   !/v1/customers/{customer}/discountr"  r#  r$  r%  )r   r   r)  r*  r   r+  s       r'   delete_discountzCustomerService.delete_discount  sc     MM3::(22 ;   "  	 	
 
 	
r(   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )r=  r   r>  r"  r#  r$  r%  N)r   r   r.  r*  r   r+  s       r'   delete_discount_asyncz%CustomerService.delete_discount_async2  s       %%3::(22 ;   " & 	 	 	 	 	 	 	 	
 
 	
r(   r   c                 t    t          t          t                   |                     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.
        r2  /v1/customersr#  r$  r%  )r   r   r   r)  r$   r  r  s      r'   listzCustomerService.listI  sF     x MM"   

 

 
	
r(   c                    K   t          t          t                   |                     dddd||           d{V           S )rC  r2  rD  r#  r$  r%  N)r   r   r   r.  rE  s      r'   
list_asynczCustomerService.list_async]  sj       x %%" &        

 

 
	
r(   r*   c                 ^    t          t          |                     dddd||                    S )0
        Creates a new customer object.
        r8  rD  r#  r$  r%  )r   r   r)  rE  s      r'   createzCustomerService.createq  sA     MM"   

 

 
	
r(   c                 n   K   t          t          |                     dddd||           d{V           S )rJ  r8  rD  r#  r$  r%  N)r   r   r.  rE  s      r'   create_asynczCustomerService.create_async  se       %%" &        

 

 
	
r(   r   c                 t    t          t          t                   |                     dddd||                    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.
        r2  /v1/customers/searchr#  r$  r%  )r   r   r   r)  rE  s      r'   searchzCustomerService.search  sF     x(MM&"   

 

 
	
r(   c                    K   t          t          t                   |                     dddd||           d{V           S )rO  r2  rP  r#  r$  r%  N)r   r   r   r.  rE  s      r'   search_asynczCustomerService.search_async  sj       x(%%&" &        

 

 
	
r(   )5rH   rI   rJ   r   r   rP   rZ   r`   ri   rq   rw   r}   r   r   r   r   r   r   r   r   r   r   r  r  r  r	  r  r  r  r  r  r  rM   r   r   r   r/  r3  r5  r9  r;  r   r?  rA  r   rF  rH  rK  rM  r   rQ  rS  __classcell__)r&   s   @r'   r   r      su       
 
 
 
 
 X$ X$ X$ X$ X$y X$ X$ X$t    i   4    )       )       i   ,           i       y       i   4    )   R R R R R R R Rh    y       y       Y   <    I   $           y   $U$ U$ U$ U$ U$y U$ U$ U$n    i   4    )       )       i   ,           i       y       i   4    )    24"$	
 

 /
  	

 

 
 
 
4 24"$	
 

 /
  	

 

 
 
 
4 46"$	
 

 1
  	

 

 
 
 
4 46"$	
 

 1
  	

 

 
 
 
4 24"$	
 

 /
  	

 

 
 
 
8 24"$	
 

 /
  	

 

 
 
 
8 :<"$	
 

 7
  	

 

 
 
 
4 :<"$	
 

 7
  	

 

 
 
 
2 02"$
 
,
  
 
H		
 
 
 
, 02"$
 
,
  
 
H		
 
 
 
, 24"$
 
.
  
 
	
 
 
 
, 24"$
 
.
  
 
	
 
 
 
. #%
 
.
  
 
H	%	
 
 
 
4 #%
 
.
  
 
H	%	
 
 
 
 
 
 
 
r(   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   rO   r(   r'   <module>re     s   & % % % % %      M L L L L L                     A @ @ @ @ @ % % % % % % * * * * * * 2 2 2 2 2 2 ; ; ; ; ; ; 0 0 0 0 0 0 $ $ $ $ $ $ # # # # # # # # # # = = = = = = = = = =f
 f
 f
 f
 f
m f
 f
 f
 f
 f
r(   