
    HUh                         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 d dlmZmZmZmZmZ erd dlmZ  G d	 d
ed
         Zy)    )CreateableAPIResource)
ListObject)RequestOptions)StripeObject)class_method_variantsanitize_id)ClassVarDictListOptionalcastoverload)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)CalculationLineItemc            	       J   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 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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d0e d1   d2d fd3       Z!ed0e d1   d2d fd4       Z"ed5ed0e d6   d2ed&   fd7       Z#e$e%d5ed0e d6   d2ed&   fd8              Z&e$d0e d6   d2ed&   fd9       Z& e'd:      d0e d6   d2ed&   fd;       Z&ed5ed0e d6   d2ed&   fd<       Z(e$e%d5ed0e d6   d2ed&   fd=              Z)e$d0e d6   d2ed&   fd>       Z) e'd?      d0e d6   d2ed&   fd@       Z)ed%ed0e dA   d2d fdB       Z*ed%ed0e dA   d2d fdC       Z+e	e
eedDZ,yE)F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://stripe.com/docs/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y)Calculation.CustomerDetailsc                   r    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<   y)#Calculation.CustomerDetails.Addresscitycountryline1line2postal_codestateN__name__
__module____qualname__r   str__annotations__     W/var/www/html/Ryun_Seer/newvenv/lib/python3.12/site-packages/stripe/tax/_calculation.pyAddressr      a    3- L C=  C=  "#& C= r)   r+   c                   *    e Zd ZU ed   ed<   	 eed<   y)!Calculation.CustomerDetails.TaxId)o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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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.   9   s)    np pb J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 	4x	L x	t '""	 !)>!?@@	 SM!	 e	 %7
 	
	 *1UCr)   r   c                   6    e Zd ZU  G d de      Zeed<   deiZy)Calculation.ShipFromDetailsc                   r    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<   y)#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      s!    	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y
)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
y)%Calculation.ShippingCost.TaxBreakdownc                   H    e Zd ZU eed<   	 eed<   	 ed   ed<   	 ee   ed<   y)2Calculation.ShippingCost.TaxBreakdown.Jurisdictionr   display_name)r   r   countydistrictr!   levelr!   N)r#   r$   r%   r&   r'   r   r   r(   r)   r*   Jurisdictionr      sA     "! D   }$r)   r   c                   6    e Zd ZU eed<   	 eed<   	 ed   ed<   y)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      s3    !! %(' "  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    | ( : K '&5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	x 	 	  }$	 677	  \ 233	 	 .|<r)   r   c                   l    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	y	)
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	y)'Calculation.TaxBreakdown.TaxRateDetailsc                   $    e Zd ZU eed<   	 eed<   y)2Calculation.TaxBreakdown.TaxRateDetails.FlatAmountr   currencyN)r#   r$   r%   r   r'   r&   r(   r)   r*   
FlatAmountr   b  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   a  s    \  c]" "*-- !$#  (C D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   `  s`    4	=\ 4	=l 	 	 )("
 	
"	 	 1.Ar)   r   c                       e Zd ZU eed<   	 ee   ed<   	 ed   ed<   	 eee      ed<   	 ed   ed<   	 ed   ed	<   	 ed
   ed<   	 ee   ed<   y)Calculation.CreateParamsr   customer'Calculation.CreateParamsCustomerDetailscustomer_detailsexpand Calculation.CreateParamsLineItem
line_items'Calculation.CreateParamsShipFromDetailsship_from_details$Calculation.CreateParamsShippingCostshipping_costtax_dateN)r#   r$   r%   r&   r'   r   r   r   r(   r)   r*   CreateParamsr    s    	 c""	 &5
 	
	 DI&&	 ;<<	 '5
 	
	 ##IJJ	 c""	r)   r  c                   x    e Zd ZU ed   ed<   	 eed      ed<   	 ee   ed<   	 eed      ed<   	 eed      ed	<   y
)r  .Calculation.CreateParamsCustomerDetailsAddressr   r   r   r   ,Calculation.CreateParamsCustomerDetailsTaxIdr   r   r   N)r#   r$   r%   r   r'   r   r&   r   r(   r)   r*   CreateParamsCustomerDetailsz'Calculation.CreateParamsCustomerDetails  sw    MNN	 $G,A$BCC	  $$	 ?@
 	
	 )?@
 	
	r)   r  c                   r    e Zd ZU ed   ed<   	 eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)	r  Literal['']|strr   r   r   r   r    r!   Nr#   r$   r%   r   r'   r&   r(   r)   r*   "CreateParamsCustomerDetailsAddressz.Calculation.CreateParamsCustomerDetailsAddress  k    +,,	 	 ,--	 ,--	 !!233	 ,--	r)   r  c                   *    e Zd ZU ed   ed<   	 eed<   y)r  )nr/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   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   Nr   r(   r)   r*    CreateParamsCustomerDetailsTaxIdz,Calculation.CreateParamsCustomerDetailsTaxId  s)    mo
 o	
`	 
	r)   r  c                       e Zd ZU eed<   	 eeeef      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 eed      ed<   	 ee   ed<   y	)
r  r   metadataproductquantity	referencer   r   r   N)	r#   r$   r%   r   r'   r   r
   r&   r   r(   r)   r*   CreateParamsLineItemz Calculation.CreateParamsLineItem  s    	 d38n--	 S!!	 c""	 s##	 "'*B"CDD	 c""	r)   r  c                       e Zd ZU ded<   y)r	  .Calculation.CreateParamsShipFromDetailsAddressr   N)r#   r$   r%   r'   r(   r)   r*   CreateParamsShipFromDetailsz'Calculation.CreateParamsShipFromDetails  s    AA	r)   r"  c                   r    e Zd ZU ed   ed<   	 eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)	r!  r  r   r   r   r   r    r!   Nr  r(   r)   r*   "CreateParamsShipFromDetailsAddressz.Calculation.CreateParamsShipFromDetailsAddress  r  r)   r$  c                   Z    e Zd ZU ee   ed<   	 ee   ed<   	 eed      ed<   	 ee   ed<   y)r  r   r   r   r   r   N)r#   r$   r%   r   r   r'   r&   r   r(   r)   r*   CreateParamsShippingCostz$Calculation.CreateParamsShippingCost  sN    C  	 #3''	 "'*B"CDD	 c""	r)   r&  c                   Z    e Zd ZU ee   ed<   	 eee      ed<   	 ee   ed<   	 ee   ed<   y)Calculation.ListLineItemsParamsending_beforer  limitstarting_afterN)r#   r$   r%   r   r&   r'   r   r   r(   r)   r*   ListLineItemsParamsr(    sL    "3''	 DI&&	 3	 $C((	r)   r,  c                   $    e Zd ZU eee      ed<   y)Calculation.RetrieveParamsr  N)r#   r$   r%   r   r   r&   r'   r(   r)   r*   RetrieveParamsr.    s    DI&&	r)   r/  amount_totalr   r  r  
expires_atidr   r  livemodeobjectr
  r  tax_amount_exclusivetax_amount_inclusiver   r  paramsr  returnc                 Z    t        d| j                  d| j                         |            S )Y
        Calculates tax based on the input and returns a Tax Calculation object.
        r   postr7  )r   _static_request	class_urlclsr7  s     r*   createzCalculation.create0  s6        
 	
r)   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)r:  r   r;  r<  N)r   _static_request_asyncr>  r?  s     r*   create_asynczCalculation.create_async@  sD      ++ ,  
 	
s   ,97
	9calculationr(  c                 ~    t        t        d   | j                  ddj                  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rE  r<  )r   r   r=  formatr   r@  rE  r7  s      r*   _cls_list_line_itemsz Calculation._cls_list_line_itemsP  sQ     ,-?FF +K 8 G     	
 		
r)   c                      yrG  Nr(   rE  r7  s     r*   list_line_itemszCalculation.list_line_itemsd  s     	r)   c                      yrO  r(   selfr7  s     r*   rQ  zCalculation.list_line_itemsn  s     	r)   rM  c                     t        t        d   | j                  ddj                  t	        | j                  d                  |            S )rG  r   rH  rI  r2  rJ  r<  )r   r   _requestrK  r   rH  rS  s     r*   rQ  zCalculation.list_line_itemsw  sW     ,-MM?FF +DHHTN ; G    	
 		
r)   c                    K   t        t        d   | j                  ddj                  t	        |            |       d{         S 7 w)rG  r   rH  rI  rJ  r<  N)r   r   rC  rK  r   rL  s      r*   _cls_list_line_items_asyncz&Calculation._cls_list_line_items_async  s_      ,-++?FF +K 8 G   ,  	
 		
s   >A A	
	Ac                    K   ywrO  r(   rP  s     r*   list_line_items_asyncz!Calculation.list_line_items_async  s      	   c                    K   ywrO  r(   rS  s     r*   rZ  z!Calculation.list_line_items_async  s      	r[  rX  c                    K   t        t        d   | j                  ddj                  t	        | j                  d                  |       d{         S 7 w)rG  r   rH  rI  r2  rJ  r<  N)r   r   _request_asyncrK  r   rH  rS  s     r*   rZ  z!Calculation.list_line_items_async  sg      ,-%%?FF +DHHTN ; G   &  	
 		
s   AAA
	Ar.  c                 8     | |fi |}|j                          |S )X
        Retrieves a Tax Calculation object, if the calculation hasn't expired.
        )refreshr@  r2  r7  instances       r*   retrievezCalculation.retrieve  s$     r$V$r)   c                 T   K    | |fi |}|j                          d{    |S 7 w)r`  N)refresh_asyncrb  s       r*   retrieve_asynczCalculation.retrieve_async  s3      r$V$$$&&& 	's   (&()r  r
  r  r   N)-r#   r$   r%   __doc__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   classmethodr   rA  rD  rM  r   staticmethodrQ  r   rX  rZ  rd  rg  r   r(   r)   r*   r   r      sO    9JK'"345IkD, kDZ2, 2<u=| u=nXB| XBt$~ $Li 4Y 4w9 wry >i Y 49 $n $   M sm &% 	 $9:;; N %&&  00 L))   %% M 
89
	
 
 
89
	
 
 

 :;
 
)	*	
 
& $*+L$M	)	*   @A	)	*  01
@A
	)	*
 2
" 

 :;
 
)	*	
 
& $*+L$M	)	*   @A	)	*  67
@A
	)	*
 8
"  &'C D	   &'C D	  ,,%%	r)   r   N)stripe._createable_api_resourcer   stripe._list_objectr   stripe._request_optionsr   stripe._stripe_objectr   stripe._utilr   r   typingr	   r
   r   r   r   r   typing_extensionsr   r   r   r   r   !stripe.tax._calculation_line_itemr   r   r(   r)   r*   <module>rs     sC    B * 2 . : A A  EH'6 Hr)   