Content-Length: 1339320 | pFad | https://github.com/googleapis/google-cloud-python/commit/59c42878386ee08d1717b73e47d33d76cfb38ba0

1A chore: [Many APIs] Update gapic-generator-python to v1.20.2 (#13237) · googleapis/google-cloud-python@59c4287 · GitHub
Skip to content

Commit 59c4287

Browse files
chore: [Many APIs] Update gapic-generator-python to v1.20.2 (#13237)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 691540410 Source-Link: googleapis/googleapis@b43cfb1 Source-Link: googleapis/googleapis-gen@40fd27b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRtcy8uT3dsQm90LnlhbWwiLCJoIjoiNDBmZDI3YjA4YWJiMmU4YjhhODRiNTc5NDFlMTIyNjk3MWYzN2E5NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXF1b3Rhcy8uT3dsQm90LnlhbWwiLCJoIjoiNDBmZDI3YjA4YWJiMmU4YjhhODRiNTc5NDFlMTIyNjk3MWYzN2E5NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2UtY29udHJvbC8uT3dsQm90LnlhbWwiLCJoIjoiNDBmZDI3YjA4YWJiMmU4YjhhODRiNTc5NDFlMTIyNjk3MWYzN2E5NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2UtbWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiNDBmZDI3YjA4YWJiMmU4YjhhODRiNTc5NDFlMTIyNjk3MWYzN2E5NyJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2UtdXNhZ2UvLk93bEJvdC55YW1sIiwiaCI6IjQwZmQyN2IwOGFiYjJlOGI4YTg0YjU3OTQxZTEyMjY5NzFmMzdhOTcifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 566f58f commit 59c4287

File tree

31 files changed

+38
-839
lines changed

31 files changed

+38
-839
lines changed

packages/google-cloud-dms/google/cloud/clouddms/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__ = "1.10.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dms/google/cloud/clouddms_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__ = "1.10.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dms/google/cloud/clouddms_v1/services/data_migration_service/client.py

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

587-
@staticmethod
588-
def _compare_universes(
589-
client_universe: str, credentials: ga_credentials.Credentials
590-
) -> bool:
591-
"""Returns True iff the universe domains used by the client and credentials match.
592-
593-
Args:
594-
client_universe (str): The universe domain configured via the client options.
595-
credentials (ga_credentials.Credentials): The credentials being used in the client.
596-
597-
Returns:
598-
bool: True iff client_universe matches the universe in credentials.
599-
600-
Raises:
601-
ValueError: when client_universe does not match the universe in credentials.
602-
"""
603-
604-
default_universe = DataMigrationServiceClient._DEFAULT_UNIVERSE
605-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
606-
607-
if client_universe != credentials_universe:
608-
raise ValueError(
609-
"The configured universe domain "
610-
f"({client_universe}) does not match the universe domain "
611-
f"found in the credentials ({credentials_universe}). "
612-
"If you haven't configured the universe domain explicitly, "
613-
f"`{default_universe}` is the default."
614-
)
615-
return True
616-
617587
def _validate_universe_domain(self):
618588
"""Validates client's and credentials' universe domains are consistent.
619589
@@ -623,13 +593,9 @@ def _validate_universe_domain(self):
623593
Raises:
624594
ValueError: If the configured universe domain is not valid.
625595
"""
626-
self._is_universe_domain_valid = (
627-
self._is_universe_domain_valid
628-
or DataMigrationServiceClient._compare_universes(
629-
self.universe_domain, self.transport._credentials
630-
)
631-
)
632-
return self._is_universe_domain_valid
596+
597+
# NOTE (b/349488459): universe validation is disabled until further notice.
598+
return True
633599

634600
@property
635601
def api_endpoint(self):

packages/google-cloud-dms/samples/generated_samples/snippet_metadata_google.cloud.clouddms.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-dms",
11-
"version": "1.10.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-dms/tests/unit/gapic/clouddms_v1/test_data_migration_service.py

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -354,89 +354,6 @@ def test__get_universe_domain():
354354
assert str(excinfo.value) == "Universe Domain cannot be an empty string."
355355

356356

357-
@pytest.mark.parametrize(
358-
"client_class,transport_class,transport_name",
359-
[
360-
(
361-
DataMigrationServiceClient,
362-
transports.DataMigrationServiceGrpcTransport,
363-
"grpc",
364-
),
365-
],
366-
)
367-
def test__validate_universe_domain(client_class, transport_class, transport_name):
368-
client = client_class(
369-
transport=transport_class(credentials=ga_credentials.AnonymousCredentials())
370-
)
371-
assert client._validate_universe_domain() == True
372-
373-
# Test the case when universe is already validated.
374-
assert client._validate_universe_domain() == True
375-
376-
if transport_name == "grpc":
377-
# Test the case where credentials are provided by the
378-
# `local_channel_credentials`. The default universes in both match.
379-
channel = grpc.secure_channel(
380-
"http://localhost/", grpc.local_channel_credentials()
381-
)
382-
client = client_class(transport=transport_class(channel=channel))
383-
assert client._validate_universe_domain() == True
384-
385-
# Test the case where credentials do not exist: e.g. a transport is provided
386-
# with no credentials. Validation should still succeed because there is no
387-
# mismatch with non-existent credentials.
388-
channel = grpc.secure_channel(
389-
"http://localhost/", grpc.local_channel_credentials()
390-
)
391-
transport = transport_class(channel=channel)
392-
transport._credentials = None
393-
client = client_class(transport=transport)
394-
assert client._validate_universe_domain() == True
395-
396-
# TODO: This is needed to cater for older versions of google-auth
397-
# Make this test unconditional once the minimum supported version of
398-
# google-auth becomes 2.23.0 or higher.
399-
google_auth_major, google_auth_minor = [
400-
int(part) for part in google.auth.__version__.split(".")[0:2]
401-
]
402-
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
403-
credentials = ga_credentials.AnonymousCredentials()
404-
credentials._universe_domain = "foo.com"
405-
# Test the case when there is a universe mismatch from the credentials.
406-
client = client_class(transport=transport_class(credentials=credentials))
407-
with pytest.raises(ValueError) as excinfo:
408-
client._validate_universe_domain()
409-
assert (
410-
str(excinfo.value)
411-
== "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."
412-
)
413-
414-
# Test the case when there is a universe mismatch from the client.
415-
#
416-
# TODO: Make this test unconditional once the minimum supported version of
417-
# google-api-core becomes 2.15.0 or higher.
418-
api_core_major, api_core_minor = [
419-
int(part) for part in api_core_version.__version__.split(".")[0:2]
420-
]
421-
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
422-
client = client_class(
423-
client_options={"universe_domain": "bar.com"},
424-
transport=transport_class(
425-
credentials=ga_credentials.AnonymousCredentials(),
426-
),
427-
)
428-
with pytest.raises(ValueError) as excinfo:
429-
client._validate_universe_domain()
430-
assert (
431-
str(excinfo.value)
432-
== "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."
433-
)
434-
435-
# Test that ValueError is raised if universe_domain is provided via client options and credentials is None
436-
with pytest.raises(ValueError):
437-
client._compare_universes("foo.bar", None)
438-
439-
440357
@pytest.mark.parametrize(
441358
"client_class,transport_name",
442359
[

packages/google-cloud-quotas/google/cloud/cloudquotas/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__ = "0.1.11" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-quotas/google/cloud/cloudquotas_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__ = "0.1.11" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-quotas/google/cloud/cloudquotas_v1/services/cloud_quotas/client.py

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

499-
@staticmethod
500-
def _compare_universes(
501-
client_universe: str, credentials: ga_credentials.Credentials
502-
) -> bool:
503-
"""Returns True iff the universe domains used by the client and credentials match.
504-
505-
Args:
506-
client_universe (str): The universe domain configured via the client options.
507-
credentials (ga_credentials.Credentials): The credentials being used in the client.
508-
509-
Returns:
510-
bool: True iff client_universe matches the universe in credentials.
511-
512-
Raises:
513-
ValueError: when client_universe does not match the universe in credentials.
514-
"""
515-
516-
default_universe = CloudQuotasClient._DEFAULT_UNIVERSE
517-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
518-
519-
if client_universe != credentials_universe:
520-
raise ValueError(
521-
"The configured universe domain "
522-
f"({client_universe}) does not match the universe domain "
523-
f"found in the credentials ({credentials_universe}). "
524-
"If you haven't configured the universe domain explicitly, "
525-
f"`{default_universe}` is the default."
526-
)
527-
return True
528-
529499
def _validate_universe_domain(self):
530500
"""Validates client's and credentials' universe domains are consistent.
531501
@@ -535,13 +505,9 @@ def _validate_universe_domain(self):
535505
Raises:
536506
ValueError: If the configured universe domain is not valid.
537507
"""
538-
self._is_universe_domain_valid = (
539-
self._is_universe_domain_valid
540-
or CloudQuotasClient._compare_universes(
541-
self.universe_domain, self.transport._credentials
542-
)
543-
)
544-
return self._is_universe_domain_valid
508+
509+
# NOTE (b/349488459): universe validation is disabled until further notice.
510+
return True
545511

546512
@property
547513
def api_endpoint(self):

packages/google-cloud-quotas/samples/generated_samples/snippet_metadata_google.api.cloudquotas.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-quotas",
11-
"version": "0.1.11"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-quotas/tests/unit/gapic/cloudquotas_v1/test_cloud_quotas.py

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

304304

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

packages/google-cloud-service-control/google/cloud/servicecontrol/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__ = "1.13.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-service-control/google/cloud/servicecontrol_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__ = "1.13.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-service-control/google/cloud/servicecontrol_v1/services/quota_controller/client.py

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

445-
@staticmethod
446-
def _compare_universes(
447-
client_universe: str, credentials: ga_credentials.Credentials
448-
) -> bool:
449-
"""Returns True iff the universe domains used by the client and credentials match.
450-
451-
Args:
452-
client_universe (str): The universe domain configured via the client options.
453-
credentials (ga_credentials.Credentials): The credentials being used in the client.
454-
455-
Returns:
456-
bool: True iff client_universe matches the universe in credentials.
457-
458-
Raises:
459-
ValueError: when client_universe does not match the universe in credentials.
460-
"""
461-
462-
default_universe = QuotaControllerClient._DEFAULT_UNIVERSE
463-
credentials_universe = getattr(credentials, "universe_domain", default_universe)
464-
465-
if client_universe != credentials_universe:
466-
raise ValueError(
467-
"The configured universe domain "
468-
f"({client_universe}) does not match the universe domain "
469-
f"found in the credentials ({credentials_universe}). "
470-
"If you haven't configured the universe domain explicitly, "
471-
f"`{default_universe}` is the default."
472-
)
473-
return True
474-
475445
def _validate_universe_domain(self):
476446
"""Validates client's and credentials' universe domains are consistent.
477447
@@ -481,13 +451,9 @@ def _validate_universe_domain(self):
481451
Raises:
482452
ValueError: If the configured universe domain is not valid.
483453
"""
484-
self._is_universe_domain_valid = (
485-
self._is_universe_domain_valid
486-
or QuotaControllerClient._compare_universes(
487-
self.universe_domain, self.transport._credentials
488-
)
489-
)
490-
return self._is_universe_domain_valid
454+
455+
# NOTE (b/349488459): universe validation is disabled until further notice.
456+
return True
491457

492458
@property
493459
def api_endpoint(self):

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/google-cloud-python/commit/59c42878386ee08d1717b73e47d33d76cfb38ba0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy