You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Universes other than the default "googleapis.com" need to be supported in both GAPICs and Apiary. The following code was added to GAPICs but can be moved to python-api-core:
def_get_universe_domain(
client_universe_domain: Optional[str], universe_domain_env: Optional[str]
) ->str: # temp disable Optional"""Return the universe domain used by the client. Args: client_universe_domain (Optional[str]): The universe domain configured via the client options. universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable. Returns: str: The universe domain to be used by the client. Raises: ValueError: If the universe domain is an empty string. """universe_domain=_DEFAULT_UNIVERSEifclient_universe_domainisnotNone:
universe_domain=client_universe_domainelifuniverse_domain_envisnotNone:
universe_domain=universe_domain_enviflen(universe_domain.strip()) ==0:
raise_Empty_Universe_Errorreturnuniverse_domaindef_compare_universes(
client_universe: str, credentials: Union[ga_credentials, oauth2_credentials]
) ->bool:
"""Returns True iff the universe domains used by the client and credentials match. Args: client_universe (str): The universe domain configured via the client options. credentials Union[google.auth.credentials.Credentials, oauth2client.client.Credentials]: The credentials being used in the client. Returns: bool: True iff client_universe matches the universe in credentials. Raises: ValueError: when client_universe does not match the universe in credentials. """credentials_universe=getattr(credentials, "universe_domain", _DEFAULT_UNIVERSE)
ifclient_universe!=credentials_universe:
raise_UniverseMismatchError(client_universe, credentials_universe)
returnTrue
The text was updated successfully, but these errors were encountered:
Universes other than the default
"googleapis.com"
need to be supported in both GAPICs and Apiary. The following code was added to GAPICs but can be moved topython-api-core
:The text was updated successfully, but these errors were encountered: