o
    Bi                     @   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)Quote)$QuoteComputedUpfrontLineItemsService)QuoteLineItemService)RequestOptions)StripeService)sanitize_id)AnyDictList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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/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZG d9d: d:eZ G d;d< d<eZ!G d=d> d>eZ"G d?d@ d@eZ#i i fdAdBdCe$dDe%e& fdEdFZ'i i fdAdBdCe$dDe%e& fdGdHZ(i i fdAdIdCe$dDe&fdJdKZ)i i fdAdIdCe$dDe&fdLdMZ*i i fdNe+dAdOdCe$dDe&fdPdQZ,i i fdNe+dAdOdCe$dDe&fdRdSZ-i i fdNe+dAdTdCe$dDe&fdUdVZ.i i fdNe+dAdTdCe$dDe&fdWdXZ/i i fdNe+dAdYdCe$dDe&fdZd[Z0i i fdNe+dAdYdCe$dDe&fd\d]Z1i i fdNe+dAd^dCe$dDe&fd_d`Z2i i fdNe+dAd^dCe$dDe&fdadbZ3i i fdNe+dAdcdCe$dDe&fdddeZ4i i fdNe+dAdcdCe$dDe&fdfdgZ5i i fdNe+dAdhdCe$dDe6fdidjZ7i i fdNe+dAdhdCe$dDe6fdkdlZ8  Z9S )mQuoteServicec                    s(   t  | t| j| _t| j| _d S )N)super__init__r   
_requestor
line_itemsr   computed_upfront_line_items)self	requestor	__class__ U/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_quote_service.pyr      s   zQuoteService.__init__c                   @      e Zd ZU eee  ed< dS )QuoteService.AcceptParamsexpandN__name__
__module____qualname__r   r   str__annotations__r   r   r   r   AcceptParams      
 r%   c                   @   r   )QuoteService.CancelParamsr   Nr   r   r   r   r   CancelParams    r&   r(   c                   @   s8  e Zd ZU ed ed< 	 ed ed< 	 ed ed< 	 eed  ed< 	 ee ed	< 	 ed
 ed< 	 ed ed< 	 ed ed< 	 eee  ed< 	 ee ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 eed  ed< 	 ee	eef  ed< 	 ed ed< 	 ed ed< 	 ee ed< 	 ed ed < d!S )"QuoteService.CreateParamsLiteral['']|intapplication_fee_amountLiteral['']|floatapplication_fee_percent%QuoteService.CreateParamsAutomaticTaxautomatic_taxcharge_automaticallysend_invoicecollection_methodcustomerLiteral['']|List[str]default_tax_ratesLiteral['']|strdescriptionz3Literal['']|List[QuoteService.CreateParamsDiscount]	discountsr   
expires_atfooter"QuoteService.CreateParamsFromQuote
from_quoteheader(QuoteService.CreateParamsInvoiceSettingsinvoice_settings!QuoteService.CreateParamsLineItemr   metadataon_behalf_of)QuoteService.CreateParamsSubscriptionDatasubscription_data
test_clockz1Literal['']|QuoteService.CreateParamsTransferDatatransfer_dataN
r    r!   r"   r   r$   r   r#   r   intr
   r   r   r   r   CreateParams&   sf   
 rJ   c                   @   $   e Zd ZU eed< 	 ed ed< dS )r.   enabled.QuoteService.CreateParamsAutomaticTaxLiability	liabilityNr    r!   r"   boolr$   r   r   r   r   r   CreateParamsAutomaticTax      
 rQ   c                   @   (   e Zd ZU ee ed< 	 ed ed< dS )rM   accountrT   r   typeNr    r!   r"   r   r#   r$   r   r   r   r   r   !CreateParamsAutomaticTaxLiability   
   
 rX   c                   @   6   e Zd ZU ee ed< 	 ee ed< 	 ee ed< dS )z!QuoteService.CreateParamsDiscountcoupondiscountpromotion_codeNr    r!   r"   r   r#   r$   r   r   r   r   CreateParamsDiscount      
 r_   c                   @   s$   e Zd ZU ee ed< 	 eed< dS )r<   is_revisionquoteN)r    r!   r"   r   rP   r$   r#   r   r   r   r   CreateParamsFromQuote   s
   
 rc   c                   @   (   e Zd ZU ee ed< 	 ed ed< dS )r?   days_until_due.QuoteService.CreateParamsInvoiceSettingsIssuerissuerNr    r!   r"   r   rI   r$   r   r   r   r   CreateParamsInvoiceSettings   rY   ri   c                   @   rS   )rf   rT   rU   rV   NrW   r   r   r   r   !CreateParamsInvoiceSettingsIssuer   rY   rj   c                   @   sR   e Zd ZU ed ed< 	 ee ed< 	 ed ed< 	 ee ed< 	 ed ed< d	S )
rA   z;Literal['']|List[QuoteService.CreateParamsLineItemDiscount]r9   price*QuoteService.CreateParamsLineItemPriceData
price_dataquantityr5   	tax_ratesNr    r!   r"   r   r$   r#   rI   r   r   r   r   CreateParamsLineItem   s   
 rq   c                   @   rZ   )z)QuoteService.CreateParamsLineItemDiscountr[   r\   r]   Nr^   r   r   r   r   CreateParamsLineItemDiscount   r`   rr   c                   @   \   e Zd ZU eed< 	 eed< 	 ed ed< 	 eed  ed< 	 ee ed< 	 ee ed< d	S )
rl   currencyproduct3QuoteService.CreateParamsLineItemPriceDataRecurring	recurring	exclusive	inclusiveunspecifiedtax_behaviorunit_amountunit_amount_decimalNr    r!   r"   r#   r$   r   r   rI   r   r   r   r   CreateParamsLineItemPriceData   "   
 r   c                   @   (   e Zd ZU ed ed< 	 ee ed< dS )rv   daymonthweekyearintervalinterval_countNr    r!   r"   r   r$   r   rI   r   r   r   r   &CreateParamsLineItemPriceDataRecurring  rY   r   c                   @   sL   e Zd ZU ee ed< 	 ed ed< 	 eeeef  ed< 	 ed ed< dS )rD   r8   -Literal['']|Literal['current_period_end']|inteffective_daterB   r*   trial_period_daysN)r    r!   r"   r   r#   r$   r
   r   r   r   r   CreateParamsSubscriptionData     
 r   c                   @   2   e Zd ZU ee ed< 	 ee ed< 	 eed< dS )z%QuoteService.CreateParamsTransferDataamountamount_percentdestinationNr    r!   r"   r   rI   r$   floatr#   r   r   r   r   CreateParamsTransferData&     
 r   c                   @   s,   e Zd ZU eee  ed< 	 ee ed< dS ) QuoteService.FinalizeQuoteParamsr   r:   N)r    r!   r"   r   r   r#   r$   rI   r   r   r   r   FinalizeQuoteParams4  s
   
 r   c                   @   sv   e Zd ZU ee ed< 	 ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< 	 eed  ed< 	 ee ed< d	S )
QuoteService.ListParamsr4   ending_beforer   limitstarting_after)acceptedcanceleddraftopenstatusrF   N)	r    r!   r"   r   r#   r$   r   rI   r   r   r   r   r   
ListParams>  s   
 r   c                   @   r   )QuoteService.PdfParamsr   Nr   r   r   r   r   	PdfParams\  r&   r   c                   @   r   )QuoteService.RetrieveParamsr   Nr   r   r   r   r   RetrieveParamsb  r&   r   c                   @   s  e Zd ZU ed ed< 	 ed ed< 	 ed ed< 	 eed  ed< 	 ee ed	< 	 ed
 ed< 	 ed ed< 	 ed ed< 	 eee  ed< 	 ee ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 eed  ed< 	 ee	eef  ed< 	 ed ed< 	 ed ed< 	 ed ed< dS )QuoteService.UpdateParamsr*   r+   r,   r-   %QuoteService.UpdateParamsAutomaticTaxr/   r0   r3   r4   r5   r6   r7   r8   z3Literal['']|List[QuoteService.UpdateParamsDiscount]r9   r   r:   r;   r>   (QuoteService.UpdateParamsInvoiceSettingsr@   !QuoteService.UpdateParamsLineItemr   rB   rC   )QuoteService.UpdateParamsSubscriptionDatarE   z1Literal['']|QuoteService.UpdateParamsTransferDatarG   NrH   r   r   r   r   UpdateParamsh  s^   
 r   c                   @   rK   )r   rL   .QuoteService.UpdateParamsAutomaticTaxLiabilityrN   NrO   r   r   r   r   UpdateParamsAutomaticTax  rR   r   c                   @   rS   )r   rT   rU   rV   NrW   r   r   r   r   !UpdateParamsAutomaticTaxLiability  rY   r   c                   @   rZ   )z!QuoteService.UpdateParamsDiscountr[   r\   r]   Nr^   r   r   r   r   UpdateParamsDiscount  r`   r   c                   @   rd   )r   re   .QuoteService.UpdateParamsInvoiceSettingsIssuerrg   Nrh   r   r   r   r   UpdateParamsInvoiceSettings  rY   r   c                   @   rS   )r   rT   rU   rV   NrW   r   r   r   r   !UpdateParamsInvoiceSettingsIssuer  rY   r   c                   @   s`   e Zd ZU ed ed< 	 ee ed< 	 ee ed< 	 ed ed< 	 ee ed< 	 ed ed	< d
S )r   z;Literal['']|List[QuoteService.UpdateParamsLineItemDiscount]r9   idrk   *QuoteService.UpdateParamsLineItemPriceDatarm   rn   r5   ro   Nrp   r   r   r   r   UpdateParamsLineItem  s   
 r   c                   @   rZ   )z)QuoteService.UpdateParamsLineItemDiscountr[   r\   r]   Nr^   r   r   r   r   UpdateParamsLineItemDiscount  r`   r   c                   @   rs   )
r   rt   ru   3QuoteService.UpdateParamsLineItemPriceDataRecurringrw   rx   r|   r}   r~   Nr   r   r   r   r   UpdateParamsLineItemPriceData  r   r   c                   @   r   )r   r   r   r   Nr   r   r   r   r   &UpdateParamsLineItemPriceDataRecurring<  rY   r   c                   @   sL   e Zd ZU ed ed< 	 ed ed< 	 eeeef  ed< 	 ed ed< dS )	r   r7   r8   r   r   rB   r*   r   N)r    r!   r"   r   r$   r
   r#   r   r   r   r   UpdateParamsSubscriptionDataF  r   r   c                   @   r   )z%QuoteService.UpdateParamsTransferDatar   r   r   Nr   r   r   r   r   UpdateParamsTransferDataZ  r   r   paramsr   optionsreturnc              	   C   s   t tt | jddd||dS )0
        Returns a list of your quotes.
        get
/v1/quotesapibase_addressr   r   )r   r   r   _requestr   r   r   r   r   r   listh  s   zQuoteService.listc              	      s&   t tt | jddd||dI dH S )r   r   r   r   r   N)r   r   r   _request_asyncr   r   r   r   
list_async{  s   
zQuoteService.list_asyncr)   c              	   C   s   t t| jddd||dS )
        A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
        postr   r   r   )r   r   r   r   r   r   r   create  s   zQuoteService.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_async  s   
zQuoteService.create_asyncrb   r   c              	   C   &   t t| jddjt|dd||dS )8
        Retrieves the quote with the given ID.
        r   /v1/quotes/{quote}rb   r   r   r   r   r   formatr   r   rb   r   r   r   r   r   retrieve     	zQuoteService.retrievec              	      .   t t| jddjt|dd||dI dH S )r   r   r   r   r   r   Nr   r   r   r   r   r   r   r   r   retrieve_async     	
zQuoteService.retrieve_asyncr   c              	   C   r   )D
        A quote models prices and services for a customer.
        r   r   r   r   r   r   r   r   r   r   update  r   zQuoteService.updatec              	      r   )r   r   r   r   r   r   Nr   r   r   r   r   update_async  r   zQuoteService.update_asyncr   c              	   C   r   ).
        Accepts the specified quote.
        r   /v1/quotes/{quote}/acceptr   r   r   r   r   r   r   r   accept  r   zQuoteService.acceptc              	      r   )r   r   r   r   r   r   Nr   r   r   r   r   accept_async  r   zQuoteService.accept_asyncr'   c              	   C   r   )$
        Cancels the quote.
        r   /v1/quotes/{quote}/cancelr   r   r   r   r   r   r   r   cancel,  r   zQuoteService.cancelc              	      r   )r   r   r   r   r   r   Nr   r   r   r   r   cancel_async@  r   zQuoteService.cancel_asyncr   c              	   C   r   )&
        Finalizes the quote.
        r   /v1/quotes/{quote}/finalizer   r   r   r   r   r   r   r   finalize_quoteT  r   zQuoteService.finalize_quotec              	      r   )r   r   r   r   r   r   Nr   r   r   r   r   finalize_quote_asynch  r   z!QuoteService.finalize_quote_asyncr   c              	   C   r   )
        Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
        r   /v1/quotes/{quote}/pdfr   filesr   )r   r	   _request_streamr   r   r   r   r   r   pdf|  r   zQuoteService.pdfc              	      r   )r   r   r   r   r   r   N)r   r	   _request_stream_asyncr   r   r   r   r   r   	pdf_async  r   zQuoteService.pdf_async):r    r!   r"   r   r   r%   r(   rJ   rQ   rX   r_   rc   ri   rj   rq   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r#   r   r   r   r   r   r   r   r   r   r   r	   r   r   __classcell__r   r   r   r   r      s   	\





T


















r   N)stripe._list_objectr   stripe._quoter   1stripe._quote_computed_upfront_line_items_servicer   stripe._quote_line_item_servicer   stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   typingr	   r
   r   r   typing_extensionsr   r   r   r   r   r   r   r   <module>   s   