
    +h:                         d dl 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 d dlmZmZmZmZmZ d dl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ListableAPIResourceUpdateableAPIResource)ExpandableField)
ListObject)RequestOptions)StripeObject)ClassVarDictListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)
quote_plus)Coupon)Customerc                      e Zd ZU dZdZeed      ed<    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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	 	 	 	 d6d(ee   d)ee   d*ee   d+ee   d,ed-   d.d fd/       Ze	 	 	 d7d(ee   d*ee   d+ee   d,ed0   d.ed    f
d1       Z ed ed,ed2   d.d fd3       Z!ed ed,ed4   d.d fd5       Z"d%e	iZ#y')8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/html/venv/lib/python3.12/site-packages/stripe/api_resources/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d   ed<   	 ed   ed<   	 e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)PromotionCode.CreateParamsr-   activer,   codecouponcustomer	List[str]expandr#   
expires_atmax_redemptionszDict[str, str]metadata&PromotionCode.CreateParamsRestrictionsrestrictionsN)r    r!   r"   r   r$   r,   r%   r&   r'   CreateParamsr2   C   s    '' e$$ K "%((  ,, $E** )// ""233 &&NOOr&   r>   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y	)
r<   z@Dict[str, PromotionCode.CreateParamsRestrictionsCurrencyOptions]r)   r-   r*   r#   r   r,   r+   Nr    r!   r"   r   r$   r%   r&   r'   CreateParamsRestrictionsz&PromotionCode.CreateParamsRestrictionsi   sM    )R  %0$77 (.. &1%77r&   rA   c                       e Zd ZU ed   ed<   y)5PromotionCode.CreateParamsRestrictionsCurrencyOptionsr#   r   Nr@   r%   r&   r'   'CreateParamsRestrictionsCurrencyOptionsrC   }       '..r&   rD   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<   y)PromotionCode.ListParamsr-   r3   r,   r4   r5   z#PromotionCode.ListParamsCreated|intcreatedr6   ending_beforer7   r8   r#   limitstarting_afterNr@   r%   r&   r'   
ListParamsrG      s    '' e$$  && !!FGG "%(( 'u--  ,, u%% (..r&   rL   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)PromotionCode.ListParamsCreatedr#   gtgteltlteNr@   r%   r&   r'   ListParamsCreatedrN      sH    E"" U## E"" U##r&   rS   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y	)
PromotionCode.ModifyParamsr-   r3   r7   r8   zLiteral['']|Dict[str, str]r;   &PromotionCode.ModifyParamsRestrictionsr=   Nr@   r%   r&   r'   ModifyParamsrU      sJ    ''  ,, "">?? &&NOOr&   rW   c                       e Zd ZU ed   ed<   y)rV   z@Dict[str, PromotionCode.ModifyParamsRestrictionsCurrencyOptions]r)   Nr@   r%   r&   r'   ModifyParamsRestrictionsz&PromotionCode.ModifyParamsRestrictions   s    )R r&   rY   c                       e Zd ZU ed   ed<   y)5PromotionCode.ModifyParamsRestrictionsCurrencyOptionsr#   r   Nr@   r%   r&   r'   'ModifyParamsRestrictionsCurrencyOptionsr[      rE   r&   r\   c                       e Zd ZU ed   ed<   y)PromotionCode.RetrieveParamsr7   r8   Nr@   r%   r&   r'   RetrieveParamsr^      s    ,,r&   r_   r3   r4   r   r5   rH   r   r6   r9   idlivemoder:   r;   objectr=   times_redeemedNapi_keyidempotency_keystripe_versionstripe_accountparamsr2   returnc                 `    t        d| j                  d| j                         |||||            S )z
        A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
        r   post)r   _static_request	class_url)clsrd   re   rf   rg   rh   s         r'   createzPromotionCode.create  s=     
 	
r&   rG   c                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )z9
        Returns a list of your promotion codes.
        get)rd   rf   rg   rh   z%Expected list object from API, got %s)rl   rm   
isinstancer   	TypeErrortyper    )rn   rd   rf   rg   rh   results         r'   listzPromotionCode.list.  sf     $$MMO)) % 
 &*-7<((* 
 r&   rU   c                 z    | j                         dt        |      }t        d| j                  d||            S )z
        Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
        /r   rk   )rh   )rm   r   r   rl   )rn   r`   rh   urls       r'   modifyzPromotionCode.modifyJ  s=     *R.9F;
 	
r&   r^   c                 8     | |fi |}|j                          |S )z
        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)rn   r`   rh   instances       r'   retrievezPromotionCode.retrieveW  s$     r$V$r&   )NNNN)NNN)$r    r!   r"   __doc__r   r
   r   r$   r	   r0   r   r   r>   r   rA   rD   rL   rS   rW   rY   r\   r_   r-   r,   r#   r   r   r   classmethodr   ro   r   rv   rz   r~   r.   r%   r&   r'   r   r      s   

 8HK'"234G2| 24 $	> $	L	y 	(	i 	$	 $	L		 	$	> 	$	y 		i 		^ 	 L I 
 L z233  	G N c]" tCH~&& $%%   "&)-(,(,
#
 "#
 !	

 !
 56
 

 
0  "&(,(,	# ! !	
 34 
O	$ 6 



 &'C D

	

 

  &'E F	  ),7r&   r   N)stripe.api_resources.abstractr   r   r   %stripe.api_resources.expandable_fieldr    stripe.api_resources.list_objectr   stripe.request_optionsr   stripe.stripe_objectr	   typingr
   r   r   r   r   typing_extensionsr   r   r   r   r   urllib.parser   stripe.api_resources.couponr   stripe.api_resources.customerr   r   r%   r&   r'   <module>r      s`    
 B 7 1 - 7 7  $26G8/*(/*G8r&   