2828from firebase_admin import _auth_utils
2929from firebase_admin import _http_client
3030from 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
3333
3434_TENANT_MGT_ATTRIBUTE = '_tenant_mgt'
3535_MAX_LIST_TENANTS_RESULTS = 100
@@ -189,6 +189,7 @@ def list_tenants(page_token=None, max_results=_MAX_LIST_TENANTS_RESULTS, app=Non
189189 FirebaseError: If an error occurs while retrieving the user accounts.
190190 """
191191 tenant_mgt_service = _get_tenant_mgt_service (app )
192+
192193 def download (page_token , max_results ):
193194 return tenant_mgt_service .list_tenants (page_token , max_results )
194195 return ListTenantsPage (download , page_token , max_results )
@@ -211,7 +212,8 @@ class Tenant:
211212
212213 def __init__ (self , data ):
213214 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 ))
215217 if not 'name' in data :
216218 raise ValueError ('Tenant response missing required keys.' )
217219
@@ -250,7 +252,8 @@ class _TenantManagementService:
250252 def __init__ (self , app ):
251253 credential = app .credential .get_credential ()
252254 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 )
254257 self .app = app
255258 self .client = _http_client .JsonHttpClient (
256259 credential = credential , base_url = base_url , headers = {'X-Client-Version' : version_header })
@@ -269,7 +272,7 @@ def auth_for_tenant(self, tenant_id):
269272
270273 client = auth .Client (self .app , tenant_id = tenant_id )
271274 self .tenant_clients [tenant_id ] = client
272- return client
275+ return client
273276
274277 def get_tenant (self , tenant_id ):
275278 """Gets the tenant corresponding to the given ``tenant_id``."""
@@ -327,11 +330,13 @@ def update_tenant(
327330 enable_email_link_sign_in , 'enableEmailLinkSignin' )
328331 if multi_factor_config is not None :
329332 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.' )
331335 payload ['mfaConfig' ] = multi_factor_config .build_server_request ()
332336
333337 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.' )
335340
336341 url = '/tenants/{0}' .format (tenant_id )
337342 update_mask = ',' .join (_auth_utils .build_update_mask (payload ))
0 commit comments