
    h`              	           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 d dlmZ d d	lmZmZ d d
lmZmZmZmZmZmZmZ d dlmZmZmZmZm Z  e rd dl!m"Z"  G d ded   ed   e	d   ed         Z#y)    )CreateableAPIResource)DeletableAPIResource)ExpandableField)
ListObject)ListableAPIResource)RequestOptions)StripeObject)UpdateableAPIResource)class_method_variantsanitize_id)ClassVarDictListOptionalUnioncastoverload)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Productc                      e Zd ZU dZdZeed      ed<    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 G d de      Z G d de      Zeed<   	 ee   ed<   	 ee   ed<   	 ed   ed<   	 eed<   	 eed <   	 eed!<   	 ed"   ed#<   	 eed$<   	 eed%<   	 eeeef      ed&<   	 ee   ed'<   	 ee   ed(<   	 ed   ed)<   	 eed*      ed+<   	 eee	      ed,<   	 eed-      ed.<   	 ee
   ed/<   	 ee   ed0<   	 ed1   ed2<   	 eed3      ed4<   	 ed5ed6   d7d fd8       Zed5ed6   d7d fd9       Z ed:ed5ed;   d7d fd<       Z!e"e#d:ed5ed;   d7d fd=              Z$e"d5ed;   d7d fd>       Z$ e%d?      d5ed;   d7d fd@       Z$ed:ed5ed;   d7d fdA       Z&e"e#d:ed5ed;   d7d fdB              Z'e"d5ed;   d7d fdC       Z' e%dD      d5ed;   d7d fdE       Z'ed5edF   d7e(d    fdG       Z)ed5edF   d7e(d    fdH       Z*ed!ed5edI   d7d fdJ       Z+ed!ed5edI   d7d fdK       Z,ed!ed5edL   d7d fdM       Z-ed!ed5edL   d7d fdN       Z.e	e
dOZ/yP)QPlanu  
    You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.

    Plans define the base price, currency, and billing cycle for recurring purchases of products.
    [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

    For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

    Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview).
    planOBJECT_NAMEc                   f    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)	Plan.Tierflat_amountflat_amount_decimalunit_amountunit_amount_decimalup_toN)__name__
__module____qualname__r   int__annotations__str     L/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/stripe/_plan.pyTierr   ,   sU    c]"	 &c]*	 c]"	 &c]*	 }	r,   r.   c                   *    e Zd ZU eed<   	 ed   ed<   y)Plan.TransformUsage	divide_bydownuproundNr%   r&   r'   r(   r)   r   r+   r,   r-   TransformUsager0   B       	 |$$	r,   r7   c                   f   e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 eed      ed<   	 eed<   	 ee	e      ed<   	 ee   ed<   	 ed	   ed
<   	 ee   ed<   	 ed   ed<   	 ee   ed<   	 ee   ed<   	 ed   ed<   ee	d      ed<   	 eed      ed<   	 ed   ed<   	 ee   ed<   	 eed      ed<   y)Plan.CreateParamsactiveamountamount_decimalper_unittieredbilling_schemecurrencyexpandiddaymonthweekyearintervalinterval_countLiteral['']|Dict[str, str]metadatameternicknamezPlan.CreateParamsProduct|strproductPlan.CreateParamsTiertiers	graduatedvolume
tiers_modePlan.CreateParamsTransformUsagetransform_usagetrial_period_dayslicensedmetered
usage_typeN)
r%   r&   r'   r   boolr)   r(   r*   r   r   r+   r,   r-   CreateParamsr:   L   sW   D!!	 C  	 $C((	 $G,@$ABB	 	 DI&&	 	 899	 $C((	 :;;	 3	 c""	 ;<<4 7899	  (= >??	 %%FGG	 's++	  (= >??	r,   r_   c                       e Zd ZU ee   ed<   	 ee   ed<   	 eeeef      ed<   	 eed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)	Plan.CreateParamsProductr;   rD   rM   namestatement_descriptortax_code
unit_labelN)r%   r&   r'   r   r^   r)   r*   r   r+   r,   r-   CreateParamsProductra      s    D!!	 	 d38n--	 		 *#..	
 c""	  $$	r,   rf   c                   p    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 eed   ef   ed<   y)rQ   r    r!   r"   r#   infr$   N)	r%   r&   r'   r   r(   r)   r*   r   r   r+   r,   r-   CreateParamsTierzPlan.CreateParamsTier   sc     %%	 )--	 !%%	 )--	 WU^S())	r,   ri   c                   *    e Zd ZU eed<   	 ed   ed<   y)rW   r1   r2   r5   Nr6   r+   r,   r-   CreateParamsTransformUsagezPlan.CreateParamsTransformUsage   r8   r,   rk   c                       e Zd Zy)Plan.DeleteParamsN)r%   r&   r'   r+   r,   r-   DeleteParamsrm      s    r,   rn   c                       e Zd ZU ee   ed<   	 ed   ed<   	 ee   ed<   	 eee      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y	)
Plan.ListParamsr;   zPlan.ListParamsCreated|intcreatedending_beforerC   limitrP   starting_afterN)	r%   r&   r'   r   r^   r)   r*   r   r(   r+   r,   r-   
ListParamsrp      s    D!!	 9::	 #3''	 DI&&	 3	 S!!	 $C((	r,   ru   c                   T    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)Plan.ListParamsCreatedgtgteltlteN)r%   r&   r'   r   r(   r)   r+   r,   r-   ListParamsCreatedrw      sH    	 	 	 	r,   r|   c                   ~    e Zd ZU ee   ed<   	 eee      ed<   	 ed   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)	Plan.ModifyParamsr;   rC   rL   rM   rO   rP   rY   N)	r%   r&   r'   r   r^   r)   r   r*   r(   r+   r,   r-   ModifyParamsr~     sq    D!!	 DI&&	 :;;	 c""	 S!!	 's++	r,   r   c                   $    e Zd ZU eee      ed<   y)Plan.RetrieveParamsrC   N)r%   r&   r'   r   r   r*   r)   r+   r,   r-   RetrieveParamsr      s    DI&&	r,   r   r;   r<   r=   r>   rA   rq   rB   rD   rE   rJ   rK   livemoderM   rN   rO   objectr   rP   rR   rS   rV   rX   rY   rZ   r]   Tdeletedparamsr:   returnc                 Z    t        d| j                  d| j                         |            S )
        You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
        r   postr   )r   _static_request	class_urlclsr   s     r-   createzPlan.create{  s6    
    
 	
r,   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)r   r   r   r   N)r   _static_request_asyncr   r   s     r-   create_asynczPlan.create_async  sD      ++ ,  
 	
s   ,97
	9sidrm   c                 z    | j                         dt        |      }t        d| j                  d||            S )l
        Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.
        /r   deleter   r   r   r   r   r   r   r   urls       r-   _cls_deletezPlan._cls_delete  sE     +c*:;   
 	
r,   c                      yr   Nr+   r   r   s     r-   r   zPlan.delete  s     	r,   c                      yr   r+   selfr   s     r-   r   zPlan.delete  s    
 	r,   r   c                 F    | j                  d| j                         |      S )r   r   r   )_request_and_refreshinstance_urlr   s     r-   r   zPlan.delete  s.     (( ) 
 	
r,   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r   r   r   r   r   Nr   r   r   r   r   s       r-   _cls_delete_asynczPlan._cls_delete_async  sS      +c*:;++ ,  
 	
   <A	A
	A	c                    K   ywr   r+   r   s     r-   delete_asynczPlan.delete_async  s      	   c                    K   ywr   r+   r   s     r-   r   zPlan.delete_async  s      	r   r   c                 b   K   | j                  d| j                         |       d{   S 7 w)r   r   r   N)_request_and_refresh_asyncr   r   s     r-   r   zPlan.delete_async  s<      44 5 
 
 	
 
s   &/-/rp   c                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |S )/
        Returns a list of your plans.
        getr   %Expected list object from API, got %s)r   r   
isinstancer   	TypeErrortyper%   r   r   results      r-   listz	Plan.list  s]    
 $$MMO % 

 &*-7<((* 
 r,   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)r   r   r   Nr   )r   r   r   r   r   r   r%   r   s      r-   
list_asynczPlan.list_async	  sk      00MMO 1 
 

 &*-7<((* 
 
s   &A"A 8A"r~   c                 z    | j                         dt        |      }t        d| j                  d||            S )
        Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle.
        r   r   r   r   r   r   rD   r   r   s       r-   modifyzPlan.modify  sD    
 +b/:   
 	
r,   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r   r   r   r   r   Nr   r   s       r-   modify_asynczPlan.modify_async,  sR      +b/:++ ,  
 	
r   r   c                 8     | |fi |}|j                          |S )7
        Retrieves the plan with the given ID.
        )refreshr   rD   r   instances       r-   retrievezPlan.retrieve=  s$     r$V$r,   c                 T   K    | |fi |}|j                          d{    |S 7 w)r   N)refresh_asyncr   s       r-   retrieve_asynczPlan.retrieve_asyncH  s3      r$V$$$&&& 	's   (&()rR   rX   N)0r%   r&   r'   __doc__r   r   r   r)   r	   r.   r7   r   r_   r   rf   ri   rk   rn   ru   r|   r   r   r^   r   r(   r*   r   r   r   classmethodr   r   r   r   r   staticmethodr   r   r   r   r   r   r   r   r   r   r   _inner_class_typesr+   r,   r-   r   r      s   	 .4K'&/*3| , E~ ENi @9 ,Y ~ ^ <I $~ 4  L SM SM! 011 L M 	G 455  N tCH~&& C= sm FO oi011 DJ !6788 n--  }$ -.. gdm$$ 
f%89 
f 
 
 
12
	
 
 

!'(;!<
	
 
  C 6*=#> 6    v&9: v   -(

23

	

 )

 

!'(;!<
	
 
  "#67	   23	  -.

23

	

 /

 F#45 *V:L  " /0	F	 & 
 
v.A'B 
v 
 
 

 &': ;
	
 
   &'< =	   &'< =	  $(NKr,   r   N)$stripe._createable_api_resourcer   stripe._deletable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._request_optionsr   stripe._stripe_objectr	   stripe._updateable_api_resourcer
   stripe._utilr   r   typingr   r   r   r   r   r   r   typing_extensionsr   r   r   r   r   stripe._productr   r   r+   r,   r-   <module>r      sl    B ? 4 * = 2 . A : H H H  'zL&! &!	zLr,   