
    Ch8                     ~    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  S SKJrJrJr   " S S	\5      rg
)    )Coupon)
ListObject)RequestOptions)StripeService)sanitize_id)DictListcast)LiteralNotRequired	TypedDictc            	       *   \ rS rS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0 0 4S\SSS\S\4S jjr0 0 4S\SSS\S\4S jjr0 0 4S\SSS\S\4S jjr0 0 4S\SSS\S\4S jjr0 0 4S\SSS\S\4S jjr0 0 4S\SSS\S\4S  jjr0 0 4SS!S\S\\   4S" jjr0 0 4SS!S\S\\   4S# jjr0 0 4SS$S\S\4S% jjr0 0 4SS$S\S\4S& jjrS'rg())CouponService   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)CouponService.CreateParams   
amount_off#CouponService.CreateParamsAppliesTo
applies_tocurrency)CouponService.CreateParamsCurrencyOptionscurrency_options)foreveronce	repeatingdurationduration_in_monthsexpandidmax_redemptionsLiteral['']|Dict[str, str]metadatanamepercent_off	redeem_by N)__name__
__module____qualname____firstlineno__r   int__annotations__strr   r   r	   float__static_attributes__r'       Y/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/stripe/_coupon_service.pyCreateParamsr      s   $$	   EFF	 c""	 &AAB
 	
	 g&DEFF	 (,,	 DI&&	 	 %S))	 :;;	 #	 !''	 s##	r1   r3   c                   ,    \ rS rSr% \\\      \S'   Srg)r   E   productsr'   N	r(   r)   r*   r+   r   r	   r.   r-   r0   r'   r1   r2   CreateParamsAppliesTo#CouponService.CreateParamsAppliesToE   s    d3i((	r1   r8   c                        \ rS rSr% \\S'   Srg)r   K   r   r'   Nr(   r)   r*   r+   r,   r-   r0   r'   r1   r2   CreateParamsCurrencyOptions)CouponService.CreateParamsCurrencyOptionsK       	r1   r=   c                       \ rS rSrSrg)CouponService.DeleteParamsQ   r'   N)r(   r)   r*   r+   r0   r'   r1   r2   DeleteParamsrA   Q   s    r1   rC   c                   t    \ rS rSr% \S   \S'    \\   \S'    \\\      \S'    \\   \S'    \\   \S'   Sr	g	)
CouponService.ListParamsT   z#CouponService.ListParamsCreated|intcreatedending_beforer   limitstarting_afterr'   N)
r(   r)   r*   r+   r   r-   r.   r	   r,   r0   r'   r1   r2   
ListParamsrE   T   s_    BCC	 #3''	 DI&&	 3	 $C((	r1   rK   c                   \    \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\   \S'   Srg)CouponService.ListParamsCreatedj   gtgteltlter'   N)r(   r)   r*   r+   r   r,   r-   r0   r'   r1   r2   ListParamsCreatedrM   j   sH    	 	 	 	r1   rS   c                   ,    \ rS rSr% \\\      \S'   Srg)CouponService.RetrieveParams|   r   r'   Nr7   r'   r1   r2   RetrieveParamsrU   |   s    DI&&	r1   rW   c                   l    \ rS rSr% \\\S4      \S'    \\\      \S'    \S   \S'    \\   \S'   Sr	g	)
CouponService.UpdateParams   )CouponService.UpdateParamsCurrencyOptionsr   r   r"   r#   r$   r'   N)
r(   r)   r*   r+   r   r   r.   r-   r	   r0   r'   r1   r2   UpdateParamsrY      s]    %AAB
 	
	 DI&&	 :;;	 #	r1   r\   c                        \ rS rSr% \\S'   Srg)r[      r   r'   Nr<   r'   r1   r2   UpdateParamsCurrencyOptions)CouponService.UpdateParamsCurrencyOptions   r?   r1   r_   couponparamsrA   optionsreturnc                 p    [        [        U R                  SSR                  [	        U5      S9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.
delete/v1/coupons/{coupon}ra   apibase_addressrb   rc   r
   r   _requestformatr   selfra   rb   rc   s       r2   rg   CouponService.delete   sG     MM&--[5H-I"  	
 		
r1   c                    #    [        [        U R                  SSR                  [	        U5      S9SUUS9I Sh  vN 5      $  N7f)rf   rg   rh   ri   rj   rk   Nr
   r   _request_asyncro   r   rp   s       r2   delete_asyncCouponService.delete_async   sV      %%&--[5H-I" &  	
 		
   7AA
	ArU   c                 p    [        [        U R                  SSR                  [	        U5      S9SUUS95      $ ))
Retrieves the coupon with the given ID.
getrh   ri   rj   rk   rm   rp   s       r2   retrieveCouponService.retrieve   sG     MM&--[5H-I"  	
 		
r1   c                    #    [        [        U R                  SSR                  [	        U5      S9SUUS9I Sh  vN 5      $  N7f)rz   r{   rh   ri   rj   rk   Nrt   rp   s       r2   retrieve_asyncCouponService.retrieve_async   sV      %%&--[5H-I" &  	
 		
rx   rY   c                 p    [        [        U R                  SSR                  [	        U5      S9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.
postrh   ri   rj   rk   rm   rp   s       r2   updateCouponService.update   sG     MM&--[5H-I"  	
 		
r1   c                    #    [        [        U R                  SSR                  [	        U5      S9SUUS9I Sh  vN 5      $  N7f)r   r   rh   ri   rj   rk   Nrt   rp   s       r2   update_asyncCouponService.update_async   sV      %%&--[5H-I" &  	
 		
rx   rE   c                 R    [        [        [           U R                  SSSUUS95      $ )!
Returns a list of your coupons.
r{   /v1/couponsrj   rk   )r
   r   r   rn   rq   rb   rc   s      r2   listCouponService.list  s9     vMM"  	
 		
r1   c                 n   #    [        [        [           U R                  SSSUUS9I Sh  vN 5      $  N7f)r   r{   r   rj   rk   N)r
   r   r   ru   r   s      r2   
list_asyncCouponService.list_async'  sH      v%%" &  	
 		
s   (53
	5r   c                 D    [        [        U R                  SSSU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   r   rj   rk   )r
   r   rn   r   s      r2   createCouponService.create:  s4     MM"  	
 		
r1   c                 `   #    [        [        U R                  SSSUUS9I Sh  vN 5      $  N7f)r   r   r   rj   rk   N)r
   r   ru   r   s      r2   create_asyncCouponService.create_asyncO  sC      %%" &  	
 		
s   !.,
	.r'   N)r(   r)   r*   r+   r   r3   r8   r=   rC   rK   rS   rW   r\   r_   r.   r   r   rg   rv   r|   r   r   r   r   r   r   r   r   r0   r'   r1   r2   r   r      sT   6y 6p	 i y Y ,I $ y (i  02"$	

 -
  	

 

. 02"$	

 -
  	

 

. 24"$	

 /
  	

 

. 24"$	

 /
  	

 

. 02"$	

 -
  	

 

. 02"$	

 -
  	

 

, .0"$
*
  
 
F		
* .0"$
*
  
 
F		
* 02"$
,
  
 
	
. 02"$
,
  
 
	
 
r1   r   N)stripe._couponr   stripe._list_objectr   stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   typingr   r	   r
   typing_extensionsr   r   r   r   r'   r1   r2   <module>r      s0    " * 2 0 $ # # = =V
M V
r1   