
    _j
                         d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 e
r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dgiZ G d de          ZdS )    )StripeService)sanitize_id)Optionalcast)import_module)TYPE_CHECKING)RequestOptions)CalculationCreateParams)CalculationRetrieveParams)Calculation)CalculationLineItemService
line_itemsz)stripe.tax._calculation_line_item_servicer   c            	            e Zd ZU ded<    fdZd Z	 	 ddeded         d	ed
         ddfdZ	 	 ddeded         d	ed
         ddfdZ		 dddd	ed
         ddfdZ
	 dddd	ed
         ddfdZ xZS )CalculationServicer   r   c                 J    t                                          |           d S N)super__init__)self	requestor	__class__s     c/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/stripe/tax/_calculation_service.pyr   zCalculationService.__init__!   s!    #####    c                     	 t           |         \  }}t          t          |          |          }t          | | || j                             t          | |          S # t
          $ r t                      w xY wr   )_subservicesgetattrr   setattr
_requestorKeyErrorAttributeError)r   nameimport_fromserviceservice_classs        r   __getattr__zCalculationService.__getattr__$   s    	##/#5 K#k** M do..  
 4&&& 	# 	# 	# """	#s   AA A7Ncalculationparamsr   optionsr	   returnr   c                     t          d|                     dd                    t          |                    d||                    S )X
        Retrieves a Tax Calculation object, if the calculation hasn't expired.
        r   get"/v1/tax/calculations/{calculation}r&   apibase_addressr'   r(   )r   _requestformatr   r   r&   r'   r(   s       r   retrievezCalculationService.retrieve4   s`     MM4;; +K 8 8 <   #   
 
 	
r   c                    K   t          d|                     dd                    t          |                    d||           d{V           S )r+   r   r,   r-   r.   r/   r0   N)r   _request_asyncr3   r   r4   s       r   retrieve_asyncz!CalculationService.retrieve_asyncJ   s       %%4;; +K 8 8 <   # &        
 
 	
r   r
   c           
      R    t          d|                     ddd||                    S )Y
        Calculates tax based on the input and returns a Tax Calculation object.
        r   post/v1/tax/calculationsr/   r0   )r   r2   r   r'   r(   s      r   createzCalculationService.create`   s>     MM&"   	
 	
 		
r   c           
      b   K   t          d|                     ddd||           d{V           S )r:   r   r;   r<   r/   r0   N)r   r7   r=   s      r   create_asynczCalculationService.create_asyncs   sb       %%&" &        	
 	
 		
r   )NNr   )__name__
__module____qualname____annotations__r   r%   strr   r5   r8   r>   r@   __classcell__)r   s   @r   r   r      s{        ,,,,$ $ $ $ $# # #& 9=.2	
 

 45
 *+	

 

 
 
 
2 9=.2	
 

 45
 *+	

 

 
 
 
2 /3
 
)
 *+
 
	
 
 
 
, /3
 
)
 *+
 
	
 
 
 
 
 
 
 
r   r   N)stripe._stripe_servicer   stripe._utilr   typingr   r   	importlibr   typing_extensionsr   stripe._request_optionsr	   ,stripe.params.tax._calculation_create_paramsr
   .stripe.params.tax._calculation_retrieve_paramsr   stripe.tax._calculationr   )stripe.tax._calculation_line_item_servicer   r   r    r   r   <module>rR      sD   1 0 0 0 0 0 $ $ $ $ $ $ ! ! ! ! ! ! ! ! # # # # # # + + + + + + 666666           433333     
 3$f
 f
 f
 f
 f
 f
 f
 f
 f
 f
r   