o
    Bi H                     @   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	m
Z
mZmZ d dlmZmZmZmZmZ er:d dlmZ G dd	 d	ed	 Zd
S )    )CreateableAPIResource)ExpandableField)RequestOptions)StripeObject)ClassVarListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Configurationc                   @   s  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ed ed< 	 eed < 	 eed!< 	 ee	 ed"< 	 eed#< 	 eed$< 	 eed%  ed&< 	 ed ed'< 	 ee ed(< 	 ee ed)< 	 eed*< 	 ed+ed, d-d fd.d/Zed+ed, d-d fd0d1Z d"e	iZ!d2S )3Sessiona  
    The Billing customer portal is a Stripe-hosted UI for subscription and
    billing management.

    A portal configuration describes the functionality and features that you
    want to provide to your customers through the portal.

    A portal session describes the instantiation of the customer portal for
    a particular customer. By visiting the session's URL, the customer
    can manage their subscriptions and billing details. For security reasons,
    sessions are short-lived and will expire if the customer does not visit the URL.
    Create sessions on-demand when customers intend to manage their subscriptions
    and billing details.

    Related guide: [Customer management](https://stripe.com/customer-management)
    zbilling_portal.sessionOBJECT_NAMEc                   @   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eed	< e	e ed
< 	 e	e ed< 	 e	e ed< 	 e
d ed< 	 eeeedZdS )zSession.Flowc                   @   sb   e Zd ZU G dd deZG dd deZee ed< 	 ee ed< 	 ed ed< 	 eed	Z	d
S )zSession.Flow.AfterCompletionc                   @      e Zd ZU ee ed< dS )z/Session.Flow.AfterCompletion.HostedConfirmationcustom_messageN__name__
__module____qualname__r   str__annotations__ r   r   ^/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/billing_portal/_session.pyHostedConfirmation,      
 r   c                   @      e Zd ZU eed< dS )z%Session.Flow.AfterCompletion.Redirect
return_urlNr   r   r   r   r   r   r   r   r   Redirect2      
 r!   hosted_confirmationredirectr#   portal_homepager$   type)r#   r$   N)
r   r   r   r   r   r!   r   r   r
   _inner_class_typesr   r   r   r   AfterCompletion+   s   
 
r)   c                   @   s>   e Zd ZU G dd deZee ed< 	 eed< 	 deiZdS )zSession.Flow.SubscriptionCancelc                   @   sB   e Zd ZU G dd deZee ed< 	 ed ed< 	 deiZdS )z)Session.Flow.SubscriptionCancel.Retentionc                   @   r   )z5Session.Flow.SubscriptionCancel.Retention.CouponOffercouponNr    r   r   r   r   CouponOfferK   r"   r+   coupon_offerr'   N)	r   r   r   r   r+   r   r   r
   r(   r   r   r   r   	RetentionJ   s   
 r-   	retentionsubscriptionN)	r   r   r   r   r-   r   r   r   r(   r   r   r   r   SubscriptionCancelI   s   
 r0   c                   @   r   )zSession.Flow.SubscriptionUpdater/   Nr    r   r   r   r   SubscriptionUpdatee   r"   r1   c                   @   sb   e Zd ZU G dd deZG dd deZeee  ed< 	 ee ed< 	 e	ed< 	 eedZ
d	S )
z&Session.Flow.SubscriptionUpdateConfirmc                   @   (   e Zd ZU ee ed< 	 ee ed< dS )z/Session.Flow.SubscriptionUpdateConfirm.Discountr*   promotion_codeNr   r   r   r   r   Discountl   
   
 r4   c                   @   s6   e Zd ZU ee ed< 	 ee ed< 	 ee ed< dS )z+Session.Flow.SubscriptionUpdateConfirm.ItemidpricequantityN)r   r   r   r   r   r   intr   r   r   r   Itemv   s   
 r:   	discountsitemsr/   )r;   r<   N)r   r   r   r   r4   r:   r   r   r   r   r(   r   r   r   r   SubscriptionUpdateConfirmk   s   
 
r=   after_completionsubscription_cancelsubscription_updatesubscription_update_confirmpayment_method_updater?   r@   rA   r'   )r>   r?   r@   rA   N)r   r   r   r   r)   r0   r1   r=   r   r   r
   r(   r   r   r   r   Flow*   s*   
 '
rD   c                   @   sr   e Zd ZU ee ed< 	 eed< 	 eee  ed< 	 ed ed< 	 eed  ed< 	 ee ed< 	 ee ed	< d
S )Session.CreateParamsconfigurationcustomerexpandSession.CreateParamsFlowData	flow_data/autobgcsdadeelenzen-AUzen-CAzen-GBzen-IEzen-INzen-NZzen-SGeszes-419etfifilfrzfr-CAhrhur6   itjakoltlvmsmtnbnlplptzpt-BRroruskslsvthtrvizhzzh-HKzzh-TWlocaleon_behalf_ofr   N)r   r   r   r   r   r   r   r
   r   r   r   r   CreateParams   s&   
 3rp   c                   @   sR   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 )rI   +Session.CreateParamsFlowDataAfterCompletionr>   .Session.CreateParamsFlowDataSubscriptionCancelr?   .Session.CreateParamsFlowDataSubscriptionUpdater@   5Session.CreateParamsFlowDataSubscriptionUpdateConfirmrA   rB   r'   Nr   r   r   r   r   r
   r   r   r   r   CreateParamsFlowData   s*   
 rv   c                   @   s6   e Zd ZU ed ed< 	 ed ed< 	 ed ed< dS )rq   =Session.CreateParamsFlowDataAfterCompletionHostedConfirmationr#   3Session.CreateParamsFlowDataAfterCompletionRedirectr$   r%   r'   Nru   r   r   r   r   #CreateParamsFlowDataAfterCompletion"  s   
 ry   c                   @   r   )rw   r   Nr   r   r   r   r   r   r   r   r   r   5CreateParamsFlowDataAfterCompletionHostedConfirmation4  r   r{   c                   @   r   )rx   r   Nr    r   r   r   r   +CreateParamsFlowDataAfterCompletionRedirect:  r"   r|   c                   @   s$   e Zd ZU ed ed< 	 eed< dS )rr   7Session.CreateParamsFlowDataSubscriptionCancelRetentionr.   r/   N)r   r   r   r   r   r   r   r   r   r   &CreateParamsFlowDataSubscriptionCancel@  s   
 r~   c                   @   s$   e Zd ZU ded< 	 ed ed< dS )r}   BSession.CreateParamsFlowDataSubscriptionCancelRetentionCouponOfferr,   r'   N)r   r   r   r   r
   r   r   r   r   /CreateParamsFlowDataSubscriptionCancelRetentionL  s
   
 r   c                   @   r   )r   r*   Nr    r   r   r   r   :CreateParamsFlowDataSubscriptionCancelRetentionCouponOfferV  s   
 r   c                   @   r   )rs   r/   Nr    r   r   r   r   &CreateParamsFlowDataSubscriptionUpdate^  r"   r   c                   @   s6   e Zd ZU eed  ed< 	 ed ed< 	 eed< dS )rt   =Session.CreateParamsFlowDataSubscriptionUpdateConfirmDiscountr;   9Session.CreateParamsFlowDataSubscriptionUpdateConfirmItemr<   r/   N)r   r   r   r   r   r   r   r   r   r   r   -CreateParamsFlowDataSubscriptionUpdateConfirmd  s   
 r   c                   @   r2   )r   r*   r3   Nrz   r   r   r   r   5CreateParamsFlowDataSubscriptionUpdateConfirmDiscountx  r5   r   c                   @   s2   e Zd ZU eed< 	 ee ed< 	 ee ed< dS )r   r6   r7   r8   N)r   r   r   r   r   r   r9   r   r   r   r   1CreateParamsFlowDataSubscriptionUpdateConfirmItem  s   
 r   r   rF   createdrG   flowr6   livemoderK   rn   objectro   r   urlparamsrE   returnc                 K   s   t d| jd|  |dS );
        Creates a session of the customer portal.
        r   postr   )r	   _static_request	class_urlclsr   r   r   r   create  s   zSession.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_async  s   
zSession.create_asyncN)"r   r   r   __doc__r   r   r
   r   r   rD   r   rp   r   rv   ry   r{   r|   r~   r   r   r   r   r   r   r   r9   r   r   boolclassmethodr   r   r   r(   r   r   r   r   r      sn   
  P#


3r   N)stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._request_optionsr   stripe._stripe_objectr   typingr   r   r   r	   typing_extensionsr
   r   r   r   r   $stripe.billing_portal._configurationr   r   r   r   r   r   <module>   s   