Skip to content

Commit 175ea6c

Browse files
committed
update goldens
1 parent 09a3a6b commit 175ea6c

9 files changed

Lines changed: 36 additions & 18 deletions

File tree

  • packages/gapic-generator

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def read_environment_variables():
5858
"""Returns the environment variables used by the client.
5959

6060
Returns:
61-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
61+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
6262
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
6363

6464
Raises:
@@ -75,7 +75,9 @@ def read_environment_variables():
7575
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
7676
" `auto` or `always`"
7777
)
78-
return use_client_cert, use_mtls_endpoint, universe_domain_env
78+
else:
79+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
80+
return use_client_cert, use_mtls, universe_domain_env
7981

8082

8183
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_environment_variables():
4747
"""Returns the environment variables used by the client.
4848
4949
Returns:
50-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
50+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5151
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5252
5353
Raises:
@@ -64,7 +64,9 @@ def read_environment_variables():
6464
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6565
" `auto` or `always`"
6666
)
67-
return use_client_cert, use_mtls_endpoint, universe_domain_env
67+
else:
68+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
69+
return use_client_cert, use_mtls, universe_domain_env
6870

6971

7072
DEFAULT_UNIVERSE = "googleapis.com"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def read_environment_variables():
5151
"""Returns the environment variables used by the client.
5252
5353
Returns:
54-
Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
54+
Tuple[bool, str, bool]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
5555
GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
5656
5757
Raises:
@@ -68,7 +68,9 @@ def read_environment_variables():
6868
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
6969
" `auto` or `always`"
7070
)
71-
return use_client_cert, use_mtls_endpoint, universe_domain_env
71+
else:
72+
use_mtls = use_mtls_endpoint == "always" or (use_mtls_endpoint == "auto" and use_client_cert)
73+
return use_client_cert, use_mtls, universe_domain_env
7274

7375

7476
DEFAULT_UNIVERSE = "googleapis.com"

0 commit comments

Comments
 (0)