
    h8                     ~    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mZ d dlmZmZmZ  G d d	e      Zy
)    )Coupon)
ListObject)RequestOptions)StripeService)sanitize_id)DictListcast)LiteralNotRequired	TypedDictc            	          e Zd Z G d de      Z G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Zi i fdedddedefdZi i fdedddedefdZi i fdedddedefdZi i fdedddedefdZi i fdedddedefdZi i fdedddedefdZi i fdd dedee   fd!Zi i fdd dedee   fd"Zi i fdd#dedefd$Zi i fdd#dedefd%Zy&)'CouponServicec                      e Zd ZU ee   ed<   	 ed   ed<   	 ee   ed<   	 eeedf      ed<   	 eed      ed<   	 ee   ed	<   	 ee	e      ed
<   	 ee   ed<   	 ee   ed<   	 ed   ed<   	 ee   ed<   	 ee
   ed<   	 ee   ed<   y)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_byN)__name__
__module____qualname__r   int__annotations__strr   r   r	   float     V/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/stripe/_coupon_service.pyCreateParamsr      s   $$	   EFF	 c""	 &AAB
 	
	 g&DEFF	 (,,	 DI&&	 	 %S))	 :;;	 #	 !''	 s##	r-   r/   c                   $    e Zd ZU eee      ed<   y)r   productsNr%   r&   r'   r   r	   r*   r)   r,   r-   r.   CreateParamsAppliesToz#CouponService.CreateParamsAppliesToE   s    d3i((	r-   r3   c                       e Zd ZU eed<   y)r   r   Nr%   r&   r'   r(   r)   r,   r-   r.   CreateParamsCurrencyOptionsz)CouponService.CreateParamsCurrencyOptionsK       	r-   r6   c                       e Zd Zy)CouponService.DeleteParamsN)r%   r&   r'   r,   r-   r.   DeleteParamsr9   Q   s    r-   r:   c                   l    e Zd ZU ed   ed<   	 ee   ed<   	 eee      ed<   	 ee   ed<   	 ee   ed<   y)CouponService.ListParamsz#CouponService.ListParamsCreated|intcreatedending_beforer   limitstarting_afterN)r%   r&   r'   r   r)   r*   r	   r(   r,   r-   r.   
ListParamsr<   T   s_    BCC	 #3''	 DI&&	 3	 $C((	r-   rA   c                   T    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)CouponService.ListParamsCreatedgtgteltlteN)r%   r&   r'   r   r(   r)   r,   r-   r.   ListParamsCreatedrC   j   sH    	 	 	 	r-   rH   c                   $    e Zd ZU eee      ed<   y)CouponService.RetrieveParamsr   Nr2   r,   r-   r.   RetrieveParamsrJ   |   s    DI&&	r-   rK   c                   d    e Zd ZU eeedf      ed<   	 eee      ed<   	 ed   ed<   	 ee   ed<   y)CouponService.UpdateParams)CouponService.UpdateParamsCurrencyOptionsr   r   r    r!   r"   N)r%   r&   r'   r   r   r*   r)   r	   r,   r-   r.   UpdateParamsrM      s]    %AAB
 	
	 DI&&	 :;;	 #	r-   rO   c                       e Zd ZU eed<   y)rN   r   Nr5   r,   r-   r.   UpdateParamsCurrencyOptionsz)CouponService.UpdateParamsCurrencyOptions   r7   r-   rQ   couponparamsr9   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}rR   apibase_addressrS   rT   r
   r   _requestformatr   selfrR   rS   rT   s       r.   rX   zCouponService.delete   sG     MM&--[5H-I"  	
 		
r-   c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)rW   rX   rY   rZ   r[   r\   Nr
   r   _request_asyncr`   r   ra   s       r.   delete_asynczCouponService.delete_async   sW      %%&--[5H-I" &  	
 		
   =A
A
 	A
rJ   c                 |    t        t        | j                  ddj                  t	        |            d||            S )9
        Retrieves the coupon with the given ID.
        getrY   rZ   r[   r\   r^   ra   s       r.   retrievezCouponService.retrieve   sG     MM&--[5H-I"  	
 		
r-   c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)ri   rj   rY   rZ   r[   r\   Nrd   ra   s       r.   retrieve_asynczCouponService.retrieve_async   sW      %%&--[5H-I" &  	
 		
rg   rM   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.
        postrY   rZ   r[   r\   r^   ra   s       r.   updatezCouponService.update   sG     MM&--[5H-I"  	
 		
r-   c                    K   t        t        | j                  ddj                  t	        |            d||       d{         S 7 w)ro   rp   rY   rZ   r[   r\   Nrd   ra   s       r.   update_asynczCouponService.update_async   sW      %%&--[5H-I" &  	
 		
rg   r<   c           
      X    t        t        t           | j                  ddd||            S )1
        Returns a list of your coupons.
        rj   /v1/couponsr[   r\   )r
   r   r   r_   rb   rS   rT   s      r.   listzCouponService.list  s9     vMM"  	
 		
r-   c           
      t   K   t        t        t           | j                  ddd||       d{         S 7 w)ru   rj   rv   r[   r\   N)r
   r   r   re   rw   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.
        rp   rv   r[   r\   )r
   r   r_   rw   s      r.   createzCouponService.create:  s4     MM"  	
 		
r-   c           
      f   K   t        t        | j                  ddd||       d{         S 7 w)r|   rp   rv   r[   r\   N)r
   r   re   rw   s      r.   create_asynczCouponService.create_asyncO  sD      %%" &  	
 		
s   $1/
	1N)r%   r&   r'   r   r/   r3   r6   r:   rA   rH   rK   rO   rQ   r*   r   r   rX   rf   rk   rm   rq   rs   r   rx   rz   r}   r   r,   r-   r.   r   r      sO   6y 6p	 i y Y ,I $ y (i  02"$	

 -
  	

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

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

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

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

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

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