
    Ai7                         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 d d	lmZmZmZ er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!  G d ded   ed   ed         Z"y)    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)StripeObject)UpdateableAPIResource)sanitize_id)ClassVarDictListOptionalcast)LiteralUnpackTYPE_CHECKING)Application)ConfigurationCreateParams)ConfigurationListParams)ConfigurationModifyParams)ConfigurationRetrieveParamsc                   f   e Zd ZU dZdZeed      ed<    G d de      Z	 G d de      Z
 G d d	e      Zeed
<   	 eed      ed<   	 e	ed<   eed<   	 ee   ed<   	 e
ed<   eed<   	 eed<   	 eed<   	 eed<   eeeef      ed<   	 ee   ed<   	 ed   ed<   	 eed<   	 eded   dd fd       Zeded   dd fd       Zeded   ded    fd       Zeded   ded    fd        Zededed!   dd fd"       Zededed!   dd fd#       Zededed$   dd fd%       Zededed$   dd fd&       Ze	e
ed'Zy())Configurationz
    A portal configuration describes the functionality and behavior you embed in a portal session. Related guide: [Configure the customer portal](https://docs.stripe.com/customer-management/configure-portal).
    zbilling_portal.configurationOBJECT_NAMEc                   B    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   y)Configuration.BusinessProfileheadlineprivacy_policy_urlterms_of_service_urlN)__name__
__module____qualname__r   str__annotations__     W/var/www/html/immo/lib/python3.12/site-packages/stripe/billing_portal/_configuration.pyBusinessProfiler   *   s3    3-	 %SM)	 'sm+	r%   r'   c                       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 G 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
y)Configuration.Featuresc                   0    e Zd ZU eed      ed<   	 eed<   y)%Configuration.Features.CustomerUpdate)addressemailnamephoneshippingtax_idallowed_updatesenabledN)r   r    r!   r   r   r#   boolr$   r%   r&   CustomerUpdater+   9   s+    !M 
 Mr%   r5   c                       e Zd ZU eed<   y)%Configuration.Features.InvoiceHistoryr3   Nr   r    r!   r4   r#   r$   r%   r&   InvoiceHistoryr7   G       Mr%   r9   c                       e Zd ZU eed<   y)*Configuration.Features.PaymentMethodUpdater3   Nr8   r$   r%   r&   PaymentMethodUpdater<   M   r:   r%   r=   c                   f    e Zd ZU  G d de      Zeed<   eed<   	 ed   ed<   	 ed   ed<   	 deiZy	)
)Configuration.Features.SubscriptionCancelc                   0    e Zd ZU eed<   	 eed      ed<   y)<Configuration.Features.SubscriptionCancel.CancellationReasonr3   )customer_servicelow_qualitymissing_featuresotherswitched_servicetoo_complextoo_expensiveunusedoptionsN)r   r    r!   r4   r#   r   r   r$   r%   r&   CancellationReasonrA   T   s-     "	 r%   rK   cancellation_reasonr3   )at_period_endimmediatelymodealways_invoicecreate_prorationsnoneproration_behaviorN)	r   r    r!   r   rK   r#   r4   r   _inner_class_typesr$   r%   r&   SubscriptionCancelr?   S   sX    \ * "43M 899 !(=!  #89K!Lr%   rV   c                       e Zd ZU  G d de      Z G d de      Zeed      ed<   	 e	ed<   	 e
ee      ed<   	 ed	   ed
<   	 eed<   ed   ed<   	 eedZy))Configuration.Features.SubscriptionUpdatec                   T    e Zd ZU  G d de      Zeed<   ee   ed<   	 eed<   	 deiZy)1Configuration.Features.SubscriptionUpdate.Productc                   6    e Zd ZU eed<   	 ee   ed<   	 eed<   y)DConfiguration.Features.SubscriptionUpdate.Product.AdjustableQuantityr3   maximumminimumN)r   r    r!   r4   r#   r   intr$   r%   r&   AdjustableQuantityr\   |   s)    !M &c]* !Lr%   r`   adjustable_quantitypricesproductN)	r   r    r!   r   r`   r#   r   r"   rU   r$   r%   r&   ProductrZ   {   sA      &87S	!  *+=&"r%   rd   c                   >    e Zd ZU  G d de      Zee   ed<   	 deiZy)=Configuration.Features.SubscriptionUpdate.ScheduleAtPeriodEndc                       e Zd ZU ed   ed<   y)GConfiguration.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition)decreasing_item_amountshortening_intervaltypeN)r   r    r!   r   r#   r$   r%   r&   	Conditionrh      s    !G r%   rl   
conditionsN)r   r    r!   r   rl   r   r#   rU   r$   r%   r&   ScheduleAtPeriodEndrf      s,      !O+ '3I%>"r%   rn   )pricepromotion_codequantitydefault_allowed_updatesr3   productsrP   rT   schedule_at_period_end)continue_trial	end_trialtrial_update_behavior)rs   rt   N)r   r    r!   r   rd   rn   r   r   r#   r4   r   rU   r$   r%   r&   SubscriptionUpdaterX   z   s    , 8?l ? &*=>&  M tG}-- !(=!  %87#*+H#II $*="r%   rx   customer_updateinvoice_historypayment_method_updatesubscription_cancelsubscription_update)ry   rz   r{   r|   r}   N)r   r    r!   r   r5   r9   r=   rV   rx   r#   rU   r$   r%   r&   Featuresr)   8   s{    	\ 		\ 		, 	%	M %	MNH	 H	T ('''22////--%8#5#5
r%   r~   c                   *    e Zd ZU eed<   	 ee   ed<   y)Configuration.LoginPager3   urlN)r   r    r!   r4   r#   r   r"   r$   r%   r&   	LoginPager      s    	
 c]	r%   r   activer   applicationbusiness_profilecreateddefault_return_urlfeaturesid
is_defaultlivemode
login_pagemetadatar.   objectupdatedparamsr   returnc                 Z    t        d| j                  d| j                         |            S )j
        Creates a configuration that describes the functionality and behavior of a PortalSession
        r   postr   )r   _static_request	class_urlclsr   s     r&   createzConfiguration.create  s6        
 	
r%   c                 v   K   t        d| j                  d| j                         |       d{         S 7 w)r   r   r   r   N)r   _static_request_asyncr   r   s     r&   create_asynczConfiguration.create_async  sD      ++ ,  
 	
s   ,97
	9r   c                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |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   	TypeErrorrk   r   r   r   results      r&   listzConfiguration.list-  s]     $$MMO % 

 &*-7<((* 
 r%   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)r   r   r   Nr   )r   r   r   r   r   rk   r   r   s      r&   
list_asynczConfiguration.list_asyncA  sk      00MMO 1 
 

 &*-7<((* 
 
s   &A"A 8A"r   c                 z    | j                         dt        |      }t        d| j                  d||            S )b
        Updates a configuration that describes the functionality of the customer portal.
        /r   r   r   )r   r	   r   r   r   r   r   r   s       r&   modifyzConfiguration.modifyU  sD     +b/:   
 	
r%   c                    K   | j                         dt        |      }t        d| j                  d||       d{         S 7 w)r   r   r   r   r   N)r   r	   r   r   r   s       r&   modify_asynczConfiguration.modify_asyncf  sR      +b/:++ ,  
 	
s   <A	A
	A	r   c                 8     | |fi |}|j                          |S )d
        Retrieves a configuration that describes the functionality of the customer portal.
        )refreshr   r   r   instances       r&   retrievezConfiguration.retrievew  s$     r$V$r%   c                 T   K    | |fi |}|j                          d{    |S 7 w)r   N)refresh_asyncr   s       r&   retrieve_asynczConfiguration.retrieve_async  s3      r$V$$$&&& 	's   (&()r   r   r   N)r   r    r!   __doc__r   r
   r   r#   r   r'   r~   r   r4   r   r   r_   r"   r   classmethodr   r   r   r   r   r   r   r   r   r   rU   r$   r%   r&   r   r      s   

 	' '"@AB , W
< W
r
L 
 L /-899 &%L !% G  N tCH~&& 3- 233 L 
9:
	
 
 
9:
	
 
 78	O	$ & 78	O	$ & 

 &'B C
	
 
  

 &'B C
	
 
   &'D E	   &'D E	  ,r%   r   N)#stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._stripe_objectr   stripe._updateable_api_resourcer   stripe._utilr	   typingr
   r   r   r   r   typing_extensionsr   r   r   stripe._applicationr   9stripe.params.billing_portal._configuration_create_paramsr   7stripe.params.billing_portal._configuration_list_paramsr   9stripe.params.billing_portal._configuration_modify_paramsr   ;stripe.params.billing_portal._configuration_retrieve_paramsr   r   r$   r%   r&   <module>r      sg    B 4 * = . A $ 7 7 < </
t/*(/*tr%   