o
    Âi;9  ã                   @   s  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 d dlmZmZmZmZmZmZ d d	lmZmZmZ erxd 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' d dl(m)Z) G dd„ ded ed ed ƒZ*dS )é    )ÚCreateableAPIResource)ÚExpandableField)Ú
ListObject)ÚListableAPIResource)ÚStripeObject)ÚUpdateableAPIResource)Úclass_method_variantÚsanitize_id)ÚClassVarÚDictÚListÚOptionalÚcastÚoverload)ÚLiteralÚUnpackÚTYPE_CHECKING)ÚCustomer)ÚCreditGrantCreateParams)ÚCreditGrantExpireParams)ÚCreditGrantListParams)ÚCreditGrantModifyParams)ÚCreditGrantRetrieveParams)ÚCreditGrantVoidGrantParams)Ú	TestClockc                   @   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
e	ed< e
ed	< 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f ed< 	 ee ed< 	 ed ed< 	 ee ed< 	 eed  ed< 	 eed< 	 e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d fd#d$„ƒZ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(ƒded" dd fd)d&„ƒZededed" dd fd*d+„ƒZ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/ƒded" dd fd0d-„ƒZeded1 ded  fd2d3„ƒZeded1 ded  fd4d5„ƒZededed6 dd fd7d8„ƒZededed6 dd fd9d:„ƒZ ededed; dd fd<d=„ƒZ!ededed; dd fd>d?„ƒZ"ededed@ dd fdAdB„ƒZ#eededed@ dd fdCdD„ƒƒZ$eded@ dd fdEdD„ƒZ$edFƒded@ dd fdGdD„ƒZ$ededed@ dd fdHdI„ƒZ%eededed@ dd fdJdK„ƒƒZ&eded@ dd fdLdK„ƒZ&edMƒded@ dd fdNdK„ƒZ&e	e
dOœZ'dPS )QÚCreditGrantzá
    A credit grant is an API resource that documents the allocation of some billing credits to a customer.

    Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
    zbilling.credit_grantÚOBJECT_NAMEc                   @   sB   e Zd ZU G dd„ deƒZee ed< 	 ed ed< 	 deiZdS )zCreditGrant.Amountc                   @   s    e Zd ZU eed< 	 eed< dS )zCreditGrant.Amount.MonetaryÚcurrencyÚvalueN)Ú__name__Ú
__module__Ú__qualname__ÚstrÚ__annotations__Úint© r%   r%   ú|/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/billing/_credit_grant.pyÚMonetary4   s
   
 r'   ÚmonetaryÚtypeN)	r   r    r!   r   r'   r   r#   r   Ú_inner_class_typesr%   r%   r%   r&   ÚAmount3   s   
 
r+   c                   @   s.   e Zd ZU G dd„ deƒZeed< deiZdS )zCreditGrant.ApplicabilityConfigc                   @   sJ   e Zd ZU G dd„ deƒZeed  ed< 	 eee  ed< 	 deiZ	dS )z%CreditGrant.ApplicabilityConfig.Scopec                   @   s   e Zd ZU ee ed< dS )z+CreditGrant.ApplicabilityConfig.Scope.PriceÚidN)r   r    r!   r   r"   r#   r%   r%   r%   r&   ÚPriceJ   s   
 r-   ÚmeteredÚ
price_typeÚpricesN)
r   r    r!   r   r-   r   r   r#   r   r*   r%   r%   r%   r&   ÚScopeI   s   
 r1   ÚscopeN)r   r    r!   r   r1   r#   r*   r%   r%   r%   r&   ÚApplicabilityConfigH   s   
 r3   ÚamountÚapplicability_config)ÚpaidÚpromotionalÚcategoryÚcreatedr   ÚcustomerÚeffective_atÚ
expires_atr,   ÚlivemodeÚmetadataÚnameÚobjectÚpriorityr   Ú
test_clockÚupdatedÚ	voided_atÚparamsr   Úreturnc                 K   s   t d| jd|  ¡ |dƒS )ú)
        Creates a credit grant.
        r   Úpost©rE   )r   Ú_static_requestÚ	class_url©ÚclsrE   r%   r%   r&   Úcreate˜   s   ýþzCreditGrant.createc                 Ë   s"   t d| jd|  ¡ |dI dH ƒS )rG   r   rH   rI   N)r   Ú_static_request_asyncrK   rL   r%   r%   r&   Úcreate_async¨   s   €
ýþzCreditGrant.create_asyncr   c                 K   ó"   t d| jddjt|ƒd|dƒS )ú)
        Expires a credit grant.
        r   rH   ú%/v1/billing/credit_grants/{id}/expire©r,   rI   ©r   rJ   Úformatr	   ©rM   r,   rE   r%   r%   r&   Ú_cls_expire¸   ó   ÿûþzCreditGrant._cls_expirec                 K   ó   dS ©rR   Nr%   ©r,   rE   r%   r%   r&   ÚexpireÊ   ó   zCreditGrant.expirec                 K   rZ   r[   r%   ©ÚselfrE   r%   r%   r&   r]   Ô   ó   rX   c              	   K   ó(   t d| jddjt|  d¡ƒd|dƒS )rR   r   rH   rS   r,   rT   rI   ©r   Ú_requestrV   r	   Úgetr_   r%   r%   r&   r]   Ý   ó   ÿûþc                 Ë   ó*   t d| jddjt|ƒd|dI dH ƒS )rR   r   rH   rS   rT   rI   N©r   rO   rV   r	   rW   r%   r%   r&   Ú_cls_expire_asyncï   ó   €ÿ
ûþzCreditGrant._cls_expire_asyncc                 Ë   ó   dS r[   r%   r\   r%   r%   r&   Úexpire_async  ó   €zCreditGrant.expire_asyncc                 Ë   rk   r[   r%   r_   r%   r%   r&   rl     ó   €ri   c              	   Ë   ó0   t d| jddjt|  d¡ƒd|dI dH ƒS )rR   r   rH   rS   r,   rT   rI   N©r   Ú_request_asyncrV   r	   re   r_   r%   r%   r&   rl     ó   €ÿ
ûþr   c                 K   s4   | j d|  ¡ |d}t|tƒstdt|ƒj ƒ‚|S )ú3
        Retrieve a list of credit grants.
        re   rI   ú%Expected list object from API, got %s)rJ   rK   Ú
isinstancer   Ú	TypeErrorr)   r   ©rM   rE   Úresultr%   r%   r&   Úlist&  s   ý
ÿÿzCreditGrant.listc                 Ë   s<   | j d|  ¡ |dI dH }t|tƒstdt|ƒj ƒ‚|S )rs   re   rI   Nrt   )rO   rK   ru   r   rv   r)   r   rw   r%   r%   r&   Ú
list_async:  s   €ý
ÿÿzCreditGrant.list_asyncr   c                 K   s*   d|   ¡ t|ƒf }td| jd||dƒS )ú)
        Updates a credit grant.
        ú%s/%sr   rH   rI   )rK   r	   r   rJ   ©rM   r,   rE   Úurlr%   r%   r&   ÚmodifyN  s   ýþzCreditGrant.modifyc                 Ë   s2   d|   ¡ t|ƒf }td| jd||dI dH ƒS )r{   r|   r   rH   rI   N)rK   r	   r   rO   r}   r%   r%   r&   Úmodify_async_  s   €
ýþzCreditGrant.modify_asyncr   c                 K   s   | |fi |¤Ž}|  ¡  |S )ú+
        Retrieves a credit grant.
        )Úrefresh©rM   r,   rE   Úinstancer%   r%   r&   Úretrievep  s   zCreditGrant.retrievec                 Ë   s$   | |fi |¤Ž}|  ¡ I dH  |S )r   N)Úrefresh_asyncrƒ   r%   r%   r&   Úretrieve_async{  s   €zCreditGrant.retrieve_asyncr   c                 K   rQ   )ú'
        Voids a credit grant.
        r   rH   ú#/v1/billing/credit_grants/{id}/voidrT   rI   rU   rW   r%   r%   r&   Ú_cls_void_grant†  rY   zCreditGrant._cls_void_grantc                 K   rZ   ©rˆ   Nr%   r\   r%   r%   r&   Ú
void_grant˜  r^   zCreditGrant.void_grantc                 K   rZ   r‹   r%   r_   r%   r%   r&   rŒ   ¢  ra   rŠ   c              	   K   rb   )rˆ   r   rH   r‰   r,   rT   rI   rc   r_   r%   r%   r&   rŒ   «  rf   c                 Ë   rg   )rˆ   r   rH   r‰   rT   rI   Nrh   rW   r%   r%   r&   Ú_cls_void_grant_async½  rj   z!CreditGrant._cls_void_grant_asyncc                 Ë   rk   r‹   r%   r\   r%   r%   r&   Úvoid_grant_asyncÏ  rm   zCreditGrant.void_grant_asyncc                 Ë   rk   r‹   r%   r_   r%   r%   r&   rŽ   Ù  rn   r   c              	   Ë   ro   )rˆ   r   rH   r‰   r,   rT   rI   Nrp   r_   r%   r%   r&   rŽ   â  rr   )r4   r5   N)(r   r    r!   Ú__doc__r   r
   r   r#   r   r+   r3   r$   r   r   r"   Úboolr   Úclassmethodr   rN   rP   rX   r   Ústaticmethodr]   r   ri   rl   r   ry   rz   r   r€   r…   r‡   rŠ   rŒ   r   rŽ   r*   r%   r%   r%   r&   r   $   s¦  
 ÿÿþÿþÿÿþÿÿþÿþÿþÿÿþÿÿþÿþÿþÿþÿþÿÿþÿÿþÿÿþ
ÿÿþ
ÿÿþÿÿþÿþÿþÿÿþÿÿþÿþÿþ
þr   N)+Ústripe._createable_api_resourcer   Ústripe._expandable_fieldr   Ústripe._list_objectr   Ústripe._listable_api_resourcer   Ústripe._stripe_objectr   Ústripe._updateable_api_resourcer   Ústripe._utilr   r	   Útypingr
   r   r   r   r   r   Útyping_extensionsr   r   r   Ústripe._customerr   Ú1stripe.params.billing._credit_grant_create_paramsr   Ú1stripe.params.billing._credit_grant_expire_paramsr   Ú/stripe.params.billing._credit_grant_list_paramsr   Ú1stripe.params.billing._credit_grant_modify_paramsr   Ú3stripe.params.billing._credit_grant_retrieve_paramsr   Ú5stripe.params.billing._credit_grant_void_grant_paramsr   Ústripe.test_helpers._test_clockr   r   r%   r%   r%   r&   Ú<module>   s.    
ý