
    +ht              
          d dl mZmZmZmZ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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  d d
l!m"Z" e rd dl#m$Z$ d dl%m&Z&  G d ded   ed   ed   ed   ed         Z'y)    )CreateableAPIResourceDeletableAPIResourceListableAPIResourceSearchableAPIResourceUpdateableAPIResource)ExpandableField)
ListObject)SearchResultObject)RequestOptions)StripeObject)class_method_variant)ClassVarDictIteratorListOptionalUnioncastoverload)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)
quote_plus)Price)TaxCodec                      e Zd ZU dZdZeed      ed<    G d de      Z	 G d de      Z
er 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 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d)<   	 e e!d*      ed+<   	 e e"   ed,<   	 e#e	   ed-<   	 e"ed.<   	 e#e"   ed/<   	 eed0<   	 e$e"e"f   ed1<   	 e"ed2<   	 ed   ed3<   	 e e
   ed4<   	 e e   ed5<   	 e e"   ed6<   	 e e!d7      ed8<   	 ed9   ed:<   	 e e"   ed;<   	 eed<<   	 e e"   ed=<   	 e ed>      ed?<   	 e%	 	 	 	 d[dAe e"   dBe e"   dCe e"   dDe e"   dEe&dF   dGd fdH       Z'e%dIe"dEe&dJ   dGd fdK       Z(e)e*dIe"dEe&dJ   dGd fdL              Z+e)dEe&dJ   dGd fdM       Z+ e,dN      dEe&dJ   dGd fdO       Z+e%	 	 	 d\dAe e"   dCe e"   dDe e"   dEe&dP   dGe-d    f
dQ       Z.e%d.e"dEe&dR   dGd fdS       Z/e%d.e"dEe&dT   dGd fdU       Z0e%dVe&dW   dGe1d    fdX       Z2e%dVe&dW   dGe3d    fdY       Z4e	e
dZZ5y@)]Producta  
    Products describe the specific goods or services you offer to your customers.
    For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.
    They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.

    Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription),
    [share a Payment Link](https://stripe.com/docs/payment-links),
    [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront),
    and more about [Products and Prices](https://stripe.com/docs/products-prices/overview)
    productOBJECT_NAMEc                       e Zd ZU ee   ed<   y)Product.FeaturenameN)__name__
__module____qualname__r   str__annotations__     O/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/product.pyFeaturer#   <   s    sm	r+   r-   c                   <    e Zd ZU eed<   	 eed<   	 eed<   	 eed<   y)Product.PackageDimensionsheightlengthweightwidthNr%   r&   r'   floatr)   r*   r+   r,   PackageDimensionsr/   B   s0    	 	 	 	r+   r6   c                   &   e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed	   ed
<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Product.CreateParamsboolactive$Product.CreateParamsDefaultPriceDatadefault_price_datar(   description	List[str]expandz!List[Product.CreateParamsFeature]featuresidimageszDict[str, str]metadatar$   %Product.CreateParamsPackageDimensionspackage_dimensions	shippablestatement_descriptortax_codeLiteral['good', 'service']type
unit_labelurlNr%   r&   r'   r   r)   r(   r*   r+   r,   CreateParamsr8   V   s'   '' !,6!  %U++  ,, ""EFF E""  ,, ""233 I !,7!  #6** #.e"44 "%(( :;; $E** U##r+   rN   c                   <    e Zd ZU eed<   	 eed<   	 eed<   	 eed<   y)rD   r0   r1   r2   r3   Nr4   r*   r+   r,   CreateParamsPackageDimensionsz%Product.CreateParamsPackageDimensions   0    M M M Lr+   rP   c                       e Zd ZU eed<   y)Product.CreateParamsFeaturer$   Nr%   r&   r'   r(   r)   r*   r+   r,   CreateParamsFeaturerS          Ir+   rU   c                   r    e Zd ZU eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed	<   	 ed
   ed<   y)r;   currencyz>Dict[str, Product.CreateParamsDefaultPriceDataCurrencyOptions]currency_options-Product.CreateParamsDefaultPriceDataRecurring	recurring0Literal['exclusive', 'inclusive', 'unspecified']tax_behaviorintunit_amountr(   unit_amount_decimalN)r%   r&   r'   r(   r)   r   r*   r+   r,   CreateParamsDefaultPriceDataz$Product.CreateParamsDefaultPriceData   su    M *P  #?  &B  %U++ "-U!33r+   ra   c                   0    e Zd ZU ed   ed<   	 ed   ed<   y)rZ   )daymonthweekyearintervalr^   interval_countN)r%   r&   r'   r   r)   r   r*   r+   r,   %CreateParamsDefaultPriceDataRecurringz-Product.CreateParamsDefaultPriceDataRecurring   s%    <== (..r+   ri   c                   f    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed	   ed
<   y)3Product.CreateParamsDefaultPriceDataCurrencyOptionsCProduct.CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmountcustom_unit_amountr\   r]   z=List[Product.CreateParamsDefaultPriceDataCurrencyOptionsTier]tiersr^   r_   r(   r`   Nr%   r&   r'   r   r)   r*   r+   r,   +CreateParamsDefaultPriceDataCurrencyOptionsrk      si     +U!  &B  O  %U++ "-U!33r+   rp   c                   p    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 eed   ef   ed<   y	)
7Product.CreateParamsDefaultPriceDataCurrencyOptionsTierr^   flat_amountr(   flat_amount_decimalr_   r`   infup_toN)r%   r&   r'   r   r)   r   r   r^   r*   r+   r,   /CreateParamsDefaultPriceDataCurrencyOptionsTierrr      sc    $U++ "-U!33 %U++ "-U!33 ,--r+   rw   c                   N    e Zd ZU eed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)rl   enabledr^   maximumminimumpresetN)r%   r&   r'   r9   r)   r   r*   r+   r,   ;CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmountzCProduct.CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount  sD     M !'' !''  &&r+   r}   c                       e Zd Zy)Product.DeleteParamsN)r%   r&   r'   r*   r+   r,   DeleteParamsr   '  s    r+   r   c                       e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed	<   	 ed
   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Product.ListParamsr9   r:   zProduct.ListParamsCreated|intcreatedr(   ending_beforer>   r?   idsr^   limitrF   starting_afterrI   rJ   rL   Nro   r*   r+   r,   
ListParamsr   *  s    '' !!@AA 'u--  ,, [)) u%% #6** (.. :;; U##r+   r   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Product.ListParamsCreatedr^   gtgteltlteNro   r*   r+   r,   ListParamsCreatedr   T  sH    E"" U## E"" U##r+   r   c                      e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed	   ed
<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Product.ModifyParamsr9   r:   r(   default_pricezLiteral['']|strr=   r>   r?   z-Literal['']|List[Product.ModifyParamsFeature]r@   zLiteral['']|List[str]rB   zLiteral['']|Dict[str, str]rC   r$   z1Literal['']|Product.ModifyParamsPackageDimensionsrE   rF   rG   rH   rK   rL   Nro   r*   r+   r,   ModifyParamsr   f  s   '' 'u-- %%677  ,, "?    788 "">?? e$$ !,C!  #6** #.e"44 ""344 $$566 .//r+   r   c                   <    e Zd ZU eed<   	 eed<   	 eed<   	 eed<   y)%Product.ModifyParamsPackageDimensionsr0   r1   r2   r3   Nr4   r*   r+   r,   ModifyParamsPackageDimensionsr     rQ   r+   r   c                       e Zd ZU eed<   y)Product.ModifyParamsFeaturer$   NrT   r*   r+   r,   ModifyParamsFeaturer     rV   r+   r   c                       e Zd ZU ed   ed<   y)Product.RetrieveParamsr>   r?   Nro   r*   r+   r,   RetrieveParamsr     s    ,,r+   r   c                   N    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 eed<   y)	Product.SearchParamsr>   r?   r^   r   r(   pagequeryNrM   r*   r+   r,   SearchParamsr     sB    ,, u%% e$$ Jr+   r   r:   r   r   r   r=   r@   rA   rB   livemoderC   r$   objectrE   rF   rG   r   rH   )goodservicerJ   rK   updatedrL   TdeletedNapi_keyidempotency_keystripe_versionstripe_accountparamsr8   returnc                 `    t        d| j                  d| j                         |||||            S )z/
        Creates a new product object.
        r   post)r   _static_request	class_url)clsr   r   r   r   r   s         r,   createzProduct.create(  s=     
 	
r+   sidr   c                 z    | j                         dt        |      }t        d| j                  d||            S )
        Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.
        /r   deleter   r   r   r   r   )r   r   r   rL   s       r,   _cls_deletezProduct._cls_deleteA  s=     *S/:#f=
 	
r+   c                      yr   Nr*   )r   r   s     r,   r   zProduct.deleteN  s     	r+   c                      yr   r*   selfr   s     r,   r   zProduct.deleteX  s    
 	r+   r   c                 F    | j                  d| j                         |      S )r   r   r   )_request_and_refreshinstance_urlr   s     r,   r   zProduct.delete_  s.     (( ) 
 	
r+   r   c                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )z
        Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
        get)r   r   r   r   z%Expected list object from API, got %s)r   r   
isinstancer	   	TypeErrorrJ   r%   )r   r   r   r   r   results         r,   listzProduct.listl  sf     $$MMO)) % 
 &*-7<((* 
 r+   r   c                 z    | j                         dt        |      }t        d| j                  d||            S )z
        Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
        r   r   r   r   r   )r   rA   r   rL   s       r,   modifyzProduct.modify  s=     *R.9F;
 	
r+   r   c                 8     | |fi |}|j                          |S )z
        Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.
        )refresh)r   rA   r   instances       r,   retrievezProduct.retrieve  s$     r$V$r+   kwargsr   c                 *     | j                   |ddi|S )a  
        Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
        Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
        conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
        to an hour behind during outages. Search functionality is not available to merchants in India.
        
search_urlz/v1/products/search)_searchr   argsr   s      r,   searchzProduct.search  s      s{{dM&;MfMMr+   c                 B     | j                   |i |j                         S )N)r   auto_paging_iterr   s      r,   search_auto_paging_iterzProduct.search_auto_paging_iter  s#     szz4*6*;;==r+   )r@   rE   )NNNN)NNN)6r%   r&   r'   __doc__r!   r   r   r)   r   r-   r6   r   r   rN   r   rP   rU   ra   ri   rp   rw   r}   r   r   r   r   r   r   r   r   r9   r^   r   r   r(   r   r   classmethodr   r   r   r   staticmethodr   r   r	   r   r   r   r
   r   r   r   _inner_class_typesr*   r+   r,   r   r   (   s   	 1:K'),-9, L $ G	> G	R	I 	$	) 		9 	@	I 		) 	8	i 	,		(	> 	(	 (	T		 	$?	> ?	B	I 	$	) 		^ 		> 	$ L L OG455 # 7m 	G I N 38n I I !!233 ~ #3-' y122 #
$$  L 
# gdm$$  "&)-(,(,
#
 "#
 !	

 !
 /0
 

 
0 



!'(>!?

	

 

 "#9:	   v&<= )   -(

56

	

 )

  "&(,(,	# ! !	
 -. 
I	 6 



 &'= >

	

 

  &'? @	  	N$%;<	N	I	&	N 	N >$%;<>	)	> > /r+   r   N)(stripe.api_resources.abstractr   r   r   r   r   %stripe.api_resources.expandable_fieldr    stripe.api_resources.list_objectr	   )stripe.api_resources.search_result_objectr
   stripe.request_optionsr   stripe.stripe_objectr   stripe.utilr   typingr   r   r   r   r   r   r   r   typing_extensionsr   r   r   r   r   urllib.parser   stripe.api_resources.pricer   stripe.api_resources.tax_coder   r   r*   r+   r,   <module>r      s     B 7 H 1 - ,	 	 	  $05M
)$#	")$)$M
r+   