Skip to content

Commit 91040b3

Browse files
committed
fix(gapic-generator): Update return types of get_api_endpoint to Optional[str]
1 parent ebac306 commit 91040b3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/_compat.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ except ImportError:
4444
universe_domain: str,
4545
use_mtls_endpoint: str,
4646
default_universe: str,
47-
default_mtls_endpoint: str,
47+
default_mtls_endpoint: Optional[str],
4848
default_endpoint_template: str,
49-
) -> str:
49+
) -> Optional[str]:
5050
"""Return the API endpoint used by the client."""
5151
if api_override is not None:
5252
api_endpoint = api_override

packages/gapic-generator/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
364364
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]],
365365
universe_domain: str,
366366
use_mtls_endpoint: str,
367-
) -> str:
367+
) -> Optional[str]:
368368
"""Return the API endpoint used by the client.
369369

370370
Args:
@@ -376,7 +376,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
376376
Possible values are "always", "auto", or "never".
377377

378378
Returns:
379-
str: The API endpoint to be used by the client.
379+
Optional[str]: The API endpoint to be used by the client.
380380
"""
381381
return client_utils.get_api_endpoint(
382382
api_override,

0 commit comments

Comments
 (0)