o
    Bi)l                     @   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 d d	lmZmZmZmZmZmZ d d
lmZmZmZmZmZ erVd dlmZ G dd ded ed ed ZdS )    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)RequestOptions)StripeObject)UpdateableAPIResource)sanitize_id)ClassVarDictListOptionalUnioncast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Applicationc                   @   sb  e Zd ZU dZdZeed  ed< 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 d0d1 d1eZ!G d2d3 d3eZ"G d4d5 d5eZ#G d6d7 d7eZ$G d8d9 d9eZ%e&ed:< 	 e'e(d;  ed<< 	 e	ed=< e)ed>< 	 e'e* ed?< 	 e
ed@< e*edA< 	 e&edB< 	 e&edC< 	 eedD< e'e+e*e*f  edE< 	 ed edF< 	 e)edG< 	 e,dHe-dI dJd fdKdLZ.e,dHe-dI dJd fdMdNZ/e,dHe-dO dJe0d  fdPdQZ1e,dHe-dO dJe0d  fdRdSZ2e,dAe*dHe-dT dJd fdUdVZ3e,dAe*dHe-dT dJd fdWdXZ4e,dAe*dHe-dY dJd fdZd[Z5e,dAe*dHe-dY dJd fd\d]Z6e	e
ed^Z7d_S )`Configurationz^
    A portal configuration describes the functionality and behavior of a portal session.
    zbilling_portal.configurationOBJECT_NAMEc                   @   s6   e Zd ZU ee ed< 	 ee ed< 	 ee ed< dS )zConfiguration.BusinessProfileheadlineprivacy_policy_urlterms_of_service_urlN)__name__
__module____qualname__r   str__annotations__ r    r    d/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/billing_portal/_configuration.pyBusinessProfile%      
 r"   c                   @   s   e Zd ZU 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ee	d< ee	d< ee	d< ee	d< ee	d< eeeeedZ
dS )zConfiguration.Featuresc                   @   s(   e Zd ZU eed  ed< 	 eed< dS )z%Configuration.Features.CustomerUpdate)addressemailnamephoneshippingtax_idallowed_updatesenabledN)r   r   r   r   r   r   boolr    r    r    r!   CustomerUpdate4   s   
 r-   c                   @      e Zd ZU eed< dS )z%Configuration.Features.InvoiceHistoryr+   Nr   r   r   r,   r   r    r    r    r!   InvoiceHistoryB      
 r0   c                   @   r.   )z*Configuration.Features.PaymentMethodUpdater+   Nr/   r    r    r    r!   PaymentMethodUpdateH   r1   r2   c                   @   sT   e Zd ZU G dd deZeed< eed< 	 ed ed< 	 ed ed< 	 deiZd	S )
z)Configuration.Features.SubscriptionCancelc                   @   s(   e Zd ZU eed< 	 eed  ed< dS )z<Configuration.Features.SubscriptionCancel.CancellationReasonr+   customer_servicelow_qualitymissing_featuresotherswitched_servicetoo_complextoo_expensiveunusedoptionsN)r   r   r   r,   r   r   r   r    r    r    r!   CancellationReasonO   s   
 r=   cancellation_reasonr+   at_period_endimmediatelymodealways_invoicecreate_prorationsnoneproration_behaviorN)	r   r   r   r   r=   r   r,   r   _inner_class_typesr    r    r    r!   SubscriptionCancelN   s   
 rI   c                   @   sb   e Zd ZU G dd deZeed  ed< 	 eed< 	 e	ee  ed< 	 ed ed< 	 deiZ
d	S )
z)Configuration.Features.SubscriptionUpdatec                   @   $   e Zd ZU ee ed< 	 eed< dS )z1Configuration.Features.SubscriptionUpdate.ProductpricesproductNr   r   r   r   r   r   r    r    r    r!   Productv   
   
 rN   pricepromotion_codequantitydefault_allowed_updatesr+   productsrC   rG   N)r   r   r   r   rN   r   r   r   r,   r   rH   r    r    r    r!   SubscriptionUpdateu   s   
 
rV   customer_updateinvoice_historypayment_method_updatesubscription_cancelsubscription_update)rW   rX   rY   rZ   r[   N)r   r   r   r   r-   r0   r2   rI   rV   r   rH   r    r    r    r!   Features3   s"   
 '!
r\   c                   @   s$   e Zd ZU eed< 	 ee ed< dS )zConfiguration.LoginPager+   urlN)r   r   r   r,   r   r   r   r    r    r    r!   	LoginPage   s
   
 r^   c                   @   sd   e Zd ZU ded< 	 ed ed< 	 eee  ed< 	 ded< 	 ed ed	< 	 eeeef  ed
< dS )Configuration.CreateParams)Configuration.CreateParamsBusinessProfilebusiness_profileLiteral['']|strdefault_return_urlexpand"Configuration.CreateParamsFeaturesfeatures#Configuration.CreateParamsLoginPage
login_pagemetadataN)r   r   r   r   r   r   r   r   r    r    r    r!   CreateParams   s   
 rj   c                   @   s6   e Zd ZU ed ed< 	 ee ed< 	 ee ed< dS )r`   rb   r   r   r   N)r   r   r   r   r   r   r    r    r    r!   CreateParamsBusinessProfile   r#   rk   c                   @   R   e Zd ZU ed ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ed	 ed
< dS )re   0Configuration.CreateParamsFeaturesCustomerUpdaterW   0Configuration.CreateParamsFeaturesInvoiceHistoryrX   5Configuration.CreateParamsFeaturesPaymentMethodUpdaterY   4Configuration.CreateParamsFeaturesSubscriptionCancelrZ   4Configuration.CreateParamsFeaturesSubscriptionUpdater[   Nr   r   r   r   r   r    r    r    r!   CreateParamsFeatures   *   
 rs   c                   @   s$   e Zd ZU ed ed< 	 eed< dS )rm   TLiteral['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]r*   r+   Nr   r   r   r   r   r,   r    r    r    r!   "CreateParamsFeaturesCustomerUpdate   s   
 rw   c                   @   r.   )rn   r+   Nr/   r    r    r    r!   "CreateParamsFeaturesInvoiceHistory  r1   rx   c                   @   r.   )ro   r+   Nr/   r    r    r    r!   'CreateParamsFeaturesPaymentMethodUpdate	  r1   ry   c                   @   sH   e Zd ZU ed ed< 	 eed< 	 eed  ed< 	 eed  ed< dS )	rp   FConfiguration.CreateParamsFeaturesSubscriptionCancelCancellationReasonr>   r+   r?   rB   rC   rG   Nr   r   r   r   r   r,   r   r    r    r    r!   &CreateParamsFeaturesSubscriptionCancel  s   
 r|   c                   @   s4   e Zd ZU eed< 	 eed eed  f ed< dS )rz   r+    r3   r<   N)r   r   r   r,   r   r   r   r   r    r    r    r!   8CreateParamsFeaturesSubscriptionCancelCancellationReason%  s   
 r~   c                   @   s`   e Zd ZU eed eed  f ed< 	 eed< 	 eed ed f ed< 	 eed  ed< d	S )
rq   r}   rP   rT   r+   ;Configuration.CreateParamsFeaturesSubscriptionUpdateProductrU   rC   rG   N)	r   r   r   r   r   r   r   r,   r   r    r    r    r!   &CreateParamsFeaturesSubscriptionUpdate=  s&   
 r   c                   @   rJ   )r   rK   rL   NrM   r    r    r    r!   -CreateParamsFeaturesSubscriptionUpdateProductX  rO   r   c                   @   r.   )rg   r+   Nr/   r    r    r    r!   CreateParamsLoginPageb  r1   r   c                   @   sd   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 ed< dS )Configuration.ListParamsactiveending_beforerd   
is_defaultlimitstarting_afterN)	r   r   r   r   r,   r   r   r   intr    r    r    r!   
ListParamsh  s   
 r   c                   @   sr   e Zd ZU ee ed< 	 ed ed< 	 ed ed< 	 eee  ed< 	 ed ed< 	 ed	 ed
< 	 ed ed< dS )Configuration.ModifyParamsr   )Configuration.ModifyParamsBusinessProfilera   rb   rc   rd   "Configuration.ModifyParamsFeaturesrf   #Configuration.ModifyParamsLoginPagerh   zLiteral['']|Dict[str, str]ri   N)r   r   r   r   r,   r   r   r   r    r    r    r!   ModifyParams  s"   
 r   c                   @   s6   e Zd ZU ed ed< 	 ed ed< 	 ed ed< dS )r   rb   r   r   r   Nrr   r    r    r    r!   ModifyParamsBusinessProfile  r#   r   c                   @   rl   )r   0Configuration.ModifyParamsFeaturesCustomerUpdaterW   0Configuration.ModifyParamsFeaturesInvoiceHistoryrX   5Configuration.ModifyParamsFeaturesPaymentMethodUpdaterY   4Configuration.ModifyParamsFeaturesSubscriptionCancelrZ   4Configuration.ModifyParamsFeaturesSubscriptionUpdater[   Nrr   r    r    r    r!   ModifyParamsFeatures  rt   r   c                   @   s(   e Zd ZU ed ed< 	 ee ed< dS )r   ru   r*   r+   Nrv   r    r    r    r!   "ModifyParamsFeaturesCustomerUpdate  s   
 r   c                   @   r.   )r   r+   Nr/   r    r    r    r!   "ModifyParamsFeaturesInvoiceHistory  r1   r   c                   @   r.   )r   r+   Nr/   r    r    r    r!   'ModifyParamsFeaturesPaymentMethodUpdate  r1   r   c                   @   sL   e Zd ZU ed ed< 	 ee ed< 	 eed  ed< 	 eed  ed< dS )	r   FConfiguration.ModifyParamsFeaturesSubscriptionCancelCancellationReasonr>   r+   r?   rB   rC   rG   Nr{   r    r    r    r!   &ModifyParamsFeaturesSubscriptionCancel  s   
 r   c                   @   s$   e Zd ZU eed< 	 ed ed< dS )r   r+   zLiteral['']|List[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']]r<   N)r   r   r   r,   r   r   r    r    r    r!   8ModifyParamsFeaturesSubscriptionCancelCancellationReason  s   
 r   c                   @   sH   e Zd ZU ed ed< 	 ee ed< 	 ed ed< 	 eed  ed< dS )	r   z@Literal['']|List[Literal['price', 'promotion_code', 'quantity']]rT   r+   zMLiteral['']|List[Configuration.ModifyParamsFeaturesSubscriptionUpdateProduct]rU   rC   rG   Nr{   r    r    r    r!   &ModifyParamsFeaturesSubscriptionUpdate
  s   
 r   c                   @   rJ   )z;Configuration.ModifyParamsFeaturesSubscriptionUpdateProductrK   rL   NrM   r    r    r    r!   -ModifyParamsFeaturesSubscriptionUpdateProduct"  rO   r   c                   @   r.   )r   r+   Nr/   r    r    r    r!   ModifyParamsLoginPage,  r1   r   c                   @   s   e Zd ZU eee  ed< dS )Configuration.RetrieveParamsrd   N)r   r   r   r   r   r   r   r    r    r    r!   RetrieveParams4  s   
 r   r   r   applicationra   createdrc   rf   idr   livemoderh   ri   objectupdatedparamsr_   returnc                 K   s   t d| jd|  |dS )j
        Creates a configuration that describes the functionality and behavior of a PortalSession
        r   postr   )r   _static_request	class_urlclsr   r    r    r!   createf  s   zConfiguration.createc                    s"   t d| jd|  |dI dH S )r   r   r   r   N)r   _static_request_asyncr   r   r    r    r!   create_asyncv  s   
zConfiguration.create_asyncr   c                 K   s4   | j d|  |d}t|tstdt|j |S )j
        Returns a list of configurations that describe the functionality of the customer portal.
        getr   %Expected list object from API, got %s)r   r   
isinstancer   	TypeErrortyper   r   r   resultr    r    r!   list  s   
zConfiguration.listc                    s<   | j d|  |dI dH }t|tstdt|j |S )r   r   r   Nr   )r   r   r   r   r   r   r   r   r    r    r!   
list_async  s   
zConfiguration.list_asyncr   c                 K   s*   d|   t|f }td| jd||dS )b
        Updates a configuration that describes the functionality of the customer portal.
        %s/%sr   r   r   )r   r	   r   r   r   r   r   r]   r    r    r!   modify  s   zConfiguration.modifyc                    s2   d|   t|f }td| jd||dI dH S )r   r   r   r   r   N)r   r	   r   r   r   r    r    r!   modify_async  s   
zConfiguration.modify_asyncr   c                 K   s   | |fi |}|   |S )d
        Retrieves a configuration that describes the functionality of the customer portal.
        )refreshr   r   r   instancer    r    r!   retrieve  s   zConfiguration.retrievec                    s$   | |fi |}|  I dH  |S )r   N)refresh_asyncr   r    r    r!   retrieve_async  s   zConfiguration.retrieve_async)ra   rf   rh   N)8r   r   r   __doc__r   r
   r   r   r   r"   r\   r^   r   rj   r   rk   rs   rw   rx   ry   r|   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r,   r   r   r   r   r   classmethodr   r   r   r   r   r   r   r   r   r   rH   r    r    r    r!   r      s   
 p 
  


r   N) stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._request_optionsr   stripe._stripe_objectr   stripe._updateable_api_resourcer   stripe._utilr	   typingr
   r   r   r   r   r   typing_extensionsr   r   r   r   r   stripe._applicationr   r   r    r    r    r!   <module>   s"    
