
    +hG                         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	ed	         Zy
)    )CreateableAPIResource)ExpandableField)RequestOptions)StripeObject)ClassVarListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)Configurationc                   V   e Zd ZU dZdZeed      ed<    G d de      Z	e
r G d de      Z G d d	e      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G 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	 	 	 	 d4d,ee   d-ee   d.ee   d/ee   d0ed1   d2d fd3       Z d"e	iZ!y+)5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.

    Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal).
    zbilling_portal.sessionOBJECT_NAMEc                       e Zd ZU  G d de      Z G d de      Z G d de      Z G 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y)Session.Flowc                   z    e Zd ZU  G d de      Z G d de      Zee   ed<   	 ee   ed<   	 ed   ed<   	 eed	Z	y
)Session.Flow.AfterCompletionc                       e Zd ZU ee   ed<   y)/Session.Flow.AfterCompletion.HostedConfirmationcustom_messageN__name__
__module____qualname__r	   str__annotations__     ^/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/billing_portal/session.pyHostedConfirmationr   ,   s     (-r"   r$   c                       e Zd ZU eed<   y)%Session.Flow.AfterCompletion.Redirect
return_urlNr   r   r   r   r    r!   r"   r#   Redirectr&   2   s    r"   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#   AfterCompletionr   +   sb    \ <  "**<!== x(( NOO (:$"r"   r0   c                   J    e Zd ZU  G d de      Zee   ed<   	 eed<   	 deiZy)Session.Flow.SubscriptionCancelc                   P    e Zd ZU  G d de      Zee   ed<   	 ed   ed<   	 deiZy))Session.Flow.SubscriptionCancel.Retentionc                       e Zd ZU eed<   y)5Session.Flow.SubscriptionCancel.Retention.CouponOffercouponNr(   r!   r"   r#   CouponOfferr6   K   s    Kr"   r8   coupon_offerr.   N)	r   r   r   r   r8   r	   r    r   r/   r!   r"   r#   	Retentionr4   J   s?    ,  '{33 n-- '5k%B"r"   r:   	retentionsubscriptionN)	r   r   r   r   r:   r	   r    r   r/   r!   r"   r#   SubscriptionCancelr2   I   s<    CL C"  	**  #.y!9r"   r=   c                       e Zd ZU eed<   y)Session.Flow.SubscriptionUpdater<   Nr(   r!   r"   r#   SubscriptionUpdater?   e       r"   r@   c                   z    e Zd ZU  G d de      Z G d de      Zeee      ed<   	 ee   ed<   	 e	ed<   	 eedZ
y	)
&Session.Flow.SubscriptionUpdateConfirmc                   0    e Zd ZU ee   ed<   	 ee   ed<   y)/Session.Flow.SubscriptionUpdateConfirm.Discountr7   promotion_codeNr   r!   r"   r#   DiscountrE   l   s"     % !)-r"   rG   c                   B    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   y)+Session.Flow.SubscriptionUpdateConfirm.ItemidpricequantityN)r   r   r   r	   r   r    intr!   r"   r#   ItemrI   v   s3    SM!  }$ #3-'r"   rN   	discountsitemsr<   )rO   rP   N)r   r   r   r   rG   rN   r	   r   r    r   r/   r!   r"   r#   SubscriptionUpdateConfirmrC   k   s[    < |   X// :  08$!Gr"   rQ   after_completionsubscription_cancelsubscription_updatesubscription_update_confirmpayment_method_updaterS   rT   rU   r.   )rR   rS   rT   rU   N)r   r   r   r   r0   r=   r@   rQ   r    r	   r   r/   r!   r"   r#   Flowr   *   s    	l 	<	: 	:8	 	%	H %	HN *)%&899	 &&899	 &..G%HH	 +
 	
	 !0#5#5+D	
r"   rX   c                       e Zd ZU ed   ed<   	 eed<   	 ed   ed<   	 ed   ed<   	 ed   ed	<   	 ed   ed
<   	 ed   ed<   y)Session.CreateParamsr   configurationcustomerz	List[str]expandSession.CreateParamsFlowData	flow_dataaI  Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-AU', 'en-CA', 'en-GB', 'en-IE', 'en-IN', 'en-NZ', 'en-SG', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']localeon_behalf_ofr'   Nr   r   r   r   r    r   r!   r"   r#   CreateParamsrZ      s    &u-- M  ,, ##ABB   \  &e,, $E**r"   rc   c                   f    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
<   y)r^   +Session.CreateParamsFlowDataAfterCompletionrR   .Session.CreateParamsFlowDataSubscriptionCancelrS   .Session.CreateParamsFlowDataSubscriptionUpdaterT   5Session.CreateParamsFlowDataSubscriptionUpdateConfirmrU   rV   r.   Nr   r   r   r   r    r   r!   r"   r#   CreateParamsFlowDatazSession.CreateParamsFlowData   su    )=  "-@"  "-@"  *5G*  / r"   rj   c                   <    e Zd ZU ed   ed<   	 ed   ed<   	 eed<   y)rh   zCList[Session.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount]rO   9Session.CreateParamsFlowDataSubscriptionUpdateConfirmItemrP   r<   N)r   r   r   r   r    r   r   r!   r"   r#   -CreateParamsFlowDataSubscriptionUpdateConfirmz5Session.CreateParamsFlowDataSubscriptionUpdateConfirm   s;    "U  K  r"   rm   c                   <    e Zd ZU eed<   	 ed   ed<   	 ed   ed<   y)rl   rJ   r   rK   rM   rL   N)r   r   r   r   r    r   r!   r"   r#   1CreateParamsFlowDataSubscriptionUpdateConfirmItemz9Session.CreateParamsFlowDataSubscriptionUpdateConfirmItem  s0    G u%% "%((r"   ro   c                   0    e Zd ZU ed   ed<   	 ed   ed<   y)=Session.CreateParamsFlowDataSubscriptionUpdateConfirmDiscountr   r7   rF   Nr   r   r   r   r    r!   r"   r#   5CreateParamsFlowDataSubscriptionUpdateConfirmDiscountrq     s$    && (..r"   rs   c                       e Zd ZU eed<   y)rg   r<   Nr(   r!   r"   r#   &CreateParamsFlowDataSubscriptionUpdatez.Session.CreateParamsFlowDataSubscriptionUpdate  rA   r"   ru   c                   *    e Zd ZU ed   ed<   	 eed<   y)rf   7Session.CreateParamsFlowDataSubscriptionCancelRetentionr;   r<   Nrb   r!   r"   r#   &CreateParamsFlowDataSubscriptionCancelz.Session.CreateParamsFlowDataSubscriptionCancel$  s$    "I  r"   rx   c                   *    e Zd ZU ded<   	 ed   ed<   y)rw   BSession.CreateParamsFlowDataSubscriptionCancelRetentionCouponOfferr9   r.   N)r   r   r   r    r   r!   r"   r#   /CreateParamsFlowDataSubscriptionCancelRetentionz7Session.CreateParamsFlowDataSubscriptionCancelRetention0  s    ^^ .))r"   r{   c                       e Zd ZU eed<   y)rz   r7   Nr(   r!   r"   r#   :CreateParamsFlowDataSubscriptionCancelRetentionCouponOfferzBSession.CreateParamsFlowDataSubscriptionCancelRetentionCouponOffer:  s     Kr"   r}   c                   B    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   y)re   =Session.CreateParamsFlowDataAfterCompletionHostedConfirmationr*   3Session.CreateParamsFlowDataAfterCompletionRedirectr+   r,   r.   Nri   r!   r"   r#   #CreateParamsFlowDataAfterCompletionz+Session.CreateParamsFlowDataAfterCompletionB  sA    !,O"  "E  NOOr"   r   c                       e Zd ZU eed<   y)r   r'   Nr(   r!   r"   r#   +CreateParamsFlowDataAfterCompletionRedirectz3Session.CreateParamsFlowDataAfterCompletionRedirectT  s    Or"   r   c                       e Zd ZU ed   ed<   y)r   r   r   Nrr   r!   r"   r#   5CreateParamsFlowDataAfterCompletionHostedConfirmationz=Session.CreateParamsFlowDataAfterCompletionHostedConfirmationZ  s    '..r"   r   r   r[   createdr\   flowrJ   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hurJ   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-TWr`   objectra   r'   urlNapi_keyidempotency_keystripe_versionstripe_accountparamsrZ   returnc                 `    t        d| j                  d| j                         |||||            S )z;
        Creates a session of the customer portal.
        r   post)r
   _static_request	class_url)clsr   r   r   r   r   s         r#   createzSession.create  s=     
 	
r"   )NNNN)"r   r   r   __doc__r   r   r   r    r   rX   r   r   rc   r   rj   rm   ro   rs   ru   rx   r{   r}   r   r   r   r   rM   r   r	   boolclassmethodr   r   r/   r!   r"   r#   r   r      s   & 	! () !C
| C
J 	> 	@!	9 !	F	I 	$		 		I 		Y 	
	Y 
		i 				) 	$	) 		I 	 #?33 L M 4. 	G N .0	
2 2f ,-- 3-  
H  "&)-(,(,
#
 "#
 !	

 !
 /0
 

 
0 !$r"   r   N)stripe.api_resources.abstractr   %stripe.api_resources.expandable_fieldr   stripe.request_optionsr   stripe.stripe_objectr   typingr   r   r	   r
   typing_extensionsr   r   r   r   r   1stripe.api_resources.billing_portal.configurationr   r   r!   r"   r#   <module>r      s@    @ A 1 - 1 1  OD(#I. D(r"   