Skip to content

Commit e610fc5

Browse files
committed
update goldens
1 parent 9a6078e commit e610fc5

9 files changed

Lines changed: 22 additions & 1 deletion

File tree

  • packages/gapic-generator

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ try:
4040
# we bump the minimum supported version of google-auth.
4141
from google.auth.transport.mtls import should_use_client_cert # type: ignore
4242
except ImportError: # pragma: NO COVER
43+
{# The fallback implementation for `should_use_client_cert` can be removed once the minimum version of `google-auth` is bumped to 2.56.0 in `setup.py.j2`. #}
4344
def should_use_client_cert():
4445
"""Returns whether client certificate should be used for mTLS."""
4546
use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false").lower()
@@ -51,7 +52,6 @@ except ImportError: # pragma: NO COVER
5152
return use_client_cert == "true"
5253

5354

54-
{# TODO(https://github.com/googleapis/google-cloud-python/issues/17883):
5555
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
5656
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
5757
def read_environment_variables():
@@ -83,6 +83,7 @@ DEFAULT_UNIVERSE = "googleapis.com"
8383
try:
8484
from google.api_core.universe import get_default_mtls_endpoint
8585
except ImportError: # pragma: NO COVER
86+
{# The fallback implementation for `get_default_mtls_endpoint` can be removed once the minimum version of `google-api-core` is bumped to 2.33.0 in `setup.py.j2`. #}
8687
def get_default_mtls_endpoint(api_endpoint: Optional[str]) -> Optional[str]:
8788
"""Converts api endpoint to mTLS endpoint.
8889

@@ -133,6 +134,7 @@ except ImportError: # pragma: NO COVER
133134
try:
134135
from google.api_core.universe import get_api_endpoint
135136
except ImportError: # pragma: NO COVER
137+
{# The fallback implementation for `get_api_endpoint` can be removed once the minimum version of `google-api-core` is bumped to 2.33.0 in `setup.py.j2`. #}
136138
def get_api_endpoint(
137139
api_override: Optional[str],
138140
universe_domain: str,
@@ -178,6 +180,7 @@ except ImportError: # pragma: NO COVER
178180
try:
179181
from google.api_core.universe import get_universe_domain
180182
except ImportError: # pragma: NO COVER
183+
{# The fallback implementation for `get_universe_domain` can be removed once the minimum version of `google-api-core` is bumped to 2.33.0 in `setup.py.j2`. #}
181184
def get_universe_domain(
182185
*potential_universes: Optional[str],
183186
default_universe: str,
@@ -213,6 +216,7 @@ try:
213216
# Fall back to the local compatibility implementation for older versions.
214217
raise ImportError
215218
except ImportError: # pragma: NO COVER
219+
{# The fallback implementation for `setup_request_id` can be removed once the minimum version of `google-api-core` is bumped to 2.34.0 in `setup.py.j2`. #}
216220
def setup_request_id(
217221
request: Union[google.protobuf.message.Message, "proto.Message", dict, None],
218222
field_name: str,
@@ -286,6 +290,7 @@ except ImportError: # pragma: NO COVER
286290
try:
287291
from google.api_core.rest_helpers import transcode_request # type: ignore
288292
except ImportError: # pragma: NO COVER
293+
{# The fallback implementation for `transcode_request` can be removed once the minimum version of `google-api-core` is bumped to 2.34.0 in `setup.py.j2`. #}
289294
def transcode_request(
290295
http_options: List[Dict[str, str]],
291296
request: Any,

packages/gapic-generator/tests/integration/goldens/asset/google/cloud/asset_v1/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/credentials/google/iam/credentials_v1/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/logging/google/cloud/logging_v2/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/logging_internal/google/cloud/logging_v2/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/redis/google/cloud/redis_v1/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/redis_selective/google/cloud/redis_v1/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def should_use_client_cert():
4343
return use_client_cert == "true"
4444

4545

46+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
47+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
4648
def read_environment_variables():
4749
"""Returns the environment variables used by the client.
4850

packages/gapic-generator/tests/integration/goldens/storagebatchoperations/google/cloud/storagebatchoperations_v1/_compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def should_use_client_cert():
4949
return use_client_cert == "true"
5050

5151

52+
Defer to google.auth.transport.mtls.should_use_mtls_endpoint (available in google-auth >= 2.56.0)
53+
to parse GOOGLE_API_USE_MTLS_ENDPOINT when available in minimum supported google-auth. #}
5254
def read_environment_variables():
5355
"""Returns the environment variables used by the client.
5456

0 commit comments

Comments
 (0)