o
    i[(                     @   s   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 er6d dlmZ d dlmZ G dd	 d	ed	 Zd
S )    )CreateableAPIResource)ExpandableField)StripeObject)ClassVarListOptionalcast)LiteralUnpackTYPE_CHECKING)Configuration)SessionCreateParamsc                   @   s   e Zd ZU dZdZeed  ed< 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ddZd
e	iZdS )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://docs.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                   @   s   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/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/billing_portal/_session.pyHostedConfirmation(   s   
 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   Redirect.      
 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   CouponOfferG   r   r&   coupon_offerr"   N)	r   r   r   r   r&   r   r   r	   r#   r   r   r   r   	RetentionF   s   
 r(   	retentionsubscriptionN)	r   r   r   r   r(   r   r   r   r#   r   r   r   r   SubscriptionCancelE   s   
 r+   c                   @   r   )zSession.Flow.SubscriptionUpdater*   Nr   r   r   r   r   SubscriptionUpdatea   r   r,   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                   @   s(   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   Discounth   s
   
 r.   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   Itemr   s   
 r3   	discountsitemsr*   )r4   r5   N)r   r   r   r   r.   r3   r   r   r   r   r#   r   r   r   r   SubscriptionUpdateConfirmg   s   
 
r6   after_completionsubscription_cancelsubscription_updatesubscription_update_confirm)payment_method_updater8   r9   r:   r"   )r7   r8   r9   r:   N)r   r   r   r   r$   r+   r,   r6   r   r   r	   r#   r   r   r   r   Flow&   s*   
 '
r<   r   configurationcreatedcustomerflowr/   livemode)/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hur/   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objecton_behalf_ofr   urlparamsr   returnc                 K   s   t d| jd|  |dS );
        Creates a session of the customer portal.
        r   postrh   )r   _static_request	class_urlclsrh   r   r   r   create
  s   zSession.createc                    s"   t d| jd|  |dI dH S )rj   r   rk   rl   N)r   _static_request_asyncrn   ro   r   r   r   create_async  s   
zSession.create_asyncN)r   r   r   __doc__r   r   r	   r   r   r<   r   r2   r   r   boolclassmethodr
   rq   rs   r#   r   r   r   r   r      sR   
  3r   N)stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._stripe_objectr   typingr   r   r   r   typing_extensionsr	   r
   r   $stripe.billing_portal._configurationr   3stripe.params.billing_portal._session_create_paramsr   r   r   r   r   r   <module>   s   