a
    !f1                     @   s   d dl mZmZ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 d dlmZ G dd ded ed ed Zd	S )
    )CreateableAPIResourceListableAPIResourceUpdateableAPIResource)
ListObject)RequestOptions)ClassVarDictListOptionalcast)LiteralNotRequired	TypedDictUnpack)
quote_plusc                	   @   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G dd deZeed< ee ed< eed< ee ed< eed< ee ed< eed< eed< ee ed< eed< eeeef  ed< ed ed< eed< ee ed< eed  ed< ed.ee ee ee ee ed d d d!d"Zed/ee ee ee ed# ed  d$d%d&Zeeed' d d(d)d*Zeeed+ d d(d,d-ZdS )0TaxRatean  
    Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.

    Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates)
    Ztax_rateOBJECT_NAMEc                   @   s   e Zd ZU ed ed< ed ed< ed ed< eed< ed ed< eed	< ed ed
< ed ed< eed< ed ed< ed ed< dS )TaxRate.CreateParamsboolactivestrcountrydescriptiondisplay_name	List[str]expand	inclusivejurisdictionzDict[str, str]metadata
percentagestateLiteral['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'pst', 'qst', 'rst', 'sales_tax', 'service_tax', 'vat']tax_typeN)__name__
__module____qualname__r   __annotations__r   r   float r(   r(   ^/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/tax_rate.pyCreateParams   s   
r*   c                   @   sb   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	< ed
 ed< ed ed< dS )TaxRate.ListParamsr   r   zTaxRate.ListParamsCreated|intcreatedr   Zending_beforer   r   r   intlimitZstarting_afterNr#   r$   r%   r   r&   r(   r(   r(   r)   
ListParamsL   s   
r0   c                   @   s>   e Zd ZU ed ed< ed ed< ed ed< ed ed< dS )zTaxRate.ListParamsCreatedr-   gtZgteltZlteNr/   r(   r(   r(   r)   ListParamsCreatedj   s
   
r3   c                   @   sz   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< ed ed	< ed
 ed< ed ed< ed ed< dS )TaxRate.ModifyParamsr   r   r   r   r   r   r   r   r   zLiteral['']|Dict[str, str]r   r    r!   r"   Nr/   r(   r(   r(   r)   ModifyParams|   s   
r5   c                   @   s   e Zd ZU ed ed< dS )TaxRate.RetrieveParamsr   r   Nr/   r(   r(   r(   r)   RetrieveParams   s   
r7   r   r   r,   r   r   Zeffective_percentageidr   r   Zlivemoder   objectr   r    )Zamusement_taxZcommunications_taxgstZhstZigstZjctZ	lease_taxZpstZqstrstZ	sales_taxZservice_taxZvatr"   Nr   )api_keyidempotency_keystripe_versionstripe_accountparamsreturnc                 K   s    t d| d|  |||||S )z)
        Creates a new tax rate.
        r   post)r   _static_request	class_url)clsr<   r=   r>   r?   r@   r(   r(   r)   create   s    zTaxRate.creater+   )r<   r>   r?   r@   rA   c                 K   s:   | j d|  ||||d}t|ts6tdt|j |S )z
        Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.
        get)r<   r>   r?   r@   z%Expected list object from API, got %s)rC   rD   
isinstancer   	TypeErrortyper#   )rE   r<   r>   r?   r@   resultr(   r(   r)   list  s    
zTaxRate.listr4   )r8   r@   rA   c                 K   s*   d|   t|f }td| jd||dS )z/
        Updates an existing tax rate.
        z%s/%sr   rB   )r@   )rD   r   r   rC   )rE   r8   r@   urlr(   r(   r)   modify2  s
    zTaxRate.modifyr6   c                 K   s   | |fi |}|   |S )z8
        Retrieves a tax rate with the given ID
        )refresh)rE   r8   r@   instancer(   r(   r)   retrieve?  s    zTaxRate.retrieve)NNNN)NNN)r#   r$   r%   __doc__r   r   r   r&   r   r*   r0   r   r3   r5   r7   r   r
   r   r-   r'   r   classmethodr   rF   r   rL   rN   rQ   r(   r(   r(   r)   r      s|   
0(       r   N)Zstripe.api_resources.abstractr   r   r   Z stripe.api_resources.list_objectr   Zstripe.request_optionsr   typingr   r   r	   r
   r   Ztyping_extensionsr   r   r   r   urllib.parser   r   r(   r(   r(   r)   <module>   s   
