
    +hk                         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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)    )util)CreateableAPIResource)
ListObject)RequestOptions)StripeObject)class_method_variant)ClassVarListOptionalcastoverload)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)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erM 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d#<   	 eed$<   	 ee   ed%<   	 eed&<   	 e	 	 	 	 d8d(ee   d)ee   d*ee   d+ee   d,ed-   d.d fd/       Ze	 	 	 d9d0ed(ee   d*ee   d+ee   d,ed1   d.ed   fd2       Ze e!	 	 	 d9d0ed(ee   d*ee   d+ee   d,ed1   d.ed   fd3              Z"e 	 d:d)ee   d,ed1   d.ed   fd4       Z" e#d5      	 d:d)ee   d,ed1   d.ed   fd6       Z"e	e
ed7Z$y');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/venv/lib/python3.12/site-packages/stripe/api_resources/tax/calculation.pyAddressr   "   sa    3- L C=  C=  "#& C= r'   r)   c                   *    e Zd ZU ed   ed<   	 eed<   y)!Calculation.CustomerDetails.TaxId)Cad_nrtae_trnar_cuitau_abnau_arnbg_uicbo_tinbr_cnpjbr_cpfca_bn
ca_gst_hst	ca_pst_bc	ca_pst_mb	ca_pst_skca_qstch_vatcl_tincn_tinco_nitcr_tin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li_uidmx_rfcmy_frpmy_itnmy_sstno_vatnz_gst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unknownus_einuy_rucve_rifvn_tinza_vattypevalueNr!   r"   r#   r   r%   r$   r&   r'   r(   TaxIdr+   <   s)    BD DJ Jr'   rr   address)billingshippingaddress_source
ip_addresstax_ids)customer_exemptnonereverse_chargetaxability_override)rs   rx   N)r!   r"   r#   r   r)   rr   r   r%   r   r$   r
   _inner_class_typesr&   r'   r(   CustomerDetailsr   !   s    	l 	4L	L L	\ '""	 !)>!?@@	 SM!	 e	 %7
 	
	 *1UC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rst	sales_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ry   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    | ( 6 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}    X	< X	t 	 	  }$	 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                   T    e Zd ZU ee   ed<   	 eed<   	 ee   ed<   	 eed      ed<   y)'Calculation.TaxBreakdown.TaxRateDetailsr   r   r    r   r   N)r!   r"   r#   r   r$   r%   r   r&   r'   r(   r   r     sP    c]" !$# C=    r'   r   r   r   r   r   r   r   N)
r!   r"   r#   r   r   r   r%   boolr   r}   r&   r'   r(   r   r     s`    	\ 	B 	 	 )("
 	
"	 	 1.Ar'   r   c                       e Zd ZU eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed	<   	 ed
   ed<   	 ed   ed<   y)Calculation.CreateParamscurrencyr$   customer'Calculation.CreateParamsCustomerDetailscustomer_details	List[str]expand Calculation.CreateParamsLineItem
line_items$Calculation.CreateParamsShippingCostshipping_costr   tax_dateN)r!   r"   r#   r$   r%   r   r
   r&   r'   r(   CreateParamsr   ^  s    M "%(( *9   ,, ?@@ ''MNN "%((r'   r   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)	r   r   r   r$   r   !Literal['exclusive', 'inclusive']r   r   Nr!   r"   r#   r   r%   r&   r'   r(   CreateParamsShippingCostz$Calculation.CreateParamsShippingCost~  sI    && 'u-- &&IJJ "%((r'   r   c                   r    e Zd ZU eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed	<   y
)r   r   r$   productr   quantity	referencer   r   r   N)r!   r"   r#   r   r%   r   r&   r'   r(   CreateParamsLineItemz Calculation.CreateParamsLineItem  sg    K !'' "%(( #5)) &&IJJ "%((r'   r   c                   f    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed	   ed
<   y)r   .Calculation.CreateParamsCustomerDetailsAddressrs   zLiteral['billing', 'shipping']rv   r$   rw   z2List[Calculation.CreateParamsCustomerDetailsTaxId]rx   z4Literal['customer_exempt', 'none', 'reverse_charge']r|   Nr   r&   r'   r(   CreateParamsCustomerDetailsz'Calculation.CreateParamsCustomerDetails  sj     @  ((HII $E** !D  "-F" r'   r   c                   *    e Zd ZU ed   ed<   	 eed<   y),Calculation.CreateParamsCustomerDetailsTaxId)Br,   r-   r.   r/   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   rj   rk   rl   rm   rn   ro   rp   Nrq   r&   r'   r(    CreateParamsCustomerDetailsTaxIdr     s)    AC CH J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   zLiteral['']|strr   r   r   r   r   r    N)r!   r"   r#   r   r%   r$   r&   r'   r(   "CreateParamsCustomerDetailsAddressz.Calculation.CreateParamsCustomerDetailsAddress  sk    /00 L 011 011 %%677 011r'   r   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)	Calculation.ListLineItemsParamsr$   ending_beforer   r   r   limitstarting_afterNr   r&   r'   r(   ListLineItemsParamsr   -  sH    &u--  ,, u%% (..r'   r   amount_totalr   r   r   
expires_atidr   r   livemodeobjectr   tax_amount_exclusivetax_amount_inclusiver   r   Napi_keyidempotency_keystripe_versionstripe_accountparamsr   returnc                 `    t        d| j                  d| j                         |||||            S )zU
        Calculates tax based on input and returns a Tax Calculation object.
        r   post)r   _static_request	class_url)clsr   r   r   r   r   s         r(   createzCalculation.createu  s=     
 	
r'   calculationr   c                     t        t        d   | j                  ddj                  t	        j
                  |            ||||            S )Z
        Retrieves the line items of a persisted tax calculation as a collection.
        r   get-/v1/tax/calculations/{calculation}/line_itemsr   )r   r   r   r   )r   r   r   formatr   sanitize_id)r   r   r   r   r   r   s         r(   _cls_list_line_itemsz Calculation._cls_list_line_items  s`     ,-?FF $ 0 0 = G   --   	
 	
r'   c                      yr   Nr&   )r   r   r   r   r   s        r(   list_line_itemszCalculation.list_line_items  s     	r'   c                      yr  r&   selfr   r   s      r(   r  zCalculation.list_line_items  s     	r'   r  c                     t        t        d   | j                  ddj                  t	        j
                  | j                  d                  ||            S )r   r   r   r   r   r   )r   r   )r   r   _requestr   r   r   r   r  s      r(   r  zCalculation.list_line_items  s`     ,-MM?FF $ 0 0$ @ G  !0  

 
	
r'   )r   r   r   )NNNN)NNN)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
   classmethodr   r   r  r   staticmethodr  r   r}   r&   r'   r(   r   r      s}    9JK'"345ID, DBs=| s=jCB| CBJ 	> 	@	y 	$	9 	4	) 	8K	y K	Z	 	4	. 	$  M sm &% 	 $9:;; N %&& L))   %% M  "&)-(,(,
#
 "#
 !	

 !
 34
 

 
0  "&(,(,

 #
 !	

 !
 :;
 
)	*
 
2  "&(,(,	

#
 !
 !	

 :;
 
)	*
  
  *.!# :; 
)	*	  01 *.
!#
 :;
 
)	*	
 2
* ,%%r'   r   N)striper   stripe.api_resources.abstractr    stripe.api_resources.list_objectr   stripe.request_optionsr   stripe.stripe_objectr   stripe.utilr   typingr	   r
   r   r   r   typing_extensionsr   r   r   r   r   .stripe.api_resources.tax.calculation_line_itemr   r   r&   r'   r(   <module>r     sG     ? 7 1 - , ; ;  
B'6 Br'   