
    AiQ                        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 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mZ d dl m!Z!m"Z"m#Z# e#rNd 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l0m1Z1 d dl2m3Z3 d dl4m5Z5 d dl6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z=  ed       G d ded   ed   e	d   ed   ed                Z>y)    )CreateableAPIResource)DeletableAPIResource)ExpandableField)
ListObject)ListableAPIResource)nested_resource_class_methods)SearchResultObject)SearchableAPIResource)StripeObject)UpdateableAPIResource)class_method_variantsanitize_id)AsyncIteratorClassVarDictIteratorListOptionalcastoverload)LiteralUnpackTYPE_CHECKING)Price)ProductFeature)TaxCode)ProductCreateFeatureParams)ProductCreateParams)ProductDeleteFeatureParams)ProductDeleteParams)ProductListFeaturesParams)ProductListParams)ProductModifyParams)ProductRetrieveFeatureParams)ProductRetrieveParams)ProductSearchParamsfeaturec            	          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ed<   	 eed	<   	 eed
      ed<   	 eed      ed<   	 ee   ed<   	 eed<   	 ee   ed<   	 eed<   	 ee	   ed<   	 eeef   ed<   	 eed<   	 ed   ed<   	 ee
   ed<   	 ee   ed<   	 ee   ed<   	 eed      ed<   	 ed   ed<   	 ee   ed<   	 eed<   	 ee   ed<   	 ed ed!   d"d fd#       Zed ed!   d"d fd$       Zed%ed ed&   d"d fd'       Zeed%ed ed&   d"d fd(              Zed ed&   d"d fd)       Z ed*      d ed&   d"d fd+       Zed%ed ed&   d"d fd,       Zeed%ed ed&   d"d fd-              Zed ed&   d"d fd.       Z ed/      d ed&   d"d fd0       Zed ed1   d"ed    fd2       Zed ed1   d"ed    fd3       Zeded ed4   d"d fd5       Z eded ed4   d"d fd6       Z!eded ed7   d"d fd8       Z"eded ed7   d"d fd9       Z#ed:ed;   d"e$d    fd<       Z%ed:ed;   d"e$d    fd=       Z&ed:ed;   d"e'd    fd>       Z(ed:ed;   d"e)d    fd?       Z*ededed ed@   d"dAfdB       Z+ededed ed@   d"dAfdC       Z,ededed edD   d"dAfdE       Z-ededed edD   d"dAfdF       Z.eded edG   d"edA   fdH       Z/eded edG   d"edA   fdI       Z0eded edJ   d"dAfdK       Z1eded edJ   d"dAfdL       Z2e	e
dMZ3yN)O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.MarketingFeaturenameN)__name__
__module____qualname__r   str__annotations__     B/var/www/html/immo/lib/python3.12/site-packages/stripe/_product.pyMarketingFeaturer-   G   s    sm	r5   r7   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/   r0   r1   floatr3   r4   r5   r6   PackageDimensionsr9   M   s0    	 	 	 	r5   r?   activecreatedr   default_priceTdeleteddescriptionidimageslivemodemarketing_featuresmetadatar.   objectpackage_dimensions	shippablestatement_descriptorr   tax_code)goodservicetype
unit_labelupdatedurlparamsr   returnc                 Z    t        d| j                  d| j                         |            S )/
        Creates a new product object.
        r)   postrU   )r   _static_request	class_urlclsrU   s     r6   createzProduct.create   s6    
    
 	
r5   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)rX   r)   rY   rZ   N)r   _static_request_asyncr\   r]   s     r6   create_asynczProduct.create_async   sD      ++ ,  
 	
s   ,97
	9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)   deleterZ   r\   r   r   r[   r^   rc   rU   rT   s       r6   _cls_deletezProduct._cls_delete   sE     +c*:;   
 	
r5   c                      yre   Nr4   rc   rU   s     r6   rg   zProduct.delete   s     	r5   c                      yrl   r4   selfrU   s     r6   rg   zProduct.delete   s    
 	r5   rj   c                 F    | j                  d| j                         |      S )re   rg   rZ   )_request_and_refreshinstance_urlro   s     r6   rg   zProduct.delete   s.     (( ) 
 	
r5   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)re   rf   r)   rg   rZ   Nr\   r   r   ra   ri   s       r6   _cls_delete_asynczProduct._cls_delete_async   sS      +c*:;++ ,  
 	
   <A	A
	A	c                    K   ywrl   r4   rm   s     r6   delete_asynczProduct.delete_async  s      	   c                    K   ywrl   r4   ro   s     r6   ry   zProduct.delete_async  s      	rz   rv   c                 b   K   | j                  d| j                         |       d{   S 7 w)re   rg   rZ   N)_request_and_refresh_asyncrs   ro   s     r6   ry   zProduct.delete_async  s<      44 5 
 
 	
 
s   &/-/r"   c                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |S )
        Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
        getrZ   %Expected list object from API, got %s)r[   r\   
isinstancer   	TypeErrorrQ   r/   r^   rU   results      r6   listzProduct.list,  s]     $$MMO % 

 &*-7<((* 
 r5   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)r   r   rZ   Nr   )ra   r\   r   r   r   rQ   r/   r   s      r6   
list_asynczProduct.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 specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
        rf   r)   rY   rZ   rh   r^   rE   rU   rT   s       r6   modifyzProduct.modifyT  sD     +b/:   
 	
r5   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r   rf   r)   rY   rZ   Nru   r   s       r6   modify_asynczProduct.modify_asynce  sR      +b/:++ ,  
 	
rw   r%   c                 8     | |fi |}|j                          |S )
        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^   rE   rU   instances       r6   retrievezProduct.retrievev  s$     r$V$r5   c                 T   K    | |fi |}|j                          d{    |S 7 w)r   N)refresh_asyncr   s       r6   retrieve_asynczProduct.retrieve_async  s3      r$V$$$&&& 	's   (&(kwargsr&   c                 *     | j                   |ddi|S )  
        Search for products you've previously created using Stripe's [Search Query Language](https://docs.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_url/v1/products/search)_searchr^   argsr   s      r6   searchzProduct.search  s      s{{dM&;MfMMr5   c                 F   K    | j                   |ddi| d{   S 7 w)r   r   r   N)_search_asyncr   s      r6   search_asynczProduct.search_async  s:      'S&&/3
,
7=
 
 	
 
s   !!c                 B     | j                   |i |j                         S N)r   auto_paging_iterr   s      r6   search_auto_paging_iterzProduct.search_auto_paging_iter  s#     szz4*6*;;==r5   c                 ^   K    | j                   |i | d {   j                         S 7 wr   )r   r   r   s      r6   search_auto_paging_iter_asyncz%Product.search_auto_paging_iter_async  s/      'c&&777IIKK7s   -+-r   r   c                     t        d| j                  ddj                  t        |      t        |            |            S )=
        Deletes the feature attachment to a product
        r   rg   $/v1/products/{product}/features/{id}r*   rE   rZ   r   r[   formatr   r^   r*   rE   rU   s       r6   delete_featurezProduct.delete_feature  sP     6=='0[_ >     	
 		
r5   c                    K   t        d| j                  ddj                  t        |      t        |            |       d{         S 7 w)r   r   rg   r   r   rZ   Nr   ra   r   r   r   s       r6   delete_feature_asynczProduct.delete_feature_async  s^      ++6=='0[_ >   ,  	
 		
   AAA
	Ar$   c                     t        d| j                  ddj                  t        |      t        |            |            S )a
        Retrieves a product_feature, which represents a feature attachment to a product
        r   r   r   r   rZ   r   r   s       r6   retrieve_featurezProduct.retrieve_feature  sP     6=='0[_ >     	
 		
r5   c                    K   t        d| j                  ddj                  t        |      t        |            |       d{         S 7 w)r   r   r   r   r   rZ   Nr   r   s       r6   retrieve_feature_asynczProduct.retrieve_feature_async  s^      ++6=='0[_ >   ,  	
 		
r   r!   c                 ~    t        t        d   | j                  ddj                  t	        |            |            S );
        Retrieve a list of features for a product
        r   r   /v1/products/{product}/featuresr*   rZ   )r   r   r[   r   r   r^   r*   rU   s      r6   list_featureszProduct.list_features  sP     '(188'0 9     	
 		
r5   c                    K   t        t        d   | j                  ddj                  t	        |            |       d{         S 7 w)r   r   r   r   r   rZ   N)r   r   ra   r   r   r   s      r6   list_features_asynczProduct.list_features_async  s^      '(++188'0 9   ,  	
 		
s   >A A	
	Ar   c                 p    t        d| j                  ddj                  t        |            |            S )_
        Creates a product_feature, which represents a feature attachment to a product
        r   rY   r   r   rZ   r   r   s      r6   create_featurezProduct.create_feature*  sJ     188'0 9     	
 		
r5   c                    K   t        d| j                  ddj                  t        |            |       d{         S 7 w)r   r   rY   r   r   rZ   Nr   r   s      r6   create_feature_asynczProduct.create_feature_async<  sX      ++188'0 9   ,  	
 		
s   7AA
	A)rH   rK   N)4r/   r0   r1   __doc__r+   r   r   r3   r   r7   r?   boolintr   r   r2   r   r   classmethodr   r_   rb   rj   r   staticmethodrg   r   rv   ry   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   _inner_class_typesr4   r5   r6   r)   r)   2   s-   	 1:K'),-9< L $ L L OG455 gdm$$ # 	G I N -.. 38n I I !!233 ~ #3-' y122 #
$$  L 
# 
f%:; 
	 
 
 
34
	
 
 

!'(=!>
	
 
  C 6*?#@ Y    v&;<    -(

45

	

 )

 

!'(=!>
	
 
  "#89	   45	  -.

45

	

 /

 12	I	 & 12	I	 & 

 &'< =
	
 
  

 &'< =
	
 
   &'> ?	   &'> ?	  	N$%:;	N	I	&	N 	N 
$%:;
	I	&
 
 >$%:;>	)	> >
 L$%:;L	y	!L L
 

 
 56	

 

 
( 

 
 56	

 

 
( 

 
 78	

 

 
( 

 
 78	

 

 
( 

%+,G%H
	$	%
 
" 

%+,G%H
	$	%
 
" 

%+,H%I
	
 
" 

%+,H%I
	
 
$ //r5   r)   N)?stripe._createable_api_resourcer   stripe._deletable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   %stripe._nested_resource_class_methodsr   stripe._search_result_objectr	   stripe._searchable_api_resourcer
   stripe._stripe_objectr   stripe._updateable_api_resourcer   stripe._utilr   r   typingr   r   r   r   r   r   r   r   typing_extensionsr   r   r   stripe._pricer   stripe._product_featurer   stripe._tax_coder   ,stripe.params._product_create_feature_paramsr   $stripe.params._product_create_paramsr   ,stripe.params._product_delete_feature_paramsr   $stripe.params._product_delete_paramsr    +stripe.params._product_list_features_paramsr!   "stripe.params._product_list_paramsr"   $stripe.params._product_modify_paramsr#   .stripe.params._product_retrieve_feature_paramsr$   &stripe.params._product_retrieve_paramsr%   $stripe.params._product_search_paramsr&   r)   r4   r5   r6   <module>r      s    B ? 4 * = O ; A . A :	 	 	 = <#6( I I EH MH y)^)$#	")$)$^ *^r5   