Skip to content

Commit e16032f

Browse files
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' (#12267)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE fix: Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' fix: Add google-auth as a direct dependency fix: Add staticmethod decorator to `_get_client_cert_source` and `_get_api_endpoint` END_COMMIT_OVERRIDE chore: Update gapic-generator-python to v1.14.1 PiperOrigin-RevId: 603728206 Source-Link: googleapis/googleapis@9063da8 Source-Link: googleapis/googleapis-gen@891c67d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN1cHBvcnQvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhbGVudC8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRlbGNvYXV0b21hdGlvbi8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLX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jA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 9e8d039 commit e16032f

File tree

275 files changed

+17936
-18369
lines changed

Some content is hidden

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

275 files changed

+17936
-18369
lines changed

packages/google-cloud-support/google/cloud/support/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.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-support/google/cloud/support_v2/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.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-support/google/cloud/support_v2/services/case_attachment_service/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def _read_environment_variables():
401401
)
402402
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
403403

404+
@staticmethod
404405
def _get_client_cert_source(provided_cert_source, use_cert_flag):
405406
"""Return the client cert source to be used by the client.
406407
@@ -419,6 +420,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
419420
client_cert_source = mtls.default_client_cert_source()
420421
return client_cert_source
421422

423+
@staticmethod
422424
def _get_api_endpoint(
423425
api_override, client_cert_source, universe_domain, use_mtls_endpoint
424426
):
@@ -495,17 +497,18 @@ def _compare_universes(
495497
Raises:
496498
ValueError: when client_universe does not match the universe in credentials.
497499
"""
498-
if credentials:
499-
credentials_universe = credentials.universe_domain
500-
if client_universe != credentials_universe:
501-
default_universe = CaseAttachmentServiceClient._DEFAULT_UNIVERSE
502-
raise ValueError(
503-
"The configured universe domain "
504-
f"({client_universe}) does not match the universe domain "
505-
f"found in the credentials ({credentials_universe}). "
506-
"If you haven't configured the universe domain explicitly, "
507-
f"`{default_universe}` is the default."
508-
)
500+
501+
default_universe = CaseAttachmentServiceClient._DEFAULT_UNIVERSE
502+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
503+
504+
if client_universe != credentials_universe:
505+
raise ValueError(
506+
"The configured universe domain "
507+
f"({client_universe}) does not match the universe domain "
508+
f"found in the credentials ({credentials_universe}). "
509+
"If you haven't configured the universe domain explicitly, "
510+
f"`{default_universe}` is the default."
511+
)
509512
return True
510513

511514
def _validate_universe_domain(self):

packages/google-cloud-support/google/cloud/support_v2/services/case_service/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ def _read_environment_variables():
381381
)
382382
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
383383

384+
@staticmethod
384385
def _get_client_cert_source(provided_cert_source, use_cert_flag):
385386
"""Return the client cert source to be used by the client.
386387
@@ -399,6 +400,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
399400
client_cert_source = mtls.default_client_cert_source()
400401
return client_cert_source
401402

403+
@staticmethod
402404
def _get_api_endpoint(
403405
api_override, client_cert_source, universe_domain, use_mtls_endpoint
404406
):
@@ -473,17 +475,18 @@ def _compare_universes(
473475
Raises:
474476
ValueError: when client_universe does not match the universe in credentials.
475477
"""
476-
if credentials:
477-
credentials_universe = credentials.universe_domain
478-
if client_universe != credentials_universe:
479-
default_universe = CaseServiceClient._DEFAULT_UNIVERSE
480-
raise ValueError(
481-
"The configured universe domain "
482-
f"({client_universe}) does not match the universe domain "
483-
f"found in the credentials ({credentials_universe}). "
484-
"If you haven't configured the universe domain explicitly, "
485-
f"`{default_universe}` is the default."
486-
)
478+
479+
default_universe = CaseServiceClient._DEFAULT_UNIVERSE
480+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
481+
482+
if client_universe != credentials_universe:
483+
raise ValueError(
484+
"The configured universe domain "
485+
f"({client_universe}) does not match the universe domain "
486+
f"found in the credentials ({credentials_universe}). "
487+
"If you haven't configured the universe domain explicitly, "
488+
f"`{default_universe}` is the default."
489+
)
487490
return True
488491

489492
def _validate_universe_domain(self):

packages/google-cloud-support/google/cloud/support_v2/services/comment_service/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def _read_environment_variables():
404404
)
405405
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
406406

407+
@staticmethod
407408
def _get_client_cert_source(provided_cert_source, use_cert_flag):
408409
"""Return the client cert source to be used by the client.
409410
@@ -422,6 +423,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
422423
client_cert_source = mtls.default_client_cert_source()
423424
return client_cert_source
424425

426+
@staticmethod
425427
def _get_api_endpoint(
426428
api_override, client_cert_source, universe_domain, use_mtls_endpoint
427429
):
@@ -496,17 +498,18 @@ def _compare_universes(
496498
Raises:
497499
ValueError: when client_universe does not match the universe in credentials.
498500
"""
499-
if credentials:
500-
credentials_universe = credentials.universe_domain
501-
if client_universe != credentials_universe:
502-
default_universe = CommentServiceClient._DEFAULT_UNIVERSE
503-
raise ValueError(
504-
"The configured universe domain "
505-
f"({client_universe}) does not match the universe domain "
506-
f"found in the credentials ({credentials_universe}). "
507-
"If you haven't configured the universe domain explicitly, "
508-
f"`{default_universe}` is the default."
509-
)
501+
502+
default_universe = CommentServiceClient._DEFAULT_UNIVERSE
503+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
504+
505+
if client_universe != credentials_universe:
506+
raise ValueError(
507+
"The configured universe domain "
508+
f"({client_universe}) does not match the universe domain "
509+
f"found in the credentials ({credentials_universe}). "
510+
"If you haven't configured the universe domain explicitly, "
511+
f"`{default_universe}` is the default."
512+
)
510513
return True
511514

512515
def _validate_universe_domain(self):

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

packages/google-cloud-support/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
dependencies = [
4242
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
43+
"google-auth >= 2.14.1, <3.0.0dev",
4344
"proto-plus >= 1.22.3, <2.0.0dev",
4445
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
4546
]

packages/google-cloud-support/testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
77
google-api-core==1.34.0
8+
google-auth==2.14.1
89
proto-plus==1.22.3
910
protobuf==3.19.5

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy