
    ChQQ              	           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  S S	KJrJrJrJrJrJr  S S
KJrJrJrJr   " S S\S   \S   \S   \S   5      rg)    )CreateableAPIResource)DeletableAPIResource)
ListObject)ListableAPIResource)RequestOptions)StripeObject)UpdateableAPIResource)class_method_variantsanitize_id)ClassVarDictListOptionalcastoverload)LiteralNotRequired	TypedDictUnpackc                      \ 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\5      r\\   \S'    \\
   \S'   \\S'    \\   \S'    \\\\4      \S'    \\S       \S!'    \S"   \S#'    \\   \S$'    \\S%'    \\S&'    \\   \S''    \\\\4      \S('    \\   \S)'    \S   \S*'    \\   \S+'    \\   \S,'    \\S-'    \\S.'    \S/\S0   S1S 4S2 j5       r\S/\S0   S1S 4S3 j5       r \S4\S/\S5   S1S 4S6 j5       r!\"\#S4\S/\S5   S1S 4S7 j5       5       r$\"S/\S5   S1S 4S8 j5       r$\%" S95      S/\S5   S1S 4S: j5       r$\S4\S/\S5   S1S 4S; j5       r&\"\#S4\S/\S5   S1S 4S< j5       5       r'\"S/\S5   S1S 4S= j5       r'\%" S>5      S/\S5   S1S 4S? j5       r'\S/\S@   S1\(S    4SA j5       r)\S/\S@   S1\(S    4SB j5       r*\S%\S/\SC   S1S 4SD j5       r+\S%\S/\SC   S1S 4SE j5       r,\S%\S/\SF   S1S 4SG j5       r-\S%\S/\SF   S1S 4SH j5       r.\
\SI.r/SJr0gK)LCoupon   a  
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                   &    \ rS rSr% \\   \S'   Srg)Coupon.AppliesTo   products N)__name__
__module____qualname____firstlineno__r   str__annotations____static_attributes__r       Q/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/stripe/_coupon.py	AppliesTor      s    s)	r'   r)   c                        \ rS rSr% \\S'   Srg)Coupon.CurrencyOptions#   
amount_offr   Nr    r!   r"   r#   intr%   r&   r   r'   r(   CurrencyOptionsr+   #       	r'   r0   c                      \ rS rSr% \\   \S'    \S   \S'    \\   \S'    \\\S4      \S'    \\	S      \S	'    \\   \S
'    \\
\      \S'    \\   \S'    \\   \S'    \S   \S'    \\   \S'    \\   \S'    \\   \S'   Srg)Coupon.CreateParams)   r-   Coupon.CreateParamsAppliesTo
applies_tocurrency"Coupon.CreateParamsCurrencyOptionscurrency_optionsforeveronce	repeatingdurationduration_in_monthsexpandidmax_redemptionsLiteral['']|Dict[str, str]metadatanamepercent_off	redeem_byr   N)r    r!   r"   r#   r   r/   r%   r$   r   r   r   floatr&   r   r'   r(   CreateParamsr3   )   s   $$	   >??	 c""	 &::;
 	
	 g&DEFF	 (,,	 DI&&	 	 %S))	 :;;	 #	 !''	 s##	r'   rI   c                   ,    \ rS rSr% \\\      \S'   Srg)r5   a   r   r   N	r    r!   r"   r#   r   r   r$   r%   r&   r   r'   r(   CreateParamsAppliesToCoupon.CreateParamsAppliesToa   s    d3i((	r'   rM   c                        \ rS rSr% \\S'   Srg)r8   g   r-   r   Nr.   r   r'   r(   CreateParamsCurrencyOptions"Coupon.CreateParamsCurrencyOptionsg   r1   r'   rQ   c                       \ rS rSrSrg)Coupon.DeleteParamsm   r   N)r    r!   r"   r#   r&   r   r'   r(   DeleteParamsrT   m   s    r'   rV   c                   t    \ rS rSr% \S   \S'    \\   \S'    \\\      \S'    \\   \S'    \\   \S'   Sr	g	)
Coupon.ListParamsp   zCoupon.ListParamsCreated|intcreatedending_beforer@   limitstarting_afterr   N)
r    r!   r"   r#   r   r%   r$   r   r/   r&   r   r'   r(   
ListParamsrX   p   s_    ;<<	 #3''	 DI&&	 3	 $C((	r'   r^   c                   \    \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\   \S'   Srg)Coupon.ListParamsCreated   gtgteltlter   N)r    r!   r"   r#   r   r/   r%   r&   r   r'   r(   ListParamsCreatedr`      sH    	 	 	 	r'   rf   c                   l    \ rS rSr% \\\S4      \S'    \\\      \S'    \S   \S'    \\   \S'   Sr	g	)
Coupon.ModifyParams   "Coupon.ModifyParamsCurrencyOptionsr9   r@   rC   rD   rE   r   N)
r    r!   r"   r#   r   r   r$   r%   r   r&   r   r'   r(   ModifyParamsrh      s]    %::;
 	
	 DI&&	 :;;	 #	r'   rk   c                        \ rS rSr% \\S'   Srg)rj      r-   r   Nr.   r   r'   r(   ModifyParamsCurrencyOptions"Coupon.ModifyParamsCurrencyOptions   r1   r'   rn   c                   ,    \ rS rSr% \\\      \S'   Srg)Coupon.RetrieveParams   r@   r   NrL   r   r'   r(   RetrieveParamsrq      s    DI&&	r'   rs   r-   r6   rZ   r7   r9   Tdeletedr:   r>   r?   rA   livemoderB   rD   rE   objectrF   rG   times_redeemedvalidparamsr3   returnc           	      T    [        SU R                  SU R                  5       US95      $ )p  
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ry   )r   _static_request	class_urlclsry   s     r(   createCoupon.create   s6        
 	
r'   c           	      p   #    [        SU R                  SU R                  5       US9I Sh  vN 5      $  N7f)r|   r   r}   r~   N)r   _static_request_asyncr   r   s     r(   create_asyncCoupon.create_async  sC      ++ ,  
 	
s   )64
	6sidrT   c           	      x    U R                  5       < S[        U5      < 3n[        SU R                  SUUS95      $ )4  
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   deleter~   r   r   r   r   r   r   ry   urls       r(   _cls_deleteCoupon._cls_delete   sE     +c*:;   
 	
r'   c                     gr   Nr   r   ry   s     r(   r   Coupon.delete1  s     	r'   c                     gr   r   selfry   s     r(   r   r   9  s    
 	r'   r   c                 @    U R                  SU R                  5       US9$ )r   r   r~   )_request_and_refreshinstance_urlr   s     r(   r   r   @  s.     (( ) 
 	
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   r   r~   Nr   r   r   r   r   s       r(   _cls_delete_asyncCoupon._cls_delete_asyncM  sR      +c*:;++ ,  
 	
   ;AA
	Ac                    #    g7fr   r   r   s     r(   delete_asyncCoupon.delete_async^  s
      	   c                    #    g7fr   r   r   s     r(   r   r   h  s
      	r   r   c                 \   #    U R                  SU R                  5       US9I Sh  vN $  N7f)r   r   r~   N)_request_and_refresh_asyncr   r   s     r(   r   r   q  s;      44 5 
 
 	
 
s   #,*,rX   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 coupons.
getr~   %Expected list object from API, got %s)r   r   
isinstancer   	TypeErrortyper    r   ry   results      r(   listCoupon.list~  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   r~   Nr   )r   r   r   r   r   r   r    r   s      r(   
list_asyncCoupon.list_async  sm      00MMO 1 
 

 &*--7<((* 
 
s   #A$A"=A$rh   c           	      x    U R                  5       < S[        U5      < 3n[        SU R                  SUUS95      $ )w
Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
r   r   r}   r~   r   r   rA   ry   r   s       r(   modifyCoupon.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   r}   r~   Nr   r   s       r(   modify_asyncCoupon.modify_async  sQ      +b/:++ ,  
 	
r   rq   c                 8    U " U40 UD6nUR                  5         U$ ))
Retrieves the coupon with the given ID.
)refreshr   rA   ry   instances       r(   retrieveCoupon.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Coupon.retrieve_async  s2      r$V$$$&&& 	's   (&()r6   r9   r   N)1r    r!   r"   r#   __doc__r   r   r   r%   r   r)   r0   r   rI   r   rM   rQ   rV   r^   rf   rk   rn   rs   r   r/   r$   r   boolrH   classmethodr   r   r   r   r   staticmethodr   r
   r   r   r   r   r   r   r   r   r   _inner_class_typesr&   r   r'   r(   r   r      s    08K'(+,7L , 6~ 6p	 i ~ ^ ,I $~ (i    ##L sm tC$89:: gdm$$ 455 !% 	G N c]" tCH~&& 3- H %  }  K 
f%:; 
 
 
 
34
	
 
" 

!'(=!>
	
 
  C 6*?#@ X    v&;<    -(

45

	

 )

 

!'(=!>
	
 
  "#89	   45	  -.

45

	

 /

 12	H	 & 12	H	 & 

 &'< =
	
 
  

 &'< =
	
 
   &'> ?	   &'> ?	   +r'   r   N)stripe._createable_api_resourcer   stripe._deletable_api_resourcer   stripe._list_objectr   stripe._listable_api_resourcer   stripe._request_optionsr   stripe._stripe_objectr   stripe._updateable_api_resourcer	   stripe._utilr
   r   typingr   r   r   r   r   r   typing_extensionsr   r   r   r   r   r   r'   r(   <module>r      sX    B ? * = 2 . A : A A E ER(#"!(#	Rr'   