
    Chi@                         S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJr  S S	KJrJrJrJrJr  S S
KJrJrJrJrJr  \(       a  S SKJr  S SKJr   " S S\S   \S   \S   5      r g)    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)RequestOptions)StripeObject)UpdateableAPIResource)sanitize_id)ClassVarDictListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Coupon)Customerc                      \ rS rSr% SrSr\\S      \S'    " S S\	5      r
 " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\\S'    \\S'    S\S'    \\S'    \\S      \S'    \\   \S '    \\S!'    \\S"'    \\   \S#'    \\\\4      \S$'    \S   \S%'    \
\S&'   \\S''    \S(\S)   S*S 4S+ j5       r\S(\S)   S*S 4S, j5       r\S(\S-   S*\ S    4S. j5       r!\S(\S-   S*\ S    4S/ j5       r"\S!\S(\S0   S*S 4S1 j5       r#\S!\S(\S0   S*S 4S2 j5       r$\S!\S(\S3   S*S 4S4 j5       r%\S!\S(\S3   S*S 4S5 j5       r&S&\
0r'S6r(g7)8PromotionCode   a  
A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons).
You can create multiple codes for a single coupon.

If you enable promotion codes in your [customer portal configuration](https://stripe.com/docs/customer-management/configure-portal), then customers can redeem a code themselves when updating a subscription in the portal.
Customers can also view the currently active promotion codes and coupons on each of their subscriptions in the portal.
promotion_codeOBJECT_NAMEc                       \ rS rSr%  " S S\5      r\\\\4      \	S'    \
\	S'    \\   \	S'    \\   \	S'    S\0rS/rSrg	)
PromotionCode.Restrictions(   c                        \ rS rSr% \\S'   Srg)*PromotionCode.Restrictions.CurrencyOptions)   minimum_amount N)__name__
__module____qualname____firstlineno__int__annotations____static_attributes__r#       Y/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/stripe/_promotion_code.pyCurrencyOptionsr    )   s    r+   r-   currency_optionsfirst_time_transactionr"   minimum_amount_currencyr#   N)r$   r%   r&   r'   r   r-   r   r   strr)   boolr(   _inner_class_types_inner_class_dictsr*   r#   r+   r,   Restrictionsr   (   so    	l 	 #4_(<#=>>	 !%$	 !%	 "*#.	 1/B01r+   r5   c                       \ rS rSr% \\   \S'    \\   \S'    \\S'    \\   \S'    \\\      \S'    \\	   \S'    \\	   \S'    \\
\\4      \S	'    \S
   \S'   Srg)PromotionCode.CreateParamsB   activecodecouponcustomerexpand
expires_atmax_redemptionsmetadata&PromotionCode.CreateParamsRestrictionsrestrictionsr#   N)r$   r%   r&   r'   r   r2   r)   r1   r   r(   r   r*   r#   r+   r,   CreateParamsr7   B   s    D!!	 #	
 	 c""	 DI&&	  $$	 %S))	 d38n--	 ""JKK	r+   rC   c                   f    \ rS rSr% \\\S4      \S'    \\   \S'    \\	   \S'    \\   \S'   Sr
g)	rA   j   5PromotionCode.CreateParamsRestrictionsCurrencyOptionsr.   r/   r"   r0   r#   N)r$   r%   r&   r'   r   r   r1   r)   r2   r(   r*   r#   r+   r,   CreateParamsRestrictions&PromotionCode.CreateParamsRestrictionsj   sX    %MMN
 	
	 !,D 11	 $C((	 "-S!11	r+   rG   c                   &    \ rS rSr% \\   \S'   Srg)rF   ~   r"   r#   Nr$   r%   r&   r'   r   r(   r)   r*   r#   r+   r,   'CreateParamsRestrictionsCurrencyOptions5PromotionCode.CreateParamsRestrictionsCurrencyOptions~       #C((	r+   rL   c                       \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \S   \S'    \\   \S'    \\   \S'    \\\      \S	'    \\	   \S
'    \\   \S'   Sr
g)PromotionCode.ListParams   r9   r:   r;   z#PromotionCode.ListParamsCreated|intcreatedr<   ending_beforer=   limitstarting_afterr#   N)r$   r%   r&   r'   r   r2   r)   r1   r   r(   r*   r#   r+   r,   
ListParamsrP      s    D!!	 #	 C  	 BCC	 c""	 #3''	 DI&&	 3	 $C((	r+   rV   c                   \    \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\   \S'   Srg)PromotionCode.ListParamsCreated   gtgteltlter#   NrK   r#   r+   r,   ListParamsCreatedrX      sH    	 	 	 	r+   r^   c                   b    \ rS rSr% \\   \S'    \\\      \S'    \S   \S'    \S   \S'   Sr	g	)
PromotionCode.ModifyParams   r9   r=   zLiteral['']|Dict[str, str]r@   &PromotionCode.ModifyParamsRestrictionsrB   r#   N)
r$   r%   r&   r'   r   r2   r)   r   r1   r*   r#   r+   r,   ModifyParamsr`      sN    D!!	 DI&&	 :;;	 ""JKK	r+   rc   c                   0    \ rS rSr% \\\S4      \S'   Srg)rb      5PromotionCode.ModifyParamsRestrictionsCurrencyOptionsr.   r#   N)	r$   r%   r&   r'   r   r   r1   r)   r*   r#   r+   r,   ModifyParamsRestrictions&PromotionCode.ModifyParamsRestrictions   s"    %MMN
 	
	r+   rg   c                   &    \ rS rSr% \\   \S'   Srg)rf      r"   r#   NrK   r#   r+   r,   'ModifyParamsRestrictionsCurrencyOptions5PromotionCode.ModifyParamsRestrictionsCurrencyOptions   rN   r+   rk   c                   ,    \ rS rSr% \\\      \S'   Srg)PromotionCode.RetrieveParams   r=   r#   N)	r$   r%   r&   r'   r   r   r1   r)   r*   r#   r+   r,   RetrieveParamsrn      s    DI&&	r+   rp   r9   r:   r   r;   rR   r   r<   r>   idlivemoder?   r@   objectrB   times_redeemedparamsr7   returnc           	      T    [        SU R                  SU R                  5       US95      $ )
A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
r   postru   )r   _static_request	class_urlclsru   s     r,   createPromotionCode.create  s6        
 	
r+   c           	      p   #    [        SU R                  SU R                  5       US9I Sh  vN 5      $  N7f)rx   r   ry   rz   N)r   _static_request_asyncr|   r}   s     r,   create_asyncPromotionCode.create_async&  sC      ++ ,  
 	
s   )64
	6rP   c                     U R                  SU R                  5       US9n[        U[        5      (       d!  [	        S[        U5      R                  -  5      eU$ ))
Returns a list of your promotion codes.
getrz   %Expected list object from API, got %s)r{   r|   
isinstancer   	TypeErrortyper$   r~   ru   results      r,   listPromotionCode.list6  s`     $$MMO % 

 &*--7<((* 
 r+   c                    #    U R                  SU R                  5       US9I Sh  vN n[        U[        5      (       d!  [	        S[        U5      R                  -  5      eU$  N<7f)r   r   rz   Nr   )r   r|   r   r   r   r   r$   r   s      r,   
list_asyncPromotionCode.list_asyncJ  sm      00MMO 1 
 

 &*--7<((* 
 
s   #A$A"=A$r`   c           	      x    U R                  5       < S[        U5      < 3n[        SU R                  SUUS95      $ )
Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
/r   ry   rz   )r|   r
   r   r{   r~   rq   ru   urls       r,   modifyPromotionCode.modify^  sD     +b/:   
 	
r+   c           	         #    U R                  5       < S[        U5      < 3n[        SU R                  SUUS9I Sh  vN 5      $  N7f)r   r   r   ry   rz   N)r|   r
   r   r   r   s       r,   modify_asyncPromotionCode.modify_asynco  sQ      +b/:++ ,  
 	
s   ;AA
	Arn   c                 8    U " U40 UD6nUR                  5         U$ )
Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://docs.stripe.com/docs/api/promotion_codes/list) with the desired code.
)refreshr~   rq   ru   instances       r,   retrievePromotionCode.retrieve  s$     r$V$r+   c                 T   #    U " U40 UD6nUR                  5       I Sh  vN   U$  N7f)r   N)refresh_asyncr   s       r,   retrieve_asyncPromotionCode.retrieve_async  s2      r$V$$$&&& 	's   (&(r#   N))r$   r%   r&   r'   __doc__r   r   r   r)   r   r5   r   rC   r   rG   rL   rV   r^   rc   rg   rk   rp   r2   r1   r(   r   r   r   classmethodr   r   r   r   r   r   r   r   r   r   r3   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  %)}8/*(/*}8r+   