o
    if_                     @   s   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rLd dlmZ d dlmZ d d	lmZ d d
lmZ G d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                	   @   s  e Zd ZU dZdZeed  ed< G dd deZ	G dd deZ
G dd	 d	eZG d
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d Zeded dd fd!d"Zed#eded$ ded fd%d&Zeed#eded$ ded fd'd(Zeded$ ded fd)d(Zed*ded$ ded fd+d(Zed#eded$ ded fd,d-Zeed#eded$ ded fd.d/Zeded$ ded fd0d/Zed1ded$ ded fd2d/Zededed3 dd fd4d5Zededed3 dd fd6d7Ze	e
eed8Z d9S ):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                   @   s   e Zd ZU G dd deZG d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 )z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 )z#Calculation.CustomerDetails.Addresscitycountryline1line2postal_codestateN__name__
__module____qualname__r	   str__annotations__ r"   r"   w/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/tax/_calculation.pyAddress!      
 r$   c                   @   s$   e Zd ZU ed ed< 	 eed< dS )z!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"   r#   TaxId;   s   
 q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"   r#   CustomerDetails    s    
 zr   c                   @   s.   e Zd ZU G dd deZeed< deiZdS )zCalculation.ShipFromDetailsc                   @   r   )z#Calculation.ShipFromDetails.Addressr   r   r   r   r   r   Nr   r"   r"   r"   r#   r$      r%   r$   r   N)r   r   r   r   r$   r!   r   r"   r"   r"   r#   ShipFromDetails   s   
 r   c                   @   sr   e Zd ZU G d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 )zCalculation.ShippingCostc                   @   s~   e Zd ZU G dd deZG d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 )z%Calculation.ShippingCost.TaxBreakdownc                   @   s<   e Zd ZU eed< 	 eed< 	 ed ed< 	 ee ed< dS )z2Calculation.ShippingCost.TaxBreakdown.Jurisdictionr   display_name)r   r   countydistrictr   levelr   N)r   r   r   r    r!   r   r	   r"   r"   r"   r#   Jurisdiction   s   
 r   c                   @   s.   e Zd ZU eed< 	 eed< 	 ed ed< dS )z4Calculation.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"   r#   TaxRateDetails  s   
 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"   r#   TaxBreakdown   s&   
 
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"   r#   ShippingCost   s   
 \r   c                   @   sZ   e Zd ZU G d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 )
zCalculation.TaxBreakdownc                   @   s~   e Zd ZU G d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 )z'Calculation.TaxBreakdown.TaxRateDetailsc                   @   s    e Zd ZU eed< 	 eed< dS )z2Calculation.TaxBreakdown.TaxRateDetails.FlatAmountr   currencyN)r   r   r   r   r!   r    r"   r"   r"   r#   
FlatAmountd  s
   
 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   c  s&   
 
r   r   r   r   r   r   r   N)
r   r   r   r   r   r   r!   boolr   r   r"   r"   r"   r#   r   b  s   
 6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                 K   s   t d| j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   r"   r"   r#   create  s   zCalculation.createc                    s"   t d| jd|  |dI dH S )r   r   r   r   N)r
   _static_request_asyncr   r   r"   r"   r#   create_async  s   
zCalculation.create_asynccalculationr   c                 K   s&   t td | jddjt|d|d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   r"   r"   r#   _cls_list_line_items  s   	z Calculation._cls_list_line_itemsc                 K      dS r   Nr"   r   r   r"   r"   r#   list_line_items*  s   zCalculation.list_line_itemsc                 K   r  r  r"   selfr   r"   r"   r#   r  4  s   r  c              	   K   s,   t td | jddjt| dd|dS )r   r   r   r   r   r   r   )r
   r   _requestr   r   r   r  r"   r"   r#   r  =  s   c                    s.   t td | jddjt|d|dI dH S )r   r   r   r   r   r   N)r
   r   r   r   r   r  r"   r"   r#   _cls_list_line_items_asyncO  s   	
z&Calculation._cls_list_line_items_asyncc                       dS r  r"   r  r"   r"   r#   list_line_items_asyncc  s   z!Calculation.list_line_items_asyncc                    r  r  r"   r  r"   r"   r#   r  m  s   r
  c              	      s4   t td | jddjt| dd|dI dH S )r   r   r   r   r   r   r   N)r
   r   _request_asyncr   r   r   r  r"   r"   r#   r  v  s   
r   c                 K   s   | |fi |}|   |S )X
        Retrieves a Tax Calculation object, if the calculation hasn't expired.
        )refreshr   r   r   instancer"   r"   r#   retrieve  s   zCalculation.retrievec                    s$   | |fi |}|  I dH  |S )r  N)refresh_asyncr  r"   r"   r#   retrieve_async  s   zCalculation.retrieve_async)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  r  r  r   r"   r"   r"   r#   r      s   
  .wZ

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"   r#   <module>   s   