
    jof:9                         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d
S )    )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d&S )'CouponServicec                   n   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<   dS )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     P/var/www/html/Alfredo/env/lib/python3.11/site-packages/stripe/_coupon_service.pyCreateParamsr      sg        $$$$	   EFFFF	 c""""	 &AAB
 	
 	
 	
	 g&DEFFFF	 (,,,,	 DI&&&&	 	 %S))))	 :;;;;	 #	 !''''	 s####	 	r-   r/   c                   2    e Zd ZU eee                  ed<   dS )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<   dS )r   r   Nr%   r&   r'   r(   r)   r,   r-   r.   CreateParamsCurrencyOptionsz)CouponService.CreateParamsCurrencyOptionsK            	 	r-   r6   c                       e Zd ZdS )CouponService.DeleteParamsN)r%   r&   r'   r,   r-   r.   DeleteParamsr9   Q   s        r-   r:   c                       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<   dS )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CC	 #3''''	 DI&&&&	 3	 $C((((	 	r-   rA   c                   n    e Zd ZU ee         ed<   	 ee         ed<   	 ee         ed<   	 ee         ed<   dS )CouponService.ListParamsCreatedgtgteltlteN)r%   r&   r'   r   r(   r)   r,   r-   r.   ListParamsCreatedrC   j   so         	 	 	 	 	r-   rH   c                   2    e Zd ZU eee                  ed<   dS )CouponService.RetrieveParamsr   Nr2   r,   r-   r.   RetrieveParamsrJ   |   s+         DI&&&&	 	r-   rK   c                       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<   dS )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<   dS )rN   r   Nr5   r,   r-   r.   UpdateParamsCurrencyOptionsz)CouponService.UpdateParamsCurrencyOptions   r7   r-   rQ   couponparamsr9   optionsreturnc                     t          t          |                     dd                    t	          |                    d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   V1apiapi_modebase_addressrS   rT   r
   r   _requestformatr   selfrR   rS   rT   s       r.   rX   zCouponService.delete   sZ     MM&--[5H5H-II"   

 

 
	
r-   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )rW   rX   rY   rZ   r[   r\   r]   Nr
   r   _request_asyncrb   r   rc   s       r.   delete_asynczCouponService.delete_async   s~       %%&--[5H5H-II" &        

 

 
	
r-   rJ   c                     t          t          |                     dd                    t	          |                    dd||                    S )9
        Retrieves the coupon with the given ID.
        getrY   rZ   r[   r\   r]   r`   rc   s       r.   retrievezCouponService.retrieve   sZ     MM&--[5H5H-II"   

 

 
	
r-   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )rj   rk   rY   rZ   r[   r\   r]   Nrf   rc   s       r.   retrieve_asynczCouponService.retrieve_async   s~       %%&--[5H5H-II" &        

 

 
	
r-   rM   c                     t          t          |                     dd                    t	          |                    d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]   r`   rc   s       r.   updatezCouponService.update   sZ     MM&--[5H5H-II"   

 

 
	
r-   c                    K   t          t          |                     dd                    t	          |                    dd||           d{V           S )rp   rq   rY   rZ   r[   r\   r]   Nrf   rc   s       r.   update_asynczCouponService.update_async  s~       %%&--[5H5H-II" &        

 

 
	
r-   r<   c                 t    t          t          t                   |                     dddd||                    S )1
        Returns a list of your coupons.
        rk   /v1/couponsr[   r\   r]   )r
   r   r   ra   rd   rS   rT   s      r.   listzCouponService.list  sF     vMM"   

 

 
	
r-   c                    K   t          t          t                   |                     dddd||           d{V           S )rv   rk   rw   r[   r\   r]   N)r
   r   r   rg   rx   s      r.   
list_asynczCouponService.list_async.  sj       v%%" &        

 

 
	
r-   r   c                 ^    t          t          |                     d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.
        rq   rw   r[   r\   r]   )r
   r   ra   rx   s      r.   createzCouponService.createB  sA     MM"   

 

 
	
r-   c                 n   K   t          t          |                     dddd||           d{V           S )r}   rq   rw   r[   r\   r]   N)r
   r   rg   rx   s      r.   create_asynczCouponService.create_asyncX  se       %%" &        

 

 
	
r-   N)r%   r&   r'   r   r/   r3   r6   r:   rA   rH   rK   rO   rQ   r*   r   r   rX   rh   rl   rn   rr   rt   r   ry   r{   r~   r   r,   r-   r.   r   r      s7       6 6 6 6 6y 6 6 6p    	       i       y       Y   ,    I   $           y   (    i    02"$	
 

 -
  	

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

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

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

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

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

 

 
 
 
. .0"$
 
*
  
 
F		
 
 
 
, .0"$
 
*
  
 
F		
 
 
 
, 02"$
 
,
  
 
	
 
 
 
0 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      s    " ! ! ! ! ! * * * * * * 2 2 2 2 2 2 0 0 0 0 0 0 $ $ $ $ $ $ # # # # # # # # # # = = = = = = = = = =`
 `
 `
 `
 `
M `
 `
 `
 `
 `
r-   