11from typing import Any , List , Optional
22
33from descope ._http_base import HTTPBase
4- from descope .management .common import MgmtV1 , tenantSettings
4+ from descope .management .common import MgmtV1 , TenantAuthType , SessionExiprationUnit
55
66
77class Tenant (HTTPBase ):
@@ -95,7 +95,20 @@ def update(
9595 def update_settings (
9696 self ,
9797 id : str ,
98- tenant_settings : tenantSettings
98+ self_provisioning_domains : List [str ],
99+ domains : Optional [List [str ]] = None ,
100+ auth_type : Optional [TenantAuthType ] = None ,
101+ session_settings_enabled : Optional [bool ] = False ,
102+ refresh_token_expiration : Optional [int ] = None ,
103+ refresh_token_expiration_unit : Optional [SessionExiprationUnit ] = None ,
104+ session_token_expiration : Optional [int ] = None ,
105+ session_token_expiration_unit : Optional [SessionExiprationUnit ] = None ,
106+ stepup_token_expiration : Optional [int ] = None ,
107+ stepup_token_expiration_unit : Optional [SessionExiprationUnit ] = None ,
108+ enable_inactivity : Optional [bool ] = None ,
109+ inactivity_time : Optional [int ] = None ,
110+ inactivity_time_unit : Optional [SessionExiprationUnit ] = None ,
111+ JITDisabled : Optional [bool ] = None
99112 ):
100113 """
101114 Update an existing tenant's session settings.
@@ -107,10 +120,42 @@ def update_settings(
107120 Raise:
108121 AuthException: raised if creation operation fails
109122 """
123+ body : dict [str , Any ] = {
124+ "tenantId" : id ,
125+ "selfProvisioningDomains" : self_provisioning_domains ,
126+ }
127+
128+ if domains is not None :
129+ body ["domains" ] = domains
130+ if auth_type is not None :
131+ body ["authType" ] = auth_type
132+ if session_settings_enabled is not None :
133+ body ["sessionSettingsEnabled" ] = session_settings_enabled
134+ if refresh_token_expiration is not None :
135+ body ["refreshTokenExpiration" ] = refresh_token_expiration
136+ if refresh_token_expiration_unit is not None :
137+ body ["refreshTokenExpirationUnit" ] = refresh_token_expiration_unit
138+ if session_token_expiration is not None :
139+ body ["sessionTokenExpiration" ] = session_token_expiration
140+ if session_token_expiration_unit is not None :
141+ body ["sessionTokenExpirationUnit" ] = session_token_expiration_unit
142+ if stepup_token_expiration is not None :
143+ body ["stepupTokenExpiration" ] = stepup_token_expiration
144+ if stepup_token_expiration_unit is not None :
145+ body ["stepupTokenExpirationUnit" ] = stepup_token_expiration_unit
146+ if enable_inactivity is not None :
147+ body ["enableInactivity" ] = enable_inactivity
148+ if inactivity_time is not None :
149+ body ["inactivityTime" ] = inactivity_time
150+ if inactivity_time_unit is not None :
151+ body ["inactivityTimeUnit" ] = inactivity_time_unit
152+ if JITDisabled is not None :
153+ body ["JITDisabled" ] = JITDisabled
154+
110155 self ._http .post (
111156 MgmtV1 .tenant_settings_path ,
112- params = { "id" : id } ,
113- body = tenant_settings ,
157+ body = body ,
158+ params = None
114159 )
115160
116161 def delete (
0 commit comments