
    kh                         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 d dlmZ er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  G d de      Zy)    )Coupon)
ListObject)RequestOptions)StripeService)sanitize_id)Optionalcast)TYPE_CHECKING)CouponCreateParams)CouponDeleteParams)CouponListParams)CouponRetrieveParams)CouponUpdateParamsc            	          e Zd Z	 	 ddeded   dee   defdZ	 	 ddeded   dee   defdZ	 	 ddeded	   dee   defd
Z		 	 ddeded	   dee   defdZ
	 	 ddeded   dee   defdZ	 	 ddeded   dee   defdZ	 	 dded   dee   dee   fdZ	 	 dded   dee   dee   fdZ	 	 dded   dee   defdZ	 	 dded   dee   defdZy)CouponServiceNcouponparamsr   optionsreturnc                 |    t        t        | j                  ddj                  t	        |            d||            S )D  
        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}r   apibase_addressr   r   r	   r   _requestformatr   selfr   r   r   s       V/var/www/api/v1/venv_fitandmore/lib/python3.12/site-packages/stripe/_coupon_service.pyr   zCouponService.delete   sG     MM&--[5H-I"  	
 		
    c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)r   r   r   r   r   r   Nr	   r   _request_asyncr    r   r!   s       r#   delete_asynczCouponService.delete_async(   sW      %%&--[5H-I" &  	
 		
   =A
A
 	A
r   c                 |    t        t        | j                  ddj                  t	        |            d||            S )9
        Retrieves the coupon with the given ID.
        getr   r   r   r   r   r!   s       r#   retrievezCouponService.retrieve<   sG     MM&--[5H-I"  	
 		
r$   c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)r+   r,   r   r   r   r   Nr&   r!   s       r#   retrieve_asynczCouponService.retrieve_asyncP   sW      %%&--[5H-I" &  	
 		
r)   r   c                 |    t        t        | j                  ddj                  t	        |            d||            S )
        Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
        postr   r   r   r   r   r!   s       r#   updatezCouponService.updated   sG     MM&--[5H-I"  	
 		
r$   c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)r1   r2   r   r   r   r   Nr&   r!   s       r#   update_asynczCouponService.update_asyncx   sW      %%&--[5H-I" &  	
 		
r)   r   c           
      X    t        t        t           | j                  ddd||            S )1
        Returns a list of your coupons.
        r,   /v1/couponsr   r   )r	   r   r   r   r"   r   r   s      r#   listzCouponService.list   s9     vMM"  	
 		
r$   c           
      t   K   t        t        t           | j                  ddd||       d{         S 7 w)r7   r,   r8   r   r   N)r	   r   r   r'   r9   s      r#   
list_asynczCouponService.list_async   sI      v%%" &  	
 		
s   +86
	8r   c           
      J    t        t        | j                  ddd||            S )  
        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.
        r2   r8   r   r   )r	   r   r   r9   s      r#   createzCouponService.create   s4     MM"  	
 		
r$   c           
      f   K   t        t        | j                  ddd||       d{         S 7 w)r>   r2   r8   r   r   N)r	   r   r'   r9   s      r#   create_asynczCouponService.create_async   sD      %%" &  	
 		
s   $1/
	1)NN)__name__
__module____qualname__strr   r   r   r   r(   r-   r/   r3   r5   r   r:   r<   r?   rA    r$   r#   r   r      sP    26,0	

 -.
 .)	

 

. 26,0	

 -.
 .)	

 

. 48,0	

 /0
 .)	

 

. 48,0	

 /0
 .)	

 

. 26,0	

 -.
 .)	

 

. 26,0	

 -.
 .)	

 

, 04,0
+,
 .)
 
F		
* 04,0
+,
 .)
 
F		
* 26,0
-.
 .)
 
	
. 26,0
-.
 .)
 
	
r$   r   N)stripe._couponr   stripe._list_objectr   stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   typingr   r	   typing_extensionsr
   #stripe.params._coupon_create_paramsr   #stripe.params._coupon_delete_paramsr   !stripe.params._coupon_list_paramsr   %stripe.params._coupon_retrieve_paramsr   #stripe.params._coupon_update_paramsr   r   rF   r$   r#   <module>rS      s<    " * 2 0 $ ! +FFBJFG
M G
r$   