
    Ai.                         d dl mZ d dlmZ d dlmZmZ d dlmZ er0d 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 d dlmZ d dlmZ  G d de      Zy)    )StripeService)sanitize_id)Optionalcast)TYPE_CHECKING)Coupon)
ListObject)RequestOptions)CouponCreateParams)CouponDeleteParams)CouponListParams)CouponRetrieveParams)CouponUpdateParamsc            	          e Zd Z	 	 ddeded   ded   ddfd	Z	 	 ddeded   ded   ddfd
Z	 	 ddeded   ded   ddfdZ	 	 ddeded   ded   ddfdZ	 	 ddeded   ded   ddfdZ		 	 ddeded   ded   ddfdZ
	 	 dded   ded   ddfdZ	 	 dded   ded   ddfdZ	 	 dded   ded   ddfdZ	 	 dded   ded   ddfdZy)CouponServiceNcouponparamsr   optionsr
   returnr   c                 t    t        d| 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.
        r   delete/v1/coupons/{coupon}r   apibase_addressr   r   r   _requestformatr   selfr   r   r   s       I/var/www/html/immo/lib/python3.12/site-packages/stripe/_coupon_service.pyr   zCouponService.delete   sG     MM&--[5H-I"  	
 		
    c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)r   r   r   r   r   r   r   Nr   _request_asyncr    r   r!   s       r#   delete_asynczCouponService.delete_async(   sW      %%&--[5H-I" &  	
 		
   9AA
	Ar   c                 t    t        d| j                  ddj                  t        |            d||            S )9
        Retrieves the coupon with the given ID.
        r   getr   r   r   r   r   r!   s       r#   retrievezCouponService.retrieve<   sG     MM&--[5H-I"  	
 		
r$   c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)r+   r   r,   r   r   r   r   Nr&   r!   s       r#   retrieve_asynczCouponService.retrieve_asyncP   sW      %%&--[5H-I" &  	
 		
r)   r   c                 t    t        d| 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.
        r   postr   r   r   r   r   r!   s       r#   updatezCouponService.updated   sG     MM&--[5H-I"  	
 		
r$   c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)r1   r   r2   r   r   r   r   Nr&   r!   s       r#   update_asynczCouponService.update_asyncx   sW      %%&--[5H-I" &  	
 		
r)   r   ListObject[Coupon]c           
      B    t        d| j                  ddd||            S )1
        Returns a list of your coupons.
        r6   r,   /v1/couponsr   r   r   r   r"   r   r   s      r#   listzCouponService.list   s4      MM"  	
 		
r$   c           
      ^   K   t        d| j                  ddd||       d{         S 7 w)r8   r6   r,   r9   r   r   Nr   r'   r;   s      r#   
list_asynczCouponService.list_async   sD       %%" &  	
 		
    -+
	-r   c           
      B    t        d| 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.
        r   r2   r9   r   r   r:   r;   s      r#   createzCouponService.create   s4     MM"  	
 		
r$   c           
      ^   K   t        d| j                  ddd||       d{         S 7 w)rB   r   r2   r9   r   r   Nr>   r;   s      r#   create_asynczCouponService.create_async   sD      %%" &  	
 		
r@   )NN)__name__
__module____qualname__strr   r   r(   r-   r/   r3   r5   r<   r?   rC   rE    r$   r#   r   r      sP    26.2	

 -.
 *+	

 

. 26.2	

 -.
 *+	

 

. 48.2	

 /0
 *+	

 

. 48.2	

 /0
 *+	

 

. 26.2	

 -.
 *+	

 

. 26.2	

 -.
 *+	

 

, 04.2
+,
 *+
 
	
* 04.2
+,
 *+
 
	
* 26.2
-.
 *+
 
	
. 26.2
-.
 *+
 
	
r$   r   N)stripe._stripe_servicer   stripe._utilr   typingr   r   typing_extensionsr   stripe._couponr   stripe._list_objectr	   stripe._request_optionsr
   #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   rJ   r$   r#   <module>rW      s<    1 $ ! +%.6FFBJFG
M G
r$   