o
    Big                     @   s   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mZmZ d d	lmZmZmZ G d
d deZdS )    )
ListObject)Product)ProductFeatureService)RequestOptions)SearchResultObject)StripeService)sanitize_id)DictListUnioncast)LiteralNotRequired	TypedDictc                	       s  e Zd Z fddZG dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd  d eZG d!d" d"eZi i fd#ed$d%d&ed'efd(d)Zi i fd#ed$d%d&ed'efd*d+Zi i fd#ed$d,d&ed'efd-d.Zi i fd#ed$d,d&ed'efd/d0Zi i fd#ed$d1d&ed'efd2d3Zi i fd#ed$d1d&ed'efd4d5Zi i fd$d6d&ed'ee fd7d8Zi i fd$d6d&ed'ee fd9d:Z i fd$d;d&ed'efd<d=Z!i fd$d;d&ed'efd>d?Z"i fd$d@d&ed'e#e fdAdBZ$i fd$d@d&ed'e#e fdCdDZ%  Z&S )EProductServicec                    s   t  | t| j| _d S )N)super__init__r   
_requestorfeatures)self	requestor	__class__ W/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_product_service.pyr      s   zProductService.__init__c                   @   s   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  ed< 	 eed  ed	< 	 e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e ed< 	 ee ed< dS )ProductService.CreateParamsactive+ProductService.CreateParamsDefaultPriceDatadefault_price_datadescriptionexpandidimages+ProductService.CreateParamsMarketingFeaturemarketing_featuresmetadataname,ProductService.CreateParamsPackageDimensionspackage_dimensions	shippablestatement_descriptortax_codegoodservicetype
unit_labelurlN)
__name__
__module____qualname__r   bool__annotations__strr
   r	   r   r   r   r   r   CreateParams   sN   
 r8   c                   @   sh   e Zd ZU eed< 	 eeedf  ed< 	 ed ed< 	 eed  ed< 	 ee ed< 	 ee ed	< d
S )r   currency:ProductService.CreateParamsDefaultPriceDataCurrencyOptionscurrency_options4ProductService.CreateParamsDefaultPriceDataRecurring	recurring	exclusive	inclusiveunspecifiedtax_behaviorunit_amountunit_amount_decimalN)	r2   r3   r4   r7   r6   r   r	   r   intr   r   r   r   CreateParamsDefaultPriceData^   s.   
 rF   c                   @   sZ   e Zd ZU ed ed< 	 eed  ed< 	 eed  ed< 	 ee ed< 	 ee ed< d	S )
r:   JProductService.CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmountcustom_unit_amountr>   rB   >ProductService.CreateParamsDefaultPriceDataCurrencyOptionsTiertiersrC   rD   N)	r2   r3   r4   r   r6   r   r
   rE   r7   r   r   r   r   +CreateParamsDefaultPriceDataCurrencyOptions   s&   
 rK   c                   @   s@   e Zd ZU eed< 	 ee ed< 	 ee ed< 	 ee ed< dS )rG   enabledmaximumminimumpresetN)r2   r3   r4   r5   r6   r   rE   r   r   r   r   ;CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount   s   
 rP   c                   @   sZ   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< dS )rI   flat_amountflat_amount_decimalrC   rD   infup_toN)	r2   r3   r4   r   rE   r6   r7   r   r   r   r   r   r   /CreateParamsDefaultPriceDataCurrencyOptionsTier   s   
 rU   c                   @   s(   e Zd ZU ed ed< 	 ee ed< dS )r<   )daymonthweekyearintervalinterval_countN)r2   r3   r4   r   r6   r   rE   r   r   r   r   %CreateParamsDefaultPriceDataRecurring   s
   
 r\   c                   @      e Zd ZU eed< dS )r#   r&   Nr2   r3   r4   r7   r6   r   r   r   r   CreateParamsMarketingFeature      
 r_   c                   @   4   e Zd ZU eed< 	 eed< 	 eed< 	 eed< dS )r'   heightlengthweightwidthNr2   r3   r4   floatr6   r   r   r   r   CreateParamsPackageDimensions      
 rh   c                   @   s   e Zd ZdS )ProductService.DeleteParamsN)r2   r3   r4   r   r   r   r   DeleteParams   s    rk   c                   @   s   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  ed< 	 ee ed< 	 ee ed< 	 ee ed	< 	 ee	d
  ed< 	 ee ed< dS )ProductService.ListParamsr   z$ProductService.ListParamsCreated|intcreatedending_beforer    idslimitr)   starting_afterr,   r/   r1   N)
r2   r3   r4   r   r5   r6   r7   r
   rE   r   r   r   r   r   
ListParams   s*   
 rr   c                   @   sD   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )z ProductService.ListParamsCreatedgtgteltlteN)r2   r3   r4   r   rE   r6   r   r   r   r   ListParamsCreated  s   
 rw   c                   @   s   e Zd ZU eee  ed< dS )ProductService.RetrieveParamsr    N)r2   r3   r4   r   r
   r7   r6   r   r   r   r   RetrieveParams*  s   
 ry   c                   @   sD   e Zd ZU eee  ed< 	 ee ed< 	 ee ed< 	 eed< dS )ProductService.SearchParamsr    rp   pagequeryN)r2   r3   r4   r   r
   r7   r6   rE   r   r   r   r   SearchParams0  s   
 r}   c                   @   s   e Zd ZU ee ed< 	 ee ed< 	 ed ed< 	 eee  ed< 	 ed ed< 	 ed 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d ed< 	 ed ed< dS )ProductService.UpdateParamsr   default_pricezLiteral['']|strr   r    zLiteral['']|List[str]r"   z=Literal['']|List[ProductService.UpdateParamsMarketingFeature]r$   zLiteral['']|Dict[str, str]r%   r&   z8Literal['']|ProductService.UpdateParamsPackageDimensionsr(   r)   r*   r+   r0   r1   N)r2   r3   r4   r   r5   r6   r7   r
   r   r   r   r   UpdateParamsB  sB   
 r   c                   @   r]   )z+ProductService.UpdateParamsMarketingFeaturer&   Nr^   r   r   r   r   UpdateParamsMarketingFeature  r`   r   c                   @   ra   )z,ProductService.UpdateParamsPackageDimensionsrb   rc   rd   re   Nrf   r   r   r   r   UpdateParamsPackageDimensions  ri   r   r!   paramsrj   optionsreturnc              	   C   &   t t| jddjt|dd||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.
        delete/v1/products/{id}r!   apibase_addressr   r   r   r   _requestformatr   r   r!   r   r   r   r   r   r        	zProductService.deletec              	      .   t t| jddjt|dd||dI dH S )r   r   r   r   r   r   Nr   r   _request_asyncr   r   r   r   r   r   delete_async     	
zProductService.delete_asyncrx   c              	   C   r   )
        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.
        getr   r   r   r   r   r   r   r   r   retrieve  r   zProductService.retrievec              	      r   )r   r   r   r   r   r   Nr   r   r   r   r   retrieve_async  r   zProductService.retrieve_asyncr~   c              	   C   r   )
        Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
        postr   r   r   r   r   r   r   r   r   update  r   zProductService.updatec              	      r   )r   r   r   r   r   r   Nr   r   r   r   r   update_async  r   zProductService.update_asyncrl   c              	   C      t tt | j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.
        r   /v1/productsr   r   )r   r   r   r   r   r   r   r   r   r   list  s   zProductService.listc              	      &   t tt | jddd||dI dH S )r   r   r   r   r   N)r   r   r   r   r   r   r   r   
list_async&  s   
zProductService.list_asyncr   c              	   C   s   t t| jddd||dS )/
        Creates a new product object.
        r   r   r   r   )r   r   r   r   r   r   r   create9  s   zProductService.createc              	      s"   t t| jddd||dI dH S )r   r   r   r   r   N)r   r   r   r   r   r   r   create_asyncL  s   
zProductService.create_asyncrz   c              	   C   r   )  
        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.
        r   /v1/products/searchr   r   )r   r   r   r   r   r   r   r   search_  s   zProductService.searchc              	      r   )r   r   r   r   r   N)r   r   r   r   r   r   r   r   search_asyncu  s   
zProductService.search_async)'r2   r3   r4   r   r   r8   rF   rK   rP   rU   r\   r_   rh   rk   rr   rw   ry   r}   r   r   r   r7   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__r   r   r   r   r      s   K#

*A










r   N)stripe._list_objectr   stripe._productr   stripe._product_feature_servicer   stripe._request_optionsr   stripe._search_result_objectr   stripe._stripe_servicer   stripe._utilr   typingr	   r
   r   r   typing_extensionsr   r   r   r   r   r   r   r   <module>   s   