
    _j&                         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"dS )    )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            	       h    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                 J    t                                          |           d S N)super__init__)self	requestor	__class__s     [/var/www/app.qaans.com/backend/venv/lib/python3.11/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__!   s    	##/#5 K#k** M do..  
 4&&& 	# 	# 	# """	#s   AA A7Nidparamsr   optionsr   returnr
   c                     t          d|                     dd                    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   sU     MM#**k"oo*>>"   	
 	
 		
r   c                    K   t          d|                     dd                    t          |                    d||           d{V           S )r1   r
   r2   r3   r4   r5   r6   Nr   _request_asyncr:   r   r;   s       r   delete_asynczProductService.delete_asyncE   sy       %%#**k"oo*>>" &        	
 	
 		
r   r   c                     t          d|                     dd                    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   sU     MM#**k"oo*>>"   	
 	
 		
r   c                    K   t          d|                     dd                    t          |                    d||           d{V           S )rA   r
   rB   r3   r4   r5   r6   Nr=   r;   s       r   retrieve_asynczProductService.retrieve_asyncm   sy       %%#**k"oo*>>" &        	
 	
 		
r   r   c                     t          d|                     dd                    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   sU     MM#**k"oo*>>"   	
 	
 		
r   c                    K   t          d|                     dd                    t          |                    d||           d{V           S )rG   r
   rH   r3   r4   r5   r6   Nr=   r;   s       r   update_asynczProductService.update_async   sy       %%#**k"oo*>>" &        	
 	
 		
r   r   ListObject[Product]c           
      R    t          d|                     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.
        rL   rB   /v1/productsr5   r6   r   r9   r   r-   r.   s      r   listzProductService.list   s>     !MM"   	
 	
 		
r   c           
      b   K   t          d|                     ddd||           d{V           S )rN   rL   rB   rO   r5   r6   Nr   r>   rQ   s      r   
list_asynczProductService.list_async   sb       !%%" &        	
 	
 		
r   r   c           
      R    t          d|                     ddd||                    S )/
        Creates a new product object.
        r
   rH   rO   r5   r6   rP   rQ   s      r   createzProductService.create   s>     MM"   	
 	
 		
r   c           
      b   K   t          d|                     ddd||           d{V           S )rW   r
   rH   rO   r5   r6   NrT   rQ   s      r   create_asynczProductService.create_async   sb       %%" &        	
 	
 		
r   r   SearchResultObject[Product]c           
      R    t          d|                     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[   rB   /v1/products/searchr5   r6   rP   rQ   s      r   searchzProductService.search   s>     )MM%"   	
 	
 		
r   c           
      b   K   t          d|                     ddd||           d{V           S )r]   r[   rB   r^   r5   r6   NrT   rQ   s      r   search_asynczProductService.search_async  sb       )%%%" &        	
 	
 		
r   )NNr   )__name__
__module____qualname____annotations__r   r+   strr   r2   r?   rC   rE   rI   rK   rR   rU   rX   rZ   r_   ra   __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>ry      s   1 0 0 0 0 0 $ $ $ $ $ $ ! ! ! ! ! ! ! ! # # # # # # + + + + + + I......''''''EEEEEE666666??????HHHHHHHHHHHHDDDDDDLLLLLLHHHHHHHHHHHH 24KL
D
 D
 D
 D
 D
] D
 D
 D
 D
 D
r   