28
28
from firebase_admin import _auth_utils
29
29
from firebase_admin import _http_client
30
30
from firebase_admin import _utils
31
- from firebase_admin .multi_factor_config_mgt import MultiFactorConfig , MultiFactorServerConfig
32
-
31
+ from firebase_admin .multi_factor_config_mgt import MultiFactorConfig
32
+ from firebase_admin . multi_factor_config_mgt import MultiFactorServerConfig
33
33
34
34
_TENANT_MGT_ATTRIBUTE = '_tenant_mgt'
35
35
_MAX_LIST_TENANTS_RESULTS = 100
@@ -189,6 +189,7 @@ def list_tenants(page_token=None, max_results=_MAX_LIST_TENANTS_RESULTS, app=Non
189
189
FirebaseError: If an error occurs while retrieving the user accounts.
190
190
"""
191
191
tenant_mgt_service = _get_tenant_mgt_service (app )
192
+
192
193
def download (page_token , max_results ):
193
194
return tenant_mgt_service .list_tenants (page_token , max_results )
194
195
return ListTenantsPage (download , page_token , max_results )
@@ -211,7 +212,8 @@ class Tenant:
211
212
212
213
def __init__ (self , data ):
213
214
if not isinstance (data , dict ):
214
- raise ValueError ('Invalid data argument in Tenant constructor: {0}' .format (data ))
215
+ raise ValueError (
216
+ 'Invalid data argument in Tenant constructor: {0}' .format (data ))
215
217
if not 'name' in data :
216
218
raise ValueError ('Tenant response missing required keys.' )
217
219
@@ -250,7 +252,8 @@ class _TenantManagementService:
250
252
def __init__ (self , app ):
251
253
credential = app .credential .get_credential ()
252
254
version_header = 'Python/Admin/{0}' .format (firebase_admin .__version__ )
253
- base_url = '{0}/projects/{1}' .format (self .TENANT_MGT_URL , app .project_id )
255
+ base_url = '{0}/projects/{1}' .format (
256
+ self .TENANT_MGT_URL , app .project_id )
254
257
self .app = app
255
258
self .client = _http_client .JsonHttpClient (
256
259
credential = credential , base_url = base_url , headers = {'X-Client-Version' : version_header })
@@ -269,7 +272,7 @@ def auth_for_tenant(self, tenant_id):
269
272
270
273
client = auth .Client (self .app , tenant_id = tenant_id )
271
274
self .tenant_clients [tenant_id ] = client
272
- return client
275
+ return client
273
276
274
277
def get_tenant (self , tenant_id ):
275
278
"""Gets the tenant corresponding to the given ``tenant_id``."""
@@ -327,11 +330,13 @@ def update_tenant(
327
330
enable_email_link_sign_in , 'enableEmailLinkSignin' )
328
331
if multi_factor_config is not None :
329
332
if not isinstance (multi_factor_config , MultiFactorConfig ):
330
- raise ValueError ('multi_factor_config must be of type MultiFactorConfig.' )
333
+ raise ValueError (
334
+ 'multi_factor_config must be of type MultiFactorConfig.' )
331
335
payload ['mfaConfig' ] = multi_factor_config .build_server_request ()
332
336
333
337
if not payload :
334
- raise ValueError ('At least one parameter must be specified for update.' )
338
+ raise ValueError (
339
+ 'At least one parameter must be specified for update.' )
335
340
336
341
url = '/tenants/{0}' .format (tenant_id )
337
342
update_mask = ',' .join (_auth_utils .build_update_mask (payload ))
0 commit comments