File tree Expand file tree Collapse file tree
packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,16 +62,15 @@ except ImportError:
6262 return default_endpoint_template.format(UNIVERSE_DOMAIN=universe_domain)
6363
6464 def get_universe_domain(
65- client_universe_domain: Optional[str],
66- universe_domain_env: Optional[str],
65+ *potential_universes: Optional[str],
6766 default_universe: str,
6867 ) -> str:
6968 """Return the universe domain used by the client."""
7069 universe_domain = default_universe
71- if client_universe_domain is not None :
72- universe_domain = client_universe_domain
73- elif universe_domain_env is not None:
74- universe_domain = universe_domain_env
70+ for potential_universe in potential_universes :
71+ if potential_universe is not None:
72+ universe_domain = potential_universe
73+ break
7574 if len(universe_domain.strip()) == 0:
7675 raise ValueError("Universe Domain cannot be an empty string.")
7776 return universe_domain
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
379379 str: The API endpoint to be used by the client.
380380 """
381381 use_mtls = use_mtls_endpoint == "always" or (
382- use_mtls_endpoint == "auto" and client_cert_source
382+ use_mtls_endpoint == "auto" and bool( client_cert_source)
383383 )
384384 return client_utils.get_api_endpoint(
385385 api_override,
You can’t perform that action at this time.
0 commit comments