
    _j_                         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 d dlmZmZmZ erd dlmZ d dlmZ d d	lmZ d d
lmZ  G d ded                   ZdS )    )CreateableAPIResource)
ListObject)StripeObject)class_method_variantsanitize_id)ClassVarListOptionalcastoverload)LiteralUnpackTYPE_CHECKING)CalculationCreateParams)CalculationListLineItemsParams)CalculationRetrieveParams)CalculationLineItemc            	          e Zd ZU dZdZeed                  ed<    G d de          Z	 G d de          Z
 G d d	e          Z G d
 de          Zeed<   	 eed<   	 ee         ed<   	 e	ed<   ee         ed<   	 ee         ed<   	 eed                  ed<   	 eed<   	 ed         ed<   	 ee
         ed<   	 ee         ed<   	 eed<   	 eed<   	 ee         ed<   	 eed<   	 eded         dd fd            Zeded         dd fd             Zed!eded"         ded         fd#            Zeed!eded"         ded         fd$                        Zeded"         ded         fd%            Z ed&          ded"         ded         fd'            Zed!eded"         ded         fd(            Zeed!eded"         ded         fd)                        Zeded"         ded         fd*            Z ed+          ded"         ded         fd,            Zededed-         dd fd.            Zededed-         dd fd/            Ze	e
eed0Z d1S )2Calculationz
    A Tax Calculation allows you to calculate the tax to collect from your customer.

    Related guide: [Calculate tax in your custom payment flow](https://docs.stripe.com/tax/custom)
    ztax.calculationOBJECT_NAMEc                       e Zd ZU  G d de          Z G d de          Zee         ed<   	 eed                  ed<   	 ee	         ed<   	 e
e         ed	<   	 ed
         ed<   	 eedZdS )Calculation.CustomerDetailsc                       e Zd ZU ee         ed<   	 eed<   	 ee         ed<   	 ee         ed<   	 ee         ed<   	 ee         ed<   dS )#Calculation.CustomerDetails.Addresscitycountryline1line2postal_codestateN__name__
__module____qualname__r
   str__annotations__     [/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/stripe/tax/_calculation.pyAddressr   !            3- LLL C=    C=    "#&&& C=    r(   r*   c                   2    e Zd ZU ed         ed<   	 eed<   dS )!Calculation.CustomerDetails.TaxId)qad_nrtae_trnal_tinam_tinao_tinar_cuitau_abnau_arnaw_tinaz_tinba_tinbb_tinbd_binbf_ifubg_uicbh_vatbj_ifubo_tinbr_cnpjbr_cpfbs_tinby_tinca_bn
ca_gst_hst	ca_pst_bc	ca_pst_mb	ca_pst_skca_qstcd_nifch_uidch_vatcl_tincm_niucn_tinco_nitcr_tincv_nifde_stndo_rcnec_ruceg_tines_cifet_tin
eu_oss_vateu_vatgb_vatge_vatgn_nifhk_brhr_oibhu_tinid_npwpil_vatin_gstis_vatjp_cnjp_rnjp_trnke_pinkg_tinkh_tinkr_brnkz_binla_tinli_uidli_vatlk_vatma_vatmd_vatme_pibmk_vatmr_nifmx_rfcmy_frpmy_itnmy_sstng_tinno_vatno_voecnp_pannz_gstom_vatpe_rucph_tinpl_nipro_tinrs_pibru_innru_kppsa_vatsg_gstsg_uensi_tinsn_nineasr_finsv_nitth_vattj_tintr_tintw_vattz_vatua_vatug_tinunknownus_einuy_rucuz_tinuz_vatve_rifvn_tinza_vatzm_tinzw_tintypevalueN)r"   r#   r$   r   r&   r%   r'   r(   r)   TaxIdr-   ;   sH         pr r r rf JJJ r(   r   address)billingshippingaddress_source
ip_addresstax_ids)customer_exemptnonereverse_chargetaxability_override)r   r   N)r"   r#   r$   r   r*   r   r
   r&   r   r%   r	   _inner_class_typesr'   r(   r)   CustomerDetailsr       s        	 	 	 	 	l 	 	 	4z	 z	 z	 z	 z	L z	 z	 z	x '""""	 !)>!?@@@@	 SM!!!	 e	 %7
 	
 	
 	
	 *1UCCr(   r   c                   >    e Zd ZU  G d de          Zeed<   deiZdS )Calculation.ShipFromDetailsc                       e Zd ZU ee         ed<   	 eed<   	 ee         ed<   	 ee         ed<   	 ee         ed<   	 ee         ed<   dS )#Calculation.ShipFromDetails.Addressr   r   r   r   r   r    Nr!   r'   r(   r)   r*   r      r+   r(   r*   r   N)r"   r#   r$   r   r*   r&   r   r'   r(   r)   ShipFromDetailsr      sU         	 	 	 	 	l 	 	 	4 '1r(   r   c                       e Zd ZU  G d de          Zeed<   	 eed<   	 ee         ed<   	 e	d         ed<   	 ee
e                  ed<   	 eed	<   	 deiZd
S )Calculation.ShippingCostc                       e Zd ZU  G d de          Z G d de          Zeed<   	 eed<   ed         ed<   	 e	e         ed	<   	 ed
         ed<   	 eed<   	 eedZ
dS )%Calculation.ShippingCost.TaxBreakdownc                   V    e Zd ZU eed<   	 eed<   	 ed         ed<   	 ee         ed<   dS )2Calculation.ShippingCost.TaxBreakdown.Jurisdictionr   display_name)r   r   countydistrictr    levelr    N)r"   r#   r$   r%   r&   r   r
   r'   r(   r)   Jurisdictionr      sj          "!!! D     }$$$ r(   r   c                   >    e Zd ZU eed<   	 eed<   	 ed         ed<   dS )4Calculation.ShippingCost.TaxBreakdown.TaxRateDetailsr   percentage_decimalamusement_taxcommunications_taxgsthstigstjct	lease_taxpstqstretail_delivery_feerst	sales_taxservice_taxvattax_typeN)r"   r#   r$   r%   r&   r   r'   r(   r)   TaxRateDetailsr     sX         !!!! %(''' "     r(   r   amountjurisdiction)destinationoriginsourcingtax_rate_detailsr   not_collectingnot_subject_to_taxnot_supportedportion_product_exemptportion_reduced_ratedportion_standard_ratedproduct_exemptproduct_exempt_holidayproportionally_ratedreduced_ratedr   standard_ratedtaxable_basis_reduced
zero_ratedtaxability_reasontaxable_amount)r   r   N)r"   r#   r$   r   r   r   intr&   r   r
   r   r'   r(   r)   TaxBreakdownr      s             |   (       : KKK '&&&56666 '~6666  '    "   !-$2" "r(   r   r   
amount_taxshipping_rate)	exclusive	inclusivetax_behaviortax_breakdowntax_codeN)r"   r#   r$   r   r   r   r&   r
   r%   r   r	   r   r'   r(   r)   ShippingCostr      s         Z	 Z	 Z	 Z	 Z	< Z	 Z	 Z	x 	 	  }$$$	 67777	  \ 23333	 	 .|<r(   r   c                   z    e Zd ZU  G d de          Zeed<   	 eed<   	 eed<   ed         ed<   	 eed<   	 deiZ	d	S )
Calculation.TaxBreakdownc                       e Zd ZU  G d de          Zee         ed<   	 ee         ed<   	 eed<   	 eed                  ed<   	 ee         ed<   	 eed	                  ed
<   	 deiZ	dS )'Calculation.TaxBreakdown.TaxRateDetailsc                   &    e Zd ZU eed<   	 eed<   dS )2Calculation.TaxBreakdown.TaxRateDetails.FlatAmountr   currencyN)r"   r#   r$   r   r&   r%   r'   r(   r)   
FlatAmountr   f  s/           r(   r   r   flat_amountr   )r   
percentage	rate_typer    r   r   N)
r"   r#   r$   r   r   r
   r%   r&   r   r   r'   r(   r)   r   r   e  s             \    c]""" "*---- !$###  (C DEEEE C=       $ #0!<r(   r   r   r   r   r   r   r   N)
r"   r#   r$   r   r   r   r&   boolr   r   r'   r(   r)   r   r   d  s         4	= 4	= 4	= 4	= 4	=\ 4	= 4	= 4	=l 	 	 )((("
 	
 	
 	
"	 	 1.Ar(   r   amount_totalr   customercustomer_details
expires_atidr   
line_itemslivemodeobjectship_from_detailsshipping_costtax_amount_exclusivetax_amount_inclusiver   tax_dateparamsr   returnc                 r    t          d|                     d|                                 |                    S )Y
        Calculates tax based on the input and returns a Tax Calculation object.
        r   postr  )r   _static_request	class_urlclsr  s     r)   createzCalculation.create  sB         
 
 	
r(   c                    K   t          d|                     d|                                 |           d{V           S )r  r   r  r  N)r   _static_request_asyncr  r  s     r)   create_asynczCalculation.create_async  sd       ++ ,        
 
 	
r(   calculationr   c                     t          t          d         |                     dd                    t	          |                    |                    S )s
        Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired.
        r   get-/v1/tax/calculations/{calculation}/line_itemsr  r  )r   r   r  formatr   r  r  r  s      r)   _cls_list_line_itemsz Calculation._cls_list_line_items  sc     ,-?FF +K 8 8 G       	
 	
 		
r(   c                     dS r  Nr'   r  r  s     r)   list_line_itemszCalculation.list_line_items,  s	     	r(   c                     dS r#  r'   selfr  s     r)   r%  zCalculation.list_line_items6  s	     	r(   r!  c                     t          t          d         |                     dd                    t	          |                     d                              |                    S )r  r   r  r  r  r  r  )r   r   _requestr  r   r  r'  s     r)   r%  zCalculation.list_line_items?  sk     ,-MM?FF +DHHTNN ; ; G      	
 	
 		
r(   c                    K   t          t          d         |                     dd                    t	          |                    |           d{V           S )r  r   r  r  r  r  N)r   r   r  r  r   r   s      r)   _cls_list_line_items_asyncz&Calculation._cls_list_line_items_asyncQ  s       ,-++?FF +K 8 8 G    ,        	
 	
 		
r(   c                 
   K   dS r#  r'   r$  s     r)   list_line_items_asyncz!Calculation.list_line_items_asynce  s       	r(   c                 
   K   dS r#  r'   r'  s     r)   r.  z!Calculation.list_line_items_asynco  s       	r(   r,  c                    K   t          t          d         |                     dd                    t	          |                     d                              |           d{V           S )r  r   r  r  r  r  r  N)r   r   _request_asyncr  r   r  r'  s     r)   r.  z!Calculation.list_line_items_asyncx  s       ,-%%?FF +DHHTNN ; ; G    &        	
 	
 		
r(   r   c                 @     | |fi |}|                                  |S )X
        Retrieves a Tax Calculation object, if the calculation hasn't expired.
        )refreshr  r  r  instances       r)   retrievezCalculation.retrieve  s2     3r$$V$$r(   c                 P   K    | |fi |}|                                  d{V  |S )r3  N)refresh_asyncr5  s       r)   retrieve_asynczCalculation.retrieve_async  sH       3r$$V$$$$&&&&&&&&&r(   )r   r  r  r   N)!r"   r#   r$   __doc__r   r   r   r&   r   r   r   r   r   r   r%   r
   r   r   r	   classmethodr   r  r  r!  r   staticmethodr%  r   r,  r.  r7  r:  r   r'   r(   r)   r   r      s          9JK'"345IIImD mD mD mD mD, mD mD mD^2 2 2 2 2, 2 2 2<u= u= u= u= u=| u= u= u=nXB XB XB XB XB| XB XB XBt  MMM sm &%%% 	 $9:;;;; NNN %&&&&  0000 L))))   %%%% MMM 
78
	
 
 
 [
 
78
	
 
 
 [
 

 9:
 
)	*	
 
 
 [
& $*+K$L	)	*   \ X ?@	)	*   X 011
?@
	)	*
 
 
 21
" 

 9:
 
)	*	
 
 
 [
& $*+K$L	)	*   \ X ?@	)	*   X 677
?@
	)	*
 
 
 87
"  &'B C	   [  &'B C	   [ ,,%%	 r(   r   N)stripe._createable_api_resourcer   stripe._list_objectr   stripe._stripe_objectr   stripe._utilr   r   typingr   r	   r
   r   r   typing_extensionsr   r   r   ,stripe.params.tax._calculation_create_paramsr   5stripe.params.tax._calculation_list_line_items_paramsr   .stripe.params.tax._calculation_retrieve_paramsr   !stripe.tax._calculation_line_itemr   r   r'   r(   r)   <module>rH     sZ   B A A A A A * * * * * * . . . . . . : : : : : : : : ; ; ; ; ; ; ; ; ; ; ; ; ; ; < < < < < < < < < < 
F                FEEEEEN
 N
 N
 N
 N
'6 N
 N
 N
 N
 N
r(   