
    _j(;                        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"dS )    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)StripeObject)UpdateableAPIResource)sanitize_id)ClassVarDictListOptionalcast)LiteralUnpackTYPE_CHECKING)Application)ConfigurationCreateParams)ConfigurationListParams)ConfigurationModifyParams)ConfigurationRetrieveParamsc                      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d(S ))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                   V    e Zd ZU ee         ed<   	 ee         ed<   	 ee         ed<   dS )Configuration.BusinessProfileheadlineprivacy_policy_urlterms_of_service_urlN)__name__
__module____qualname__r   str__annotations__     h/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/stripe/billing_portal/_configuration.pyBusinessProfiler   *   sT         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
dS )Configuration.Featuresc                   >    e Zd ZU eed                  ed<   	 eed<   dS )%Configuration.Features.CustomerUpdate)addressemailnamephoneshippingtax_idallowed_updatesenabledN)r   r    r!   r   r   r#   boolr$   r%   r&   CustomerUpdater+   9   sH         !M   
 MMM r%   r5   c                       e Zd ZU eed<   dS )%Configuration.Features.InvoiceHistoryr3   N)r   r    r!   r4   r#   r$   r%   r&   InvoiceHistoryr7   G   s         MMM r%   r8   c                   2    e Zd ZU eed<   	 ee         ed<   dS )*Configuration.Features.PaymentMethodUpdater3   payment_method_configurationNr   r    r!   r4   r#   r   r"   r$   r%   r&   PaymentMethodUpdater:   M   s6         MMM +33-777 r%   r=   c                   z    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d	S )
)Configuration.Features.SubscriptionCancelc                   >    e Zd ZU eed<   	 eed                  ed<   dS )<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   X   sJ          "	    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?   W   s             \   * "4333MMM 899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d<   	 e
ed	<   	 ee	e                  ed
<   	 ed         ed<   	 eed<   ed         ed<   	 eedZdS ))Configuration.Features.SubscriptionUpdatec                   b    e Zd ZU  G d de          Zeed<   ee         ed<   	 eed<   	 deiZdS )1Configuration.Features.SubscriptionUpdate.Productc                   >    e Zd ZU eed<   	 ee         ed<   	 eed<   dS )DConfiguration.Features.SubscriptionUpdate.Product.AdjustableQuantityr3   maximumminimumN)r   r    r!   r4   r#   r   intr$   r%   r&   AdjustableQuantityr\      sF         !MMM &c]*** !LLL r%   r`   adjustable_quantitypricesproductN)	r   r    r!   r   r`   r#   r   r"   rU   r$   r%   r&   ProductrZ      s                 &8777S	!!!  *+=&"""r%   rd   c                   L    e Zd ZU  G d de          Zee         ed<   	 deiZdS )=Configuration.Features.SubscriptionUpdate.ScheduleAtPeriodEndc                   &    e Zd ZU ed         ed<   dS )GConfiguration.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition)decreasing_item_amountshortening_intervaltypeN)r   r    r!   r   r#   r$   r%   r&   	Conditionrh      s0         !G    r%   rl   
conditionsN)r   r    r!   r   rl   r   r#   rU   r$   r%   r&   ScheduleAtPeriodEndrf      s`                 !O+++ '3I%>"""r%   rn   )now	unchangedbilling_cycle_anchor)pricepromotion_codequantitydefault_allowed_updatesr3   productsrP   rT   schedule_at_period_end)continue_trial	end_trialtrial_update_behavior)rv   rw   N)r   r    r!   r   rd   rn   r   r   r#   r   r4   rU   r$   r%   r&   SubscriptionUpdaterX   ~   s2            ,   8? ? ? ? ?l ? ? ? #+73E+F"GGGG &*=>&    MMM tG}---- !(=!    %8777#*+H#IIII $*=" "r%   r{   customer_updateinvoice_historypayment_method_updatesubscription_cancelsubscription_update)r|   r}   r~   r   r   N)r   r    r!   r   r5   r8   r=   rV   r{   r#   rU   r$   r%   r&   Featuresr)   8   sP        	 	 	 	 	\ 	 	 		 	 	 	 	\ 	 	 		 	 	 	 	, 	 	 	%	M %	M %	M %	M %	M %	M %	M %	MNL	 L	 L	 L	 L	 L	 L	 L	\ ('''''''2222////////--%8#5#5
 
r%   r   c                   2    e Zd ZU eed<   	 ee         ed<   dS )Configuration.LoginPager3   urlNr<   r$   r%   r&   	LoginPager      s6         	
 c]	 	r%   r   activer   applicationbusiness_profilecreateddefault_return_urlfeaturesid
is_defaultlivemode
login_pagemetadatar.   objectupdatedparamsr   returnc                 r    t          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   s     r&   createzConfiguration.create  sB         
 
 	
r%   c                    K   t          d|                     d|                                 |           d{V           S )r   r   r   r   N)r   _static_request_asyncr   r   s     r&   create_asynczConfiguration.create_async%  sd       ++ ,        
 
 	
r%   r   c                     |                      d|                                 |          }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.list5  sp     $$MMOO % 
 

 &*-- 	7<<(*  
 r%   c                    K   |                      d|                                 |           d{V }t          |t                    s$t	          dt          |          j        z            |S )r   r   r   Nr   )r   r   r   r   r   rk   r   r   s      r&   
list_asynczConfiguration.list_asyncI  s       00MMOO 1 
 
 
 
 
 
 
 

 &*-- 	7<<(*  
 r%   r   c                     |                                  dt          |          }t          d|                     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.modify]  sX     +b///:    
 
 	
r%   c                    K   |                                  dt          |          }t          d|                     d||           d{V           S )r   r   r   r   r   N)r   r	   r   r   r   s       r&   modify_asynczConfiguration.modify_asyncn  sz       +b///:++ ,        
 
 	
r%   r   c                 @     | |fi |}|                                  |S )d
        Retrieves a configuration that describes the functionality of the customer portal.
        )refreshr   r   r   instances       r&   retrievezConfiguration.retrieve  s2     3r$$V$$r%   c                 P   K    | |fi |}|                                  d{V  |S )r   N)refresh_asyncr   s       r&   retrieve_asynczConfiguration.retrieve_async  sH       3r$$V$$$$&&&&&&&&&r%   )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       ,   _
 _
 _
 _
 _
< _
 _
 _
B
 
 
 
 
L 
 
 
 LLL /-89999 &%%%LLL !%%% GGG  NNN tCH~&&&& 3- 23333 LLL 
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      s   B A A A A A 4 4 4 4 4 4 * * * * * * = = = = = = . . . . . . A A A A A A $ $ $ $ $ $ 7 7 7 7 7 7 7 7 7 7 7 7 7 7 < < < < < < < < < < //////                    
| | | | |/*(/*| | | | |r%   