@@ -144,15 +144,10 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
144144 """{{ service.meta.doc|rst(width=72, indent=4) }}{% if service .version |length %}
145145 This class implements API version {{ service.version }}.{% endif %} """
146146
147- @staticmethod
148- def _get_default_mtls_endpoint(api_endpoint: Optional[str]) -> Optional[str]:
149- """Converts api endpoint to mTLS endpoint."""
150- return routing.get_default_mtls_endpoint(api_endpoint)
151-
152147 # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
153148 DEFAULT_ENDPOINT = {% if service .host %} "{{ service.host }}"{% else %} None{% endif %}
154149
155- DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore
150+ DEFAULT_MTLS_ENDPOINT = routing.get_default_mtls_endpoint(
156151 DEFAULT_ENDPOINT
157152 )
158153
@@ -370,7 +365,19 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
370365 universe_domain: str,
371366 use_mtls_endpoint: str,
372367 ) -> str:
373- """Return the API endpoint used by the client."""
368+ """Return the API endpoint used by the client.
369+
370+ Args:
371+ api_override (Optional[str]): The API endpoint override. If specified, this is always
372+ the return value of this function and the other arguments are not used.
373+ client_cert_source (Union[Callable[[], Tuple[bytes, bytes]], None]): The client certificate source used by the client.
374+ universe_domain (str): The universe domain used by the client.
375+ use_mtls_endpoint (str): How to use the mTLS endpoint, which depends also on the other parameters.
376+ Possible values are "always", "auto", or "never".
377+
378+ Returns:
379+ str: The API endpoint to be used by the client.
380+ """
374381 return routing.get_api_endpoint(
375382 api_override,
376383 client_cert_source,
@@ -383,7 +390,18 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
383390
384391 @staticmethod
385392 def _get_universe_domain(client_universe_domain: Optional[str], universe_domain_env: Optional[str]) -> str:
386- """Return the universe domain used by the client."""
393+ """Return the universe domain used by the client.
394+
395+ Args:
396+ client_universe_domain (Optional[str]): The universe domain configured via the client options.
397+ universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable.
398+
399+ Returns:
400+ str: The universe domain to be used by the client.
401+
402+ Raises:
403+ ValueError: If the universe domain is an empty string.
404+ """
387405 return routing.get_universe_domain(
388406 client_universe_domain,
389407 universe_domain_env,
0 commit comments