Skip to content

Commit 4ed4108

Browse files
chore: [Many APIs] Update gapic-generator-python to v1.20.2 (#13235)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 691540410 Source-Link: googleapis/googleapis@b43cfb1 Source-Link: googleapis/googleapis-gen@40fd27b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWF1dG9tbC8uT3dsQm90LnlhbWwiLCJoIjoiNDBmZDI3YjA4YWJiMmU4YjhhODRiNTc5NDFlMTIyNjk3MWYzN2E5NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhY2t1cGRyLy5Pd2xCb3QueWFtbCIsImgiOiI0MGZkMjdiMDhhYmIyZThiOGE4NGI1Nzk0MWUxMjI2OTcxZjM3YTk3In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhcmUtbWV0YWwtc29sdXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjQwZmQyN2IwOGFiYjJlOGI4YTg0YjU3OTQxZTEyMjY5NzFmMzdhOTcifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI0MGZkMjdiMDhhYmIyZThiOGE4NGI1Nzk0MWUxMjI2OTcxZjM3YTk3In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwY29ubmVjdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjQwZmQyN2IwOGFiYjJlOGI4YTg0YjU3OTQxZTEyMjY5NzFmMzdhOTcifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwY29ubmVjdG9ycy8uT3dsQm90LnlhbWwiLCJoIjoiNDBmZDI3YjA4YWJiMmU4YjhhODRiNTc5NDFlMTIyNjk3MWYzN2E5NyJ9 Copy-Tag: eyJwIjoicGFja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S1hdXRob3JpemF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI0MGZkMjdiMDhhYmIyZThiOGE4NGI1Nzk0MWUxMjI2OTcxZjM3YTk3In0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <[email protected]>
1 parent 85c7512 commit 4ed4108

File tree

142 files changed

+176
-4121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+176
-4121
lines changed

packages/google-cloud-automl/google/cloud/automl/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.14.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-automl/google/cloud/automl_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.14.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/client.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -564,36 +564,6 @@ def _get_universe_domain(
564564
raise ValueError("Universe Domain cannot be an empty string.")
565565
return universe_domain
566566

567-
@staticmethod
568-
def _compare_universes(
569-
client_universe: str, credentials: ga_credentials.Credentials
570-
) -> bool:
571-
"""Returns True iff the universe domains used by the client and credentials match.
572-
573-
Args:
574-
client_universe (str): The universe domain configured via the client options.
575-
credentials (ga_credentials.Credentials): The credentials being used in the client.
576-
577-
Returns:
578-
bool: True iff client_universe matches the universe in credentials.
579-
580-
Raises:
581-
ValueError: when client_universe does not match the universe in credentials.
582-
"""
583-
584-
default_universe = AutoMlClient._DEFAULT_UNIVERSE
585-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
586-
587-
if client_universe != credentials_universe:
588-
raise ValueError(
589-
"The configured universe domain "
590-
f"({client_universe}) does not match the universe domain "
591-
f"found in the credentials ({credentials_universe}). "
592-
"If you haven't configured the universe domain explicitly, "
593-
f"`{default_universe}` is the default."
594-
)
595-
return True
596-
597567
def _validate_universe_domain(self):
598568
"""Validates client's and credentials' universe domains are consistent.
599569
@@ -603,13 +573,9 @@ def _validate_universe_domain(self):
603573
Raises:
604574
ValueError: If the configured universe domain is not valid.
605575
"""
606-
self._is_universe_domain_valid = (
607-
self._is_universe_domain_valid
608-
or AutoMlClient._compare_universes(
609-
self.universe_domain, self.transport._credentials
610-
)
611-
)
612-
return self._is_universe_domain_valid
576+
577+
# NOTE (b/349488459): universe validation is disabled until further notice.
578+
return True
613579

614580
@property
615581
def api_endpoint(self):

packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/client.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -473,36 +473,6 @@ def _get_universe_domain(
473473
raise ValueError("Universe Domain cannot be an empty string.")
474474
return universe_domain
475475

476-
@staticmethod
477-
def _compare_universes(
478-
client_universe: str, credentials: ga_credentials.Credentials
479-
) -> bool:
480-
"""Returns True iff the universe domains used by the client and credentials match.
481-
482-
Args:
483-
client_universe (str): The universe domain configured via the client options.
484-
credentials (ga_credentials.Credentials): The credentials being used in the client.
485-
486-
Returns:
487-
bool: True iff client_universe matches the universe in credentials.
488-
489-
Raises:
490-
ValueError: when client_universe does not match the universe in credentials.
491-
"""
492-
493-
default_universe = PredictionServiceClient._DEFAULT_UNIVERSE
494-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
495-
496-
if client_universe != credentials_universe:
497-
raise ValueError(
498-
"The configured universe domain "
499-
f"({client_universe}) does not match the universe domain "
500-
f"found in the credentials ({credentials_universe}). "
501-
"If you haven't configured the universe domain explicitly, "
502-
f"`{default_universe}` is the default."
503-
)
504-
return True
505-
506476
def _validate_universe_domain(self):
507477
"""Validates client's and credentials' universe domains are consistent.
508478
@@ -512,13 +482,9 @@ def _validate_universe_domain(self):
512482
Raises:
513483
ValueError: If the configured universe domain is not valid.
514484
"""
515-
self._is_universe_domain_valid = (
516-
self._is_universe_domain_valid
517-
or PredictionServiceClient._compare_universes(
518-
self.universe_domain, self.transport._credentials
519-
)
520-
)
521-
return self._is_universe_domain_valid
485+
486+
# NOTE (b/349488459): universe validation is disabled until further notice.
487+
return True
522488

523489
@property
524490
def api_endpoint(self):

packages/google-cloud-automl/google/cloud/automl_v1beta1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.14.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/client.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -623,36 +623,6 @@ def _get_universe_domain(
623623
raise ValueError("Universe Domain cannot be an empty string.")
624624
return universe_domain
625625

626-
@staticmethod
627-
def _compare_universes(
628-
client_universe: str, credentials: ga_credentials.Credentials
629-
) -> bool:
630-
"""Returns True iff the universe domains used by the client and credentials match.
631-
632-
Args:
633-
client_universe (str): The universe domain configured via the client options.
634-
credentials (ga_credentials.Credentials): The credentials being used in the client.
635-
636-
Returns:
637-
bool: True iff client_universe matches the universe in credentials.
638-
639-
Raises:
640-
ValueError: when client_universe does not match the universe in credentials.
641-
"""
642-
643-
default_universe = AutoMlClient._DEFAULT_UNIVERSE
644-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
645-
646-
if client_universe != credentials_universe:
647-
raise ValueError(
648-
"The configured universe domain "
649-
f"({client_universe}) does not match the universe domain "
650-
f"found in the credentials ({credentials_universe}). "
651-
"If you haven't configured the universe domain explicitly, "
652-
f"`{default_universe}` is the default."
653-
)
654-
return True
655-
656626
def _validate_universe_domain(self):
657627
"""Validates client's and credentials' universe domains are consistent.
658628
@@ -662,13 +632,9 @@ def _validate_universe_domain(self):
662632
Raises:
663633
ValueError: If the configured universe domain is not valid.
664634
"""
665-
self._is_universe_domain_valid = (
666-
self._is_universe_domain_valid
667-
or AutoMlClient._compare_universes(
668-
self.universe_domain, self.transport._credentials
669-
)
670-
)
671-
return self._is_universe_domain_valid
635+
636+
# NOTE (b/349488459): universe validation is disabled until further notice.
637+
return True
672638

673639
@property
674640
def api_endpoint(self):

packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/client.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -473,36 +473,6 @@ def _get_universe_domain(
473473
raise ValueError("Universe Domain cannot be an empty string.")
474474
return universe_domain
475475

476-
@staticmethod
477-
def _compare_universes(
478-
client_universe: str, credentials: ga_credentials.Credentials
479-
) -> bool:
480-
"""Returns True iff the universe domains used by the client and credentials match.
481-
482-
Args:
483-
client_universe (str): The universe domain configured via the client options.
484-
credentials (ga_credentials.Credentials): The credentials being used in the client.
485-
486-
Returns:
487-
bool: True iff client_universe matches the universe in credentials.
488-
489-
Raises:
490-
ValueError: when client_universe does not match the universe in credentials.
491-
"""
492-
493-
default_universe = PredictionServiceClient._DEFAULT_UNIVERSE
494-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
495-
496-
if client_universe != credentials_universe:
497-
raise ValueError(
498-
"The configured universe domain "
499-
f"({client_universe}) does not match the universe domain "
500-
f"found in the credentials ({credentials_universe}). "
501-
"If you haven't configured the universe domain explicitly, "
502-
f"`{default_universe}` is the default."
503-
)
504-
return True
505-
506476
def _validate_universe_domain(self):
507477
"""Validates client's and credentials' universe domains are consistent.
508478
@@ -512,13 +482,9 @@ def _validate_universe_domain(self):
512482
Raises:
513483
ValueError: If the configured universe domain is not valid.
514484
"""
515-
self._is_universe_domain_valid = (
516-
self._is_universe_domain_valid
517-
or PredictionServiceClient._compare_universes(
518-
self.universe_domain, self.transport._credentials
519-
)
520-
)
521-
return self._is_universe_domain_valid
485+
486+
# NOTE (b/349488459): universe validation is disabled until further notice.
487+
return True
522488

523489
@property
524490
def api_endpoint(self):

packages/google-cloud-automl/samples/generated_samples/snippet_metadata_google.cloud.automl.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-automl",
11-
"version": "2.14.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-automl/samples/generated_samples/snippet_metadata_google.cloud.automl.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-automl",
11-
"version": "2.14.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -309,86 +309,6 @@ def test__get_universe_domain():
309309
assert str(excinfo.value) == "Universe Domain cannot be an empty string."
310310

311311

312-
@pytest.mark.parametrize(
313-
"client_class,transport_class,transport_name",
314-
[
315-
(AutoMlClient, transports.AutoMlGrpcTransport, "grpc"),
316-
(AutoMlClient, transports.AutoMlRestTransport, "rest"),
317-
],
318-
)
319-
def test__validate_universe_domain(client_class, transport_class, transport_name):
320-
client = client_class(
321-
transport=transport_class(credentials=ga_credentials.AnonymousCredentials())
322-
)
323-
assert client._validate_universe_domain() == True
324-
325-
# Test the case when universe is already validated.
326-
assert client._validate_universe_domain() == True
327-
328-
if transport_name == "grpc":
329-
# Test the case where credentials are provided by the
330-
# `local_channel_credentials`. The default universes in both match.
331-
channel = grpc.secure_channel(
332-
"http://localhost/", grpc.local_channel_credentials()
333-
)
334-
client = client_class(transport=transport_class(channel=channel))
335-
assert client._validate_universe_domain() == True
336-
337-
# Test the case where credentials do not exist: e.g. a transport is provided
338-
# with no credentials. Validation should still succeed because there is no
339-
# mismatch with non-existent credentials.
340-
channel = grpc.secure_channel(
341-
"http://localhost/", grpc.local_channel_credentials()
342-
)
343-
transport = transport_class(channel=channel)
344-
transport._credentials = None
345-
client = client_class(transport=transport)
346-
assert client._validate_universe_domain() == True
347-
348-
# TODO: This is needed to cater for older versions of google-auth
349-
# Make this test unconditional once the minimum supported version of
350-
# google-auth becomes 2.23.0 or higher.
351-
google_auth_major, google_auth_minor = [
352-
int(part) for part in google.auth.__version__.split(".")[0:2]
353-
]
354-
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
355-
credentials = ga_credentials.AnonymousCredentials()
356-
credentials._universe_domain = "foo.com"
357-
# Test the case when there is a universe mismatch from the credentials.
358-
client = client_class(transport=transport_class(credentials=credentials))
359-
with pytest.raises(ValueError) as excinfo:
360-
client._validate_universe_domain()
361-
assert (
362-
str(excinfo.value)
363-
== "The configured universe domain (googleapis.com) does not match the universe domain found in the credentials (foo.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."
364-
)
365-
366-
# Test the case when there is a universe mismatch from the client.
367-
#
368-
# TODO: Make this test unconditional once the minimum supported version of
369-
# google-api-core becomes 2.15.0 or higher.
370-
api_core_major, api_core_minor = [
371-
int(part) for part in api_core_version.__version__.split(".")[0:2]
372-
]
373-
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
374-
client = client_class(
375-
client_options={"universe_domain": "bar.com"},
376-
transport=transport_class(
377-
credentials=ga_credentials.AnonymousCredentials(),
378-
),
379-
)
380-
with pytest.raises(ValueError) as excinfo:
381-
client._validate_universe_domain()
382-
assert (
383-
str(excinfo.value)
384-
== "The configured universe domain (bar.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."
385-
)
386-
387-
# Test that ValueError is raised if universe_domain is provided via client options and credentials is None
388-
with pytest.raises(ValueError):
389-
client._compare_universes("foo.bar", None)
390-
391-
392312
@pytest.mark.parametrize(
393313
"client_class,transport_name",
394314
[

0 commit comments

Comments
 (0)