
    +hB              	           d dl mZmZmZ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mZmZmZmZ d dlmZmZmZmZmZ d dlmZ  G d	 d
ed
   ed
   ed
   ed
         Zy)    )CreateableAPIResourceDeletableAPIResourceListableAPIResourceUpdateableAPIResource)
ListObject)RequestOptions)StripeObject)class_method_variant)ClassVarDictListOptionalcastoverload)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)
quote_plusc                      e Zd ZU dZdZeed      ed<    G d de      Z	 G d de      Z
erc G d d	e      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zee   ed<   	 ee	   ed<   eed<   	 ee   ed<   	 eeee
f      ed<   	 ed   ed <   	 ee   ed!<   	 eed"<   	 eed#<   	 ee   ed$<   	 eeeef      ed%<   	 ee   ed&<   	 ed   ed'<   	 ee   ed(<   	 ee   ed)<   	 eed*<   	 eed+<   	 eed,      ed-<   	 e	 	 	 	 dEd/ee   d0ee   d1ee   d2ee   d3ed4   d5d fd6       Zed7ed3ed8   d5d fd9       Z e!e"d7ed3ed8   d5d fd:              Z#e!d3ed8   d5d fd;       Z# e$d<      d3ed8   d5d fd=       Z#e	 	 	 dFd/ee   d1ee   d2ee   d3ed>   d5e%d    f
d?       Z&ed"ed3ed@   d5d fdA       Z'ed"ed3edB   d5d fdC       Z(e	e
dDZ)y.)GCoupona+  
    A coupon contains information about a percent-off or amount-off discount you
    might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices),
    [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents).
    couponOBJECT_NAMEc                       e Zd ZU ee   ed<   y)Coupon.AppliesToproductsN)__name__
__module____qualname__r   str__annotations__     N/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/coupon.py	AppliesTor   &   s    s)	r$   r&   c                       e Zd ZU eed<   y)Coupon.CurrencyOptions
amount_offNr   r   r    intr"   r#   r$   r%   CurrencyOptionsr(   ,   s    	r$   r,   c                       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<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Coupon.CreateParamsr+   r)   Coupon.CreateParamsAppliesTo
applies_tor!   currencyz-Dict[str, Coupon.CreateParamsCurrencyOptions]currency_optionsz'Literal['forever', 'once', 'repeating']durationduration_in_months	List[str]expandidmax_redemptionsLiteral['']|Dict[str, str]metadatanamefloatpercent_off	redeem_byNr   r   r    r   r"   r#   r$   r%   CreateParamsr.   4   s    #E** $$BCC "%(( *?  ""KLL !,E 22  ,, E"" )// "">?? e$$ %W-- #5))r$   r@   c                       e Zd ZU eed<   y)"Coupon.CreateParamsCurrencyOptionsr)   Nr*   r#   r$   r%   CreateParamsCurrencyOptionsrB   l       Or$   rC   c                       e Zd ZU ed   ed<   y)r/   r5   r   Nr?   r#   r$   r%   CreateParamsAppliesTozCoupon.CreateParamsAppliesTor   s    !+..r$   rF   c                       e Zd Zy)Coupon.DeleteParamsN)r   r   r    r#   r$   r%   DeleteParamsrH   x   s    r$   rI   c                   f    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	<   y
)Coupon.ListParamszCoupon.ListParamsCreated|intcreatedr!   ending_beforer5   r6   r+   limitstarting_afterNr?   r#   r$   r%   
ListParamsrK   {   s[     !?@@ 'u--  ,, u%% (..r$   rP   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Coupon.ListParamsCreatedr+   gtgteltlteNr?   r#   r$   r%   ListParamsCreatedrR      sH    E"" U## E"" U##r$   rW   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y	)
Coupon.ModifyParamsz-Dict[str, Coupon.ModifyParamsCurrencyOptions]r2   r5   r6   r9   r:   r!   r;   Nr?   r#   r$   r%   ModifyParamsrY      sN    )?   ,, "">?? e$$r$   rZ   c                       e Zd ZU eed<   y)"Coupon.ModifyParamsCurrencyOptionsr)   Nr*   r#   r$   r%   ModifyParamsCurrencyOptionsr\      rD   r$   r]   c                       e Zd ZU ed   ed<   y)Coupon.RetrieveParamsr5   r6   Nr?   r#   r$   r%   RetrieveParamsr_      s    ,,r$   r`   r)   r0   rL   r1   r2   )foreveronce	repeatingr3   r4   r7   livemoder8   r:   r;   objectr=   r>   times_redeemedvalidTdeletedNapi_keyidempotency_keystripe_versionstripe_accountparamsr.   returnc                 `    t        d| j                  d| j                         |||||            S )a  
        You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.

        A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.
        r   post)r   _static_request	class_url)clsri   rj   rk   rl   rm   s         r%   createzCoupon.create	  s=     
 	
r$   sidrH   c                 z    | j                         dt        |      }t        d| j                  d||            S )D  
        You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API.
        /r   deleterm   rr   r   r   rq   )rs   ru   rm   urls       r%   _cls_deletezCoupon._cls_delete$  s=     *S/:#f=
 	
r$   c                      yrw   Nr#   )ru   rm   s     r%   ry   zCoupon.delete1  s     	r$   c                      yr   r#   selfrm   s     r%   ry   zCoupon.delete9  s    
 	r$   r}   c                 F    | j                  d| j                         |      S )rw   ry   rz   )_request_and_refreshinstance_urlr   s     r%   ry   zCoupon.delete@  s.     (( ) 
 	
r$   rK   c                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )z1
        Returns a list of your coupons.
        get)ri   rk   rl   rm   z%Expected list object from API, got %s)rq   rr   
isinstancer   	TypeErrortyper   )rs   ri   rk   rl   rm   results         r%   listzCoupon.listM  sf     $$MMO)) % 
 &*-7<((* 
 r$   rY   c                 z    | j                         dt        |      }t        d| j                  d||            S )z
        Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
        rx   r   rp   rz   r{   )rs   r7   rm   r|   s       r%   modifyzCoupon.modifyi  s=     *R.9F;
 	
r$   r_   c                 8     | |fi |}|j                          |S )z9
        Retrieves the coupon with the given ID.
        )refresh)rs   r7   rm   instances       r%   retrievezCoupon.retrievev  s$     r$V$r$   )r0   r2   )NNNN)NNN)*r   r   r    __doc__r   r   r   r"   r	   r&   r,   r   r   r@   r   rC   rF   rI   rP   rW   rZ   r]   r`   r   r+   r!   r   boolr<   classmethodr   rt   r}   r   staticmethodry   r
   r   r   r   r   _inner_class_typesr#   r$   r%   r   r      s    08K'(+,7L ,  6	> 6	p	) 		I 		> 		 	,		 	$	> 	(	) 		^ 	  ##L sm tC$89:: 455 !% 	G N c]" tCH~&& 3- H %  }  K gdm$$  "&)-(,(,
#
 "#
 !	

 !
 ./
 

 
4 



!'(=!>

	

 

 C 6*?#@ X    v&;<    -(

45

	

 )

  "&(,(,	# ! !	
 ,- 
H	 6 



 &'< =

	

 

  &'> ?	   +r$   r   N)stripe.api_resources.abstractr   r   r   r    stripe.api_resources.list_objectr   stripe.request_optionsr   stripe.stripe_objectr	   stripe.utilr
   typingr   r   r   r   r   r   typing_extensionsr   r   r   r   r   urllib.parser   r   r#   r$   r%   <module>r      s^     8 1 - , A A  $l(#"!(#	lr$   