
    h?                         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 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mZ erd dlmZ d dlmZ  G d ded   ed   ed         Z y)    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)RequestOptions)StripeObject)UpdateableAPIResource)sanitize_id)ClassVarDictListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Coupon)Customerc                      e Zd ZU dZdZeed      ed<    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 G d de
      Zeed<   	 eed<   	 ded<   	 eed<   	 e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d   ed$<   	 e	ed%<   eed&<   	 ed'ed(   d)d fd*       Zed'ed(   d)d fd+       Zed'ed,   d)ed    fd-       Z ed'ed,   d)ed    fd.       Z!ed ed'ed/   d)d fd0       Z"ed ed'ed/   d)d fd1       Z#ed ed'ed2   d)d fd3       Z$ed ed'ed2   d)d fd4       Z%d%e	iZ&y5)6PromotionCodez
    A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to
    create multiple codes for a single coupon.
    promotion_codeOBJECT_NAMEc                   ~    e Zd ZU  G d de      Zeeeef      ed<   	 e	ed<   	 ee
   ed<   	 ee   ed<   	 deiZdgZy)PromotionCode.Restrictionsc                       e Zd ZU eed<   y)*PromotionCode.Restrictions.CurrencyOptionsminimum_amountN)__name__
__module____qualname__int__annotations__     V/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/stripe/_promotion_code.pyCurrencyOptionsr   &   s    r&   r(   currency_optionsfirst_time_transactionr   minimum_amount_currencyN)r    r!   r"   r   r(   r   r   strr$   boolr#   _inner_class_types_inner_class_dictsr%   r&   r'   Restrictionsr   %   so    	l 	 #4_(<#=>>	 !%$	 !%	 "*#.	 1/B01r&   r0   c                       e Zd ZU ee   ed<   	 ee   ed<   	 eed<   	 ee   ed<   	 eee      ed<   	 ee   ed<   	 ee   ed<   	 ee	eef      ed<   	 ed	   ed
<   y)PromotionCode.CreateParamsactivecodecouponcustomerexpand
expires_atmax_redemptionsmetadata&PromotionCode.CreateParamsRestrictionsrestrictionsN)
r    r!   r"   r   r-   r$   r,   r   r#   r   r%   r&   r'   CreateParamsr2   ?   s    D!!	 #	
 	 c""	 DI&&	  $$	 %S))	 d38n--	 ""JKK	r&   r=   c                   ^    e Zd ZU eeedf      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)r;   5PromotionCode.CreateParamsRestrictionsCurrencyOptionsr)   r*   r   r+   N)	r    r!   r"   r   r   r,   r$   r-   r#   r%   r&   r'   CreateParamsRestrictionsz&PromotionCode.CreateParamsRestrictionsg   sX    %MMN
 	
	 !,D 11	 $C((	 "-S!11	r&   r@   c                       e Zd ZU ee   ed<   y)r?   r   Nr    r!   r"   r   r#   r$   r%   r&   r'   'CreateParamsRestrictionsCurrencyOptionsz5PromotionCode.CreateParamsRestrictionsCurrencyOptions{       #C((	r&   rC   c                       e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ed   ed<   	 ee   ed<   	 ee   ed<   	 eee      ed<   	 ee   ed	<   	 ee   ed
<   y)PromotionCode.ListParamsr3   r4   r5   z#PromotionCode.ListParamsCreated|intcreatedr6   ending_beforer7   limitstarting_afterN)	r    r!   r"   r   r-   r$   r,   r   r#   r%   r&   r'   
ListParamsrF      s    D!!	 #	 C  	 BCC	 c""	 #3''	 DI&&	 3	 $C((	r&   rK   c                   T    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)PromotionCode.ListParamsCreatedgtgteltlteNrB   r%   r&   r'   ListParamsCreatedrM      sH    	 	 	 	r&   rR   c                   Z    e Zd ZU ee   ed<   	 eee      ed<   	 ed   ed<   	 ed   ed<   y)PromotionCode.ModifyParamsr3   r7   zLiteral['']|Dict[str, str]r:   &PromotionCode.ModifyParamsRestrictionsr<   N)r    r!   r"   r   r-   r$   r   r,   r%   r&   r'   ModifyParamsrT      sN    D!!	 DI&&	 :;;	 ""JKK	r&   rV   c                   (    e Zd ZU eeedf      ed<   y)rU   5PromotionCode.ModifyParamsRestrictionsCurrencyOptionsr)   N)r    r!   r"   r   r   r,   r$   r%   r&   r'   ModifyParamsRestrictionsz&PromotionCode.ModifyParamsRestrictions   s"    %MMN
 	
	r&   rY   c                       e Zd ZU ee   ed<   y)rX   r   NrB   r%   r&   r'   'ModifyParamsRestrictionsCurrencyOptionsz5PromotionCode.ModifyParamsRestrictionsCurrencyOptions   rD   r&   r[   c                   $    e Zd ZU eee      ed<   y)PromotionCode.RetrieveParamsr7   N)r    r!   r"   r   r   r,   r$   r%   r&   r'   RetrieveParamsr]      s    DI&&	r&   r^   r3   r4   r   r5   rG   r   r6   r8   idlivemoder9   r:   objectr<   times_redeemedparamsr2   returnc                 Z    t        d| j                  d| j                         |            S )
        A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
        r   postrc   )r   _static_request	class_urlclsrc   s     r'   createzPromotionCode.create  s6        
 	
r&   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)rf   r   rg   rh   N)r   _static_request_asyncrj   rk   s     r'   create_asynczPromotionCode.create_async#  sD      ++ ,  
 	
s   ,97
	9rF   c                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |S )9
        Returns a list of your promotion codes.
        getrh   %Expected list object from API, got %s)ri   rj   
isinstancer   	TypeErrortyper    rl   rc   results      r'   listzPromotionCode.list3  s]     $$MMO % 

 &*-7<((* 
 r&   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)rr   rs   rh   Nrt   )ro   rj   ru   r   rv   rw   r    rx   s      r'   
list_asynczPromotionCode.list_asyncG  sk      00MMO 1 
 

 &*-7<((* 
 
s   &A"A 8A"rT   c                 z    | j                         dt        |      }t        d| j                  d||            S )
        Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
        /r   rg   rh   )rj   r
   r   ri   rl   r_   rc   urls       r'   modifyzPromotionCode.modify[  sD     +b/:   
 	
r&   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r~   r   r   rg   rh   N)rj   r
   r   ro   r   s       r'   modify_asynczPromotionCode.modify_asyncl  sR      +b/:++ ,  
 	
s   <A	A
	A	r]   c                 8     | |fi |}|j                          |S )
        Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code.
        )refreshrl   r_   rc   instances       r'   retrievezPromotionCode.retrieve}  s$     r$V$r&   c                 T   K    | |fi |}|j                          d{    |S 7 w)r   N)refresh_asyncr   s       r'   retrieve_asynczPromotionCode.retrieve_async  s3      r$V$$$&&& 	's   (&(N)'r    r!   r"   __doc__r   r   r   r$   r   r0   r   r=   r   r@   rC   rK   rR   rV   rY   r[   r^   r-   r,   r#   r   r   r   classmethodr   rm   rp   r   rz   r|   r   r   r   r   r.   r%   r&   r'   r   r      s   

 8HK'"234G2| 24&~ &P9 () $^ $LI $~ $9 )   L I 
 L z233  	G N c]" tCH~&& $%%  
:;
	
 
 
:;
	
 
 89	O	$ & 89	O	$ & 

 &'C D
	
 
  

 &'C D
	
 
   &'E F	   &'E F	  ),7r&   r   N)!stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._request_optionsr   stripe._stripe_objectr   stripe._updateable_api_resourcer	   stripe._utilr
   typingr   r   r   r   r   typing_extensionsr   r   r   r   r   stripe._couponr   stripe._customerr   r   r%   r&   r'   <module>r      s_    B 4 * = 2 . A $ 7 7  %)z8/*(/*z8r&   