
    Ai&                         d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
 e
rBd 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  dddgiZ! G d de      Z"y)    )StripeService)sanitize_id)Optionalcast)import_module)TYPE_CHECKING)
ListObject)Product)ProductFeatureService)RequestOptions)SearchResultObject)ProductCreateParams)ProductDeleteParams)ProductListParams)ProductRetrieveParams)ProductSearchParams)ProductUpdateParamsfeatureszstripe._product_feature_servicer   c            	           e Zd ZU ded<    fdZd Z	 	 ddeded   ded	   d
dfdZ	 	 ddeded   ded	   d
dfdZ		 	 ddeded   ded	   d
dfdZ
	 	 ddeded   ded	   d
dfdZ	 	 ddeded   ded	   d
dfdZ	 	 ddeded   ded	   d
dfdZ	 	 dded   ded	   d
dfdZ	 	 dded   ded	   d
dfdZ	 d ddded	   d
dfdZ	 d ddded	   d
dfdZ	 d ddded	   d
dfdZ	 d ddded	   d
dfdZ xZS )!ProductServicer   r   c                 $    t         |   |       y N)super__init__)self	requestor	__class__s     J/var/www/html/immo/lib/python3.12/site-packages/stripe/_product_service.pyr   zProductService.__init__   s    #    c                     	 t         |   \  }}t        t        |      |      }t        | | || j                               t        | |      S # t
        $ r t               w xY wr   )_subservicesgetattrr   setattr
_requestorKeyErrorAttributeError)r   nameimport_fromserviceservice_classs        r   __getattr__zProductService.__getattr__!   sn    	##/#5 K#k*M doo.
 4&& 	# ""	#s   A	A A idparamsr   optionsr   returnr
   c                 t    t        d| j                  ddj                  t        |            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/v1/products/{id}r,   apibase_addressr-   r.   r   _requestformatr   r   r,   r-   r.   s       r   r2   zProductService.delete1   sF     MM#**k"o*>"  	
 		
r   c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)r1   r
   r2   r3   r4   r5   r6   Nr   _request_asyncr:   r   r;   s       r   delete_asynczProductService.delete_asyncE   sV      %%#**k"o*>" &  	
 		
   9AA
	Ar   c                 t    t        d| j                  ddj                  t        |            d||            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.
        r
   getr3   r4   r5   r6   r8   r;   s       r   retrievezProductService.retrieveY   sF     MM#**k"o*>"  	
 		
r   c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)rB   r
   rC   r3   r4   r5   r6   Nr=   r;   s       r   retrieve_asynczProductService.retrieve_asyncm   sV      %%#**k"o*>" &  	
 		
r@   r   c                 t    t        d| j                  ddj                  t        |            d||            S )
        Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
        r
   postr3   r4   r5   r6   r8   r;   s       r   updatezProductService.update   sF     MM#**k"o*>"  	
 		
r   c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)rH   r
   rI   r3   r4   r5   r6   Nr=   r;   s       r   update_asynczProductService.update_async   sV      %%#**k"o*>" &  	
 		
r@   r   ListObject[Product]c           
      B    t        d| j                  ddd||            S )
        Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
        rM   rC   /v1/productsr5   r6   r   r9   r   r-   r.   s      r   listzProductService.list   s4     !MM"  	
 		
r   c           
      ^   K   t        d| j                  ddd||       d{         S 7 w)rO   rM   rC   rP   r5   r6   Nr   r>   rR   s      r   
list_asynczProductService.list_async   sD      !%%" &  	
 		
    -+
	-r   c           
      B    t        d| j                  ddd||            S )/
        Creates a new product object.
        r
   rI   rP   r5   r6   rQ   rR   s      r   createzProductService.create   s4     MM"  	
 		
r   c           
      ^   K   t        d| j                  ddd||       d{         S 7 w)rY   r
   rI   rP   r5   r6   NrU   rR   s      r   create_asynczProductService.create_async   sD      %%" &  	
 		
rW   r   SearchResultObject[Product]c           
      B    t        d| j                  ddd||            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.
        r]   rC   /v1/products/searchr5   r6   rQ   rR   s      r   searchzProductService.search   s4     )MM%"  	
 		
r   c           
      ^   K   t        d| j                  ddd||       d{         S 7 w)r_   r]   rC   r`   r5   r6   NrU   rR   s      r   search_asynczProductService.search_async  sD      )%%%" &  	
 		
rW   )NNr   )__name__
__module____qualname____annotations__r   r+   strr   r2   r?   rD   rF   rJ   rL   rS   rV   rZ   r\   ra   rc   __classcell__)r   s   @r   r   r      s   %%$#& 37.2	

 ./
 *+	

 

. 37.2	

 ./
 *+	

 

. 59.2	

 01
 *+	

 

. 59.2	

 01
 *+	

 

. 37.2	

 ./
 *+	

 

. 37.2	

 ./
 *+	

 

, 15.2
,-
 *+
 
	
* 15.2
,-
 *+
 
	
, /3
%
 *+
 
	
, /3
%
 *+
 
	
, /3
%
 *+
 
'	
2 /3
%
 *+
 
'	
r   r   N)#stripe._stripe_servicer   stripe._utilr   typingr   r   	importlibr   typing_extensionsr   stripe._list_objectr	   stripe._productr
   stripe._product_feature_servicer   stripe._request_optionsr   stripe._search_result_objectr   $stripe.params._product_create_paramsr   $stripe.params._product_delete_paramsr   "stripe.params._product_list_paramsr   &stripe.params._product_retrieve_paramsr   $stripe.params._product_search_paramsr   $stripe.params._product_update_paramsr   r!   r    r   r   <module>r{      s]    1 $ ! # +.'E6?HHDLHH 24KL
D
] D
r   