Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 75748ee

Browse files
committed
fixed inconsistent typing in api_endpoint
1 parent b8e99f4 commit 75748ee

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
100100
This class implements API version {{ service.version }}.{% endif %}"""
101101

102102
@staticmethod
103-
def _get_default_mtls_endpoint(api_endpoint):
103+
def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
104104
"""Converts api endpoint to mTLS endpoint.
105105

106106
Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
107107
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
108108
Args:
109109
api_endpoint (Optional[str]): the api endpoint to convert.
110110
Returns:
111-
str: converted mTLS api endpoint.
111+
Optikonal[str]: converted mTLS api endpoint.
112112
"""
113113
if not api_endpoint:
114114
return api_endpoint

gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class {{ service.async_client_name }}:
162162
return self._client.transport
163163

164164
@property
165-
def api_endpoint(self):
165+
def api_endpoint(self) -> str:
166166
"""Return the API endpoint used by the client instance.
167167

168168
Returns:

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
143143
This class implements API version {{ service.version }}.{% endif %}"""
144144

145145
@staticmethod
146-
def _get_default_mtls_endpoint(api_endpoint):
146+
def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
147147
"""Converts api endpoint to mTLS endpoint.
148148

149149
Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
150150
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
151151
Args:
152152
api_endpoint (Optional[str]): the api endpoint to convert.
153153
Returns:
154-
str: converted mTLS api endpoint.
154+
Optional[str]: converted mTLS api endpoint.
155155
"""
156156
if not api_endpoint:
157157
return api_endpoint
@@ -391,7 +391,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
391391
return client_cert_source
392392

393393
@staticmethod
394-
def _get_api_endpoint(api_override, client_cert_source, universe_domain, use_mtls_endpoint):
394+
def _get_api_endpoint(api_override, client_cert_source, universe_domain, use_mtls_endpoint) -> str:
395395
"""Return the API endpoint used by the client.
396396

397397
Args:
@@ -477,7 +477,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
477477
error._details.append(json.dumps(cred_info))
478478

479479
@property
480-
def api_endpoint(self):
480+
def api_endpoint(self) -> str:
481481
"""Return the API endpoint used by the client instance.
482482

483483
Returns:

0 commit comments

Comments
 (0)