o
    Bi4                     @   st   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 d dlmZmZmZ G dd	 d	eZd
S )    )RequestOptions)StripeService)sanitize_id)Calculation)CalculationLineItemService)Listcast)LiteralNotRequired	TypedDictc                	       s   e Zd Z fddZG dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZi i fdedddedefddZi i fdedddedefddZi fdddedefdd Zi fdddedefd!d"Z  ZS )#CalculationServicec                    s   t  | t| j| _d S )N)super__init__r   
_requestor
line_items)self	requestor	__class__ _/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/tax/_calculation_service.pyr      s   zCalculationService.__init__c                   @   s|   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< dS )CalculationService.CreateParamscurrencycustomer.CalculationService.CreateParamsCustomerDetailscustomer_detailsexpand'CalculationService.CreateParamsLineItemr   .CalculationService.CreateParamsShipFromDetailsship_from_details+CalculationService.CreateParamsShippingCostshipping_costtax_dateN)__name__
__module____qualname__str__annotations__r
   r   intr   r   r   r   CreateParams   s.   
 r)   c                   @   s^   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	< d
S )r   5CalculationService.CreateParamsCustomerDetailsAddressaddress)billingshippingaddress_source
ip_address3CalculationService.CreateParamsCustomerDetailsTaxIdtax_ids)customer_exemptnonereverse_chargetaxability_overrideN)r#   r$   r%   r
   r'   r	   r&   r   r   r   r   r   CreateParamsCustomerDetails;   s"   
 r6   c                   @   \   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< dS )	r*   Literal['']|strcitycountryline1line2postal_codestateNr#   r$   r%   r
   r'   r&   r   r   r   r   "CreateParamsCustomerDetailsAddressW      
 r@   c                   @   s$   e Zd ZU ed ed< 	 eed< dS )r0   )J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hr_oib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typevalueN)r#   r$   r%   r	   r'   r&   r   r   r   r    CreateParamsCustomerDetailsTaxIdq   s   
 Lr   c                   @   s`   e Zd ZU eed< 	 ee ed< 	 ee ed< 	 ee ed< 	 eed  ed< 	 ee ed< dS )	r   amountproductquantity	reference	exclusive	inclusivetax_behaviortax_codeN)r#   r$   r%   r(   r'   r
   r&   r	   r   r   r   r   CreateParamsLineItem   s   
 r   c                   @   s   e Zd ZU ded< dS )r   5CalculationService.CreateParamsShipFromDetailsAddressr+   N)r#   r$   r%   r'   r   r   r   r   CreateParamsShipFromDetails   s   
 r   c                   @   r7   )	r   r8   r9   r:   r;   r<   r=   r>   Nr?   r   r   r   r   "CreateParamsShipFromDetailsAddress   rA   r   c                   @   sH   e Zd ZU ee ed< 	 ee ed< 	 eed  ed< 	 ee ed< dS )r    r   shipping_rater   r   r   N)r#   r$   r%   r
   r(   r'   r&   r	   r   r   r   r   CreateParamsShippingCost  s   
 r   c                   @   s   e Zd ZU eee  ed< dS )!CalculationService.RetrieveParamsr   N)r#   r$   r%   r
   r   r&   r'   r   r   r   r   RetrieveParams  s   
 r   calculationparamsr   optionsreturnc              	   C   s&   t t| jddjt|dd||dS )X
        Retrieves a Tax Calculation object, if the calculation hasn't expired.
        get"/v1/tax/calculations/{calculation}r   apibase_addressr   r   )r   r   _requestformatr   r   r   r   r   r   r   r   retrieve  s   	zCalculationService.retrievec              	      s.   t t| jddjt|dd||dI dH S )r   r   r   r   r   r   N)r   r   _request_asyncr   r   r   r   r   r   retrieve_async/  s   	
z!CalculationService.retrieve_asyncr   c              	   C   s   t t| jddd||dS )Y
        Calculates tax based on the input and returns a Tax Calculation object.
        post/v1/tax/calculationsr   r   )r   r   r   r   r   r   r   r   r   createE  s   zCalculationService.createc              	      s"   t t| jddd||dI dH S )r   r   r   r   r   N)r   r   r   r   r   r   r   create_asyncX  s   
zCalculationService.create_async)r#   r$   r%   r   r   r)   r6   r@   r   r   r   r   r   r   r&   r   r   r   r   r   r   __classcell__r   r   r   r   r      sb    (U	


r   N)stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   stripe.tax._calculationr   )stripe.tax._calculation_line_item_servicer   typingr   r   typing_extensionsr	   r
   r   r   r   r   r   r   <module>   s   