From 27dceb901cb9bf28da82925ad382ce7c58e91f38 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:29:18 -0500 Subject: [PATCH] fix: [Many APIs] Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' (#12264) - [ ] 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 PiperOrigin-RevId: 603728206 Source-Link: https://github.com/googleapis/googleapis/commit/9063da8b4d45339db4e2d7d92a27c6708620e694 Source-Link: https://github.com/googleapis/googleapis-gen/commit/891c67d0a855b08085eb301dabb14064ef4b2c6d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZS1odWIvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZS1tdWx0aWNsb3VkLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdzdWl0ZWFkZG9ucy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhbS1sb2dnaW5nLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhbS8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhcC8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlkcy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy1pbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWxhbmd1YWdlLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWxpZmUtc2NpZW5jZXMvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1hbmFnZWQtaWRlbnRpdGllcy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1lZGlhLXRyYW5zbGF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1lbWNhY2hlLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1pZ3JhdGlvbmNlbnRlci8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1vbml0b3JpbmctZGFzaGJvYXJkcy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1vbml0b3JpbmctbWV0cmljcy1zY29wZXMvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1vbml0b3JpbmcvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldGFwcC8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmstY29ubmVjdGl2aXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= --------- Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../google/cloud/gkehub/gapic_version.py | 2 +- .../configmanagement_v1/gapic_version.py | 2 +- .../google/cloud/gkehub_v1/gapic_version.py | 2 +- .../multiclusteringress_v1/gapic_version.py | 2 +- .../gkehub_v1/services/gke_hub/client.py | 25 +- ...ippet_metadata_google.cloud.gkehub.v1.json | 2 +- packages/google-cloud-gke-hub/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../unit/gapic/gkehub_v1/test_gke_hub.py | 557 ++--- .../cloud/gke_multicloud/gapic_version.py | 2 +- .../cloud/gke_multicloud_v1/gapic_version.py | 2 +- .../services/attached_clusters/client.py | 25 +- .../services/aws_clusters/client.py | 25 +- .../services/azure_clusters/client.py | 25 +- ...etadata_google.cloud.gkemulticloud.v1.json | 2 +- packages/google-cloud-gke-multicloud/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_attached_clusters.py | 577 +++-- .../gke_multicloud_v1/test_aws_clusters.py | 815 +++--- .../gke_multicloud_v1/test_azure_clusters.py | 961 ++++--- .../cloud/gsuiteaddons/gapic_version.py | 2 +- .../cloud/gsuiteaddons_v1/gapic_version.py | 2 +- .../services/g_suite_add_ons/client.py | 25 +- ...metadata_google.cloud.gsuiteaddons.v1.json | 2 +- packages/google-cloud-gsuiteaddons/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../gsuiteaddons_v1/test_g_suite_add_ons.py | 519 ++-- .../google/cloud/iam_logging/gapic_version.py | 2 +- .../cloud/iam_logging_v1/gapic_version.py | 2 +- packages/google-cloud-iam-logging/noxfile.py | 18 + packages/google-cloud-iam-logging/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../google/cloud/iam/gapic_version.py | 2 +- .../cloud/iam_credentials/gapic_version.py | 2 +- .../cloud/iam_credentials_v1/gapic_version.py | 2 +- .../services/iam_credentials/client.py | 25 +- .../google/cloud/iam_v2/gapic_version.py | 2 +- .../cloud/iam_v2/services/policies/client.py | 25 +- .../google/cloud/iam_v2beta/gapic_version.py | 2 +- .../iam_v2beta/services/policies/client.py | 25 +- ...et_metadata_google.iam.credentials.v1.json | 2 +- .../snippet_metadata_google.iam.v2.json | 2 +- .../snippet_metadata_google.iam.v2beta.json | 2 +- packages/google-cloud-iam/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_iam_credentials.py | 321 ++- .../tests/unit/gapic/iam_v2/test_policies.py | 377 ++- .../unit/gapic/iam_v2beta/test_policies.py | 269 +- .../google/cloud/iap/gapic_version.py | 2 +- .../google/cloud/iap_v1/gapic_version.py | 2 +- .../client.py | 27 +- .../client.py | 27 +- .../snippet_metadata_google.cloud.iap.v1.json | 2 +- packages/google-cloud-iap/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + ...test_identity_aware_proxy_admin_service.py | 503 ++-- ...est_identity_aware_proxy_o_auth_service.py | 385 ++- .../google/cloud/ids/gapic_version.py | 2 +- .../google/cloud/ids_v1/gapic_version.py | 2 +- .../cloud/ids_v1/services/ids/client.py | 25 +- .../snippet_metadata_google.cloud.ids.v1.json | 2 +- packages/google-cloud-ids/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../tests/unit/gapic/ids_v1/test_ids.py | 335 ++- .../cloud/kms_inventory/gapic_version.py | 2 +- .../cloud/kms_inventory_v1/gapic_version.py | 2 +- .../services/key_dashboard_service/client.py | 25 +- .../services/key_tracking_service/client.py | 25 +- ...etadata_google.cloud.kms.inventory.v1.json | 2 +- packages/google-cloud-kms-inventory/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_key_dashboard_service.py | 215 +- .../test_key_tracking_service.py | 253 +- .../google/cloud/kms/gapic_version.py | 2 +- .../google/cloud/kms_v1/gapic_version.py | 2 +- .../kms_v1/services/ekm_service/client.py | 25 +- .../services/key_management_service/client.py | 25 +- .../snippet_metadata_google.cloud.kms.v1.json | 2 +- packages/google-cloud-kms/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../unit/gapic/kms_v1/test_ekm_service.py | 525 ++-- .../kms_v1/test_key_management_service.py | 1301 +++++----- .../google/cloud/language/gapic_version.py | 2 +- .../google/cloud/language_v1/gapic_version.py | 2 +- .../services/language_service/client.py | 25 +- .../cloud/language_v1beta2/gapic_version.py | 2 +- .../services/language_service/client.py | 25 +- .../google/cloud/language_v2/gapic_version.py | 2 +- .../services/language_service/client.py | 25 +- ...pet_metadata_google.cloud.language.v1.json | 2 +- ...etadata_google.cloud.language.v1beta2.json | 2 +- ...pet_metadata_google.cloud.language.v2.json | 2 +- packages/google-cloud-language/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../language_v1/test_language_service.py | 407 ++- .../language_v1beta2/test_language_service.py | 407 ++- .../language_v2/test_language_service.py | 339 ++- .../cloud/lifesciences/gapic_version.py | 2 +- .../lifesciences_v2beta/gapic_version.py | 2 +- .../workflows_service_v2_beta/client.py | 25 +- ...data_google.cloud.lifesciences.v2beta.json | 2 +- packages/google-cloud-life-sciences/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_workflows_service_v2_beta.py | 281 +-- .../cloud/managedidentities/gapic_version.py | 2 +- .../managedidentities_v1/gapic_version.py | 2 +- .../managed_identities_service/client.py | 25 +- ...ata_google.cloud.managedidentities.v1.json | 2 +- .../google-cloud-managed-identities/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_managed_identities_service.py | 355 ++- .../cloud/mediatranslation/gapic_version.py | 2 +- .../mediatranslation_v1beta1/gapic_version.py | 2 +- .../speech_translation_service/client.py | 25 +- ...google.cloud.mediatranslation.v1beta1.json | 2 +- .../google-cloud-media-translation/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_speech_translation_service.py | 167 +- .../google/cloud/memcache/gapic_version.py | 2 +- .../google/cloud/memcache_v1/gapic_version.py | 2 +- .../services/cloud_memcache/client.py | 25 +- .../cloud/memcache_v1beta2/gapic_version.py | 2 +- .../services/cloud_memcache/client.py | 25 +- ...pet_metadata_google.cloud.memcache.v1.json | 2 +- ...etadata_google.cloud.memcache.v1beta2.json | 2 +- packages/google-cloud-memcache/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../gapic/memcache_v1/test_cloud_memcache.py | 585 +++-- .../memcache_v1beta2/test_cloud_memcache.py | 623 +++-- .../cloud/migrationcenter/gapic_version.py | 2 +- .../cloud/migrationcenter_v1/gapic_version.py | 2 +- .../services/migration_center/client.py | 25 +- ...adata_google.cloud.migrationcenter.v1.json | 2 +- .../google-cloud-migrationcenter/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_migration_center.py | 2145 ++++++++-------- .../monitoring_dashboard/gapic_version.py | 2 +- .../monitoring_dashboard_v1/gapic_version.py | 2 +- .../services/dashboards_service/client.py | 25 +- ...tadata_google.monitoring.dashboard.v1.json | 2 +- .../setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_dashboards_service.py | 307 ++- .../monitoring_metrics_scope/gapic_version.py | 2 +- .../gapic_version.py | 2 +- .../services/metrics_scopes/client.py | 25 +- ...ata_google.monitoring.metricsscope.v1.json | 2 +- .../setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_metrics_scopes.py | 227 +- .../google/cloud/monitoring/gapic_version.py | 2 +- .../cloud/monitoring_v3/gapic_version.py | 2 +- .../services/alert_policy_service/client.py | 25 +- .../services/group_service/client.py | 25 +- .../services/metric_service/client.py | 25 +- .../notification_channel_service/client.py | 25 +- .../services/query_service/client.py | 25 +- .../service_monitoring_service/client.py | 25 +- .../services/snooze_service/client.py | 25 +- .../services/uptime_check_service/client.py | 25 +- ...snippet_metadata_google.monitoring.v3.json | 2 +- packages/google-cloud-monitoring/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_alert_policy_service.py | 261 +- .../gapic/monitoring_v3/test_group_service.py | 287 +-- .../monitoring_v3/test_metric_service.py | 349 ++- .../test_notification_channel_service.py | 359 ++- .../gapic/monitoring_v3/test_query_service.py | 181 +- .../test_service_monitoring_service.py | 359 ++- .../monitoring_v3/test_snooze_service.py | 243 +- .../test_uptime_check_service.py | 275 +- .../google/cloud/netapp/gapic_version.py | 2 +- .../google/cloud/netapp_v1/gapic_version.py | 2 +- .../netapp_v1/services/net_app/client.py | 25 +- ...ippet_metadata_google.cloud.netapp.v1.json | 2 +- packages/google-cloud-netapp/setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../unit/gapic/netapp_v1/test_net_app.py | 2209 ++++++++--------- .../networkconnectivity/gapic_version.py | 2 +- .../networkconnectivity_v1/gapic_version.py | 2 +- .../services/hub_service/client.py | 25 +- .../policy_based_routing_service/client.py | 25 +- .../gapic_version.py | 2 +- .../services/hub_service/client.py | 25 +- ...a_google.cloud.networkconnectivity.v1.json | 2 +- ...le.cloud.networkconnectivity.v1alpha1.json | 2 +- .../setup.py | 1 + .../testing/constraints-3.7.txt | 1 + .../test_hub_service.py | 667 +++-- .../test_policy_based_routing_service.py | 355 ++- .../test_hub_service.py | 363 ++- 191 files changed, 10282 insertions(+), 10542 deletions(-) diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub/gapic_version.py b/packages/google-cloud-gke-hub/google/cloud/gkehub/gapic_version.py index 18a7732658ee..360a0d13ebdd 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub/gapic_version.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.12.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/configmanagement_v1/gapic_version.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/configmanagement_v1/gapic_version.py index 18a7732658ee..360a0d13ebdd 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/configmanagement_v1/gapic_version.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/configmanagement_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.12.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/gapic_version.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/gapic_version.py index 18a7732658ee..360a0d13ebdd 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/gapic_version.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.12.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/multiclusteringress_v1/gapic_version.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/multiclusteringress_v1/gapic_version.py index 18a7732658ee..360a0d13ebdd 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/multiclusteringress_v1/gapic_version.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/multiclusteringress_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.12.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py index a04a7d52d6ba..a4652fe130d3 100644 --- a/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py +++ b/packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py @@ -427,6 +427,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -445,6 +446,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -519,17 +521,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = GkeHubClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = GkeHubClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-gke-hub/samples/generated_samples/snippet_metadata_google.cloud.gkehub.v1.json b/packages/google-cloud-gke-hub/samples/generated_samples/snippet_metadata_google.cloud.gkehub.v1.json index 1883c26be395..f5d7aaa2ae7a 100644 --- a/packages/google-cloud-gke-hub/samples/generated_samples/snippet_metadata_google.cloud.gkehub.v1.json +++ b/packages/google-cloud-gke-hub/samples/generated_samples/snippet_metadata_google.cloud.gkehub.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-gke-hub", - "version": "1.12.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-gke-hub/setup.py b/packages/google-cloud-gke-hub/setup.py index 75d4e9d0a47b..b02e3bd65757 100644 --- a/packages/google-cloud-gke-hub/setup.py +++ b/packages/google-cloud-gke-hub/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "grpc-google-iam-v1 >=0.12.4, <1.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", diff --git a/packages/google-cloud-gke-hub/testing/constraints-3.7.txt b/packages/google-cloud-gke-hub/testing/constraints-3.7.txt index a48c9f18c0c5..a4db8a1164a7 100644 --- a/packages/google-cloud-gke-hub/testing/constraints-3.7.txt +++ b/packages/google-cloud-gke-hub/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 grpc-google-iam-v1==0.12.4 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-gke-hub/tests/unit/gapic/gkehub_v1/test_gke_hub.py b/packages/google-cloud-gke-hub/tests/unit/gapic/gkehub_v1/test_gke_hub.py index 39d2a3bac54f..722154cd9f1d 100644 --- a/packages/google-cloud-gke-hub/tests/unit/gapic/gkehub_v1/test_gke_hub.py +++ b/packages/google-cloud-gke-hub/tests/unit/gapic/gkehub_v1/test_gke_hub.py @@ -90,18 +90,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -292,7 +280,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -319,42 +307,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -365,7 +360,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_gke_hub_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -415,7 +410,7 @@ def test_gke_hub_client_service_account_always_use_jwt(transport_class, transpor ], ) def test_gke_hub_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -472,9 +467,7 @@ def test_gke_hub_client_get_transport_class(): def test_gke_hub_client_client_options(client_class, transport_class, transport_name): # Check that if channel is provided we won't create a new one. with mock.patch.object(GkeHubClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -865,20 +858,20 @@ def test_gke_hub_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -890,13 +883,11 @@ def test_gke_hub_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -912,8 +903,7 @@ def test_gke_hub_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1050,8 +1040,8 @@ def test_gke_hub_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1080,7 +1070,7 @@ def test_gke_hub_client_create_channel_credentials_file( ) def test_list_memberships(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1112,7 +1102,7 @@ def test_list_memberships_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1129,7 +1119,7 @@ async def test_list_memberships_async( transport: str = "grpc_asyncio", request_type=service.ListMembershipsRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1166,7 +1156,7 @@ async def test_list_memberships_async_from_dict(): def test_list_memberships_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1196,7 +1186,7 @@ def test_list_memberships_field_headers(): @pytest.mark.asyncio async def test_list_memberships_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1227,7 +1217,7 @@ async def test_list_memberships_field_headers_async(): def test_list_memberships_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1251,7 +1241,7 @@ def test_list_memberships_flattened(): def test_list_memberships_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1266,7 +1256,7 @@ def test_list_memberships_flattened_error(): @pytest.mark.asyncio async def test_list_memberships_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1295,7 +1285,7 @@ async def test_list_memberships_flattened_async(): @pytest.mark.asyncio async def test_list_memberships_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1309,7 +1299,7 @@ async def test_list_memberships_flattened_error_async(): def test_list_memberships_pager(transport_name: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1359,7 +1349,7 @@ def test_list_memberships_pager(transport_name: str = "grpc"): def test_list_memberships_pages(transport_name: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1401,7 +1391,7 @@ def test_list_memberships_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_memberships_async_pager(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1451,7 +1441,7 @@ async def test_list_memberships_async_pager(): @pytest.mark.asyncio async def test_list_memberships_async_pages(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1506,7 +1496,7 @@ async def test_list_memberships_async_pages(): ) def test_list_features(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1536,7 +1526,7 @@ def test_list_features_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1553,7 +1543,7 @@ async def test_list_features_async( transport: str = "grpc_asyncio", request_type=service.ListFeaturesRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1588,7 +1578,7 @@ async def test_list_features_async_from_dict(): def test_list_features_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1618,7 +1608,7 @@ def test_list_features_field_headers(): @pytest.mark.asyncio async def test_list_features_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1649,7 +1639,7 @@ async def test_list_features_field_headers_async(): def test_list_features_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1673,7 +1663,7 @@ def test_list_features_flattened(): def test_list_features_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1688,7 +1678,7 @@ def test_list_features_flattened_error(): @pytest.mark.asyncio async def test_list_features_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1717,7 +1707,7 @@ async def test_list_features_flattened_async(): @pytest.mark.asyncio async def test_list_features_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1731,7 +1721,7 @@ async def test_list_features_flattened_error_async(): def test_list_features_pager(transport_name: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1781,7 +1771,7 @@ def test_list_features_pager(transport_name: str = "grpc"): def test_list_features_pages(transport_name: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1823,7 +1813,7 @@ def test_list_features_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_features_async_pager(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1873,7 +1863,7 @@ async def test_list_features_async_pager(): @pytest.mark.asyncio async def test_list_features_async_pages(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1928,7 +1918,7 @@ async def test_list_features_async_pages(): ) def test_get_membership(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1964,7 +1954,7 @@ def test_get_membership_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1981,7 +1971,7 @@ async def test_get_membership_async( transport: str = "grpc_asyncio", request_type=service.GetMembershipRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2022,7 +2012,7 @@ async def test_get_membership_async_from_dict(): def test_get_membership_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2052,7 +2042,7 @@ def test_get_membership_field_headers(): @pytest.mark.asyncio async def test_get_membership_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2083,7 +2073,7 @@ async def test_get_membership_field_headers_async(): def test_get_membership_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2107,7 +2097,7 @@ def test_get_membership_flattened(): def test_get_membership_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2122,7 +2112,7 @@ def test_get_membership_flattened_error(): @pytest.mark.asyncio async def test_get_membership_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2151,7 +2141,7 @@ async def test_get_membership_flattened_async(): @pytest.mark.asyncio async def test_get_membership_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2172,7 +2162,7 @@ async def test_get_membership_flattened_error_async(): ) def test_get_feature(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2202,7 +2192,7 @@ def test_get_feature_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2219,7 +2209,7 @@ async def test_get_feature_async( transport: str = "grpc_asyncio", request_type=service.GetFeatureRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2254,7 +2244,7 @@ async def test_get_feature_async_from_dict(): def test_get_feature_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2284,7 +2274,7 @@ def test_get_feature_field_headers(): @pytest.mark.asyncio async def test_get_feature_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2313,7 +2303,7 @@ async def test_get_feature_field_headers_async(): def test_get_feature_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2337,7 +2327,7 @@ def test_get_feature_flattened(): def test_get_feature_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2352,7 +2342,7 @@ def test_get_feature_flattened_error(): @pytest.mark.asyncio async def test_get_feature_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2379,7 +2369,7 @@ async def test_get_feature_flattened_async(): @pytest.mark.asyncio async def test_get_feature_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2400,7 +2390,7 @@ async def test_get_feature_flattened_error_async(): ) def test_create_membership(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2429,7 +2419,7 @@ def test_create_membership_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2448,7 +2438,7 @@ async def test_create_membership_async( transport: str = "grpc_asyncio", request_type=service.CreateMembershipRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2482,7 +2472,7 @@ async def test_create_membership_async_from_dict(): def test_create_membership_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2514,7 +2504,7 @@ def test_create_membership_field_headers(): @pytest.mark.asyncio async def test_create_membership_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2547,7 +2537,7 @@ async def test_create_membership_field_headers_async(): def test_create_membership_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2591,7 +2581,7 @@ def test_create_membership_flattened(): def test_create_membership_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2614,7 +2604,7 @@ def test_create_membership_flattened_error(): @pytest.mark.asyncio async def test_create_membership_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2663,7 +2653,7 @@ async def test_create_membership_flattened_async(): @pytest.mark.asyncio async def test_create_membership_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2692,7 +2682,7 @@ async def test_create_membership_flattened_error_async(): ) def test_create_feature(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2719,7 +2709,7 @@ def test_create_feature_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2736,7 +2726,7 @@ async def test_create_feature_async( transport: str = "grpc_asyncio", request_type=service.CreateFeatureRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2768,7 +2758,7 @@ async def test_create_feature_async_from_dict(): def test_create_feature_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2798,7 +2788,7 @@ def test_create_feature_field_headers(): @pytest.mark.asyncio async def test_create_feature_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2829,7 +2819,7 @@ async def test_create_feature_field_headers_async(): def test_create_feature_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2861,7 +2851,7 @@ def test_create_feature_flattened(): def test_create_feature_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2878,7 +2868,7 @@ def test_create_feature_flattened_error(): @pytest.mark.asyncio async def test_create_feature_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2915,7 +2905,7 @@ async def test_create_feature_flattened_async(): @pytest.mark.asyncio async def test_create_feature_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2938,7 +2928,7 @@ async def test_create_feature_flattened_error_async(): ) def test_delete_membership(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2967,7 +2957,7 @@ def test_delete_membership_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2986,7 +2976,7 @@ async def test_delete_membership_async( transport: str = "grpc_asyncio", request_type=service.DeleteMembershipRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3020,7 +3010,7 @@ async def test_delete_membership_async_from_dict(): def test_delete_membership_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3052,7 +3042,7 @@ def test_delete_membership_field_headers(): @pytest.mark.asyncio async def test_delete_membership_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3085,7 +3075,7 @@ async def test_delete_membership_field_headers_async(): def test_delete_membership_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3111,7 +3101,7 @@ def test_delete_membership_flattened(): def test_delete_membership_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3126,7 +3116,7 @@ def test_delete_membership_flattened_error(): @pytest.mark.asyncio async def test_delete_membership_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3157,7 +3147,7 @@ async def test_delete_membership_flattened_async(): @pytest.mark.asyncio async def test_delete_membership_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3178,7 +3168,7 @@ async def test_delete_membership_flattened_error_async(): ) def test_delete_feature(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3205,7 +3195,7 @@ def test_delete_feature_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3222,7 +3212,7 @@ async def test_delete_feature_async( transport: str = "grpc_asyncio", request_type=service.DeleteFeatureRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3254,7 +3244,7 @@ async def test_delete_feature_async_from_dict(): def test_delete_feature_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3284,7 +3274,7 @@ def test_delete_feature_field_headers(): @pytest.mark.asyncio async def test_delete_feature_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3315,7 +3305,7 @@ async def test_delete_feature_field_headers_async(): def test_delete_feature_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3339,7 +3329,7 @@ def test_delete_feature_flattened(): def test_delete_feature_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3354,7 +3344,7 @@ def test_delete_feature_flattened_error(): @pytest.mark.asyncio async def test_delete_feature_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3383,7 +3373,7 @@ async def test_delete_feature_flattened_async(): @pytest.mark.asyncio async def test_delete_feature_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3404,7 +3394,7 @@ async def test_delete_feature_flattened_error_async(): ) def test_update_membership(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3433,7 +3423,7 @@ def test_update_membership_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3452,7 +3442,7 @@ async def test_update_membership_async( transport: str = "grpc_asyncio", request_type=service.UpdateMembershipRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3486,7 +3476,7 @@ async def test_update_membership_async_from_dict(): def test_update_membership_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3518,7 +3508,7 @@ def test_update_membership_field_headers(): @pytest.mark.asyncio async def test_update_membership_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3551,7 +3541,7 @@ async def test_update_membership_field_headers_async(): def test_update_membership_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3595,7 +3585,7 @@ def test_update_membership_flattened(): def test_update_membership_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3618,7 +3608,7 @@ def test_update_membership_flattened_error(): @pytest.mark.asyncio async def test_update_membership_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3667,7 +3657,7 @@ async def test_update_membership_flattened_async(): @pytest.mark.asyncio async def test_update_membership_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3696,7 +3686,7 @@ async def test_update_membership_flattened_error_async(): ) def test_update_feature(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3723,7 +3713,7 @@ def test_update_feature_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3740,7 +3730,7 @@ async def test_update_feature_async( transport: str = "grpc_asyncio", request_type=service.UpdateFeatureRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3772,7 +3762,7 @@ async def test_update_feature_async_from_dict(): def test_update_feature_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3802,7 +3792,7 @@ def test_update_feature_field_headers(): @pytest.mark.asyncio async def test_update_feature_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3833,7 +3823,7 @@ async def test_update_feature_field_headers_async(): def test_update_feature_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3865,7 +3855,7 @@ def test_update_feature_flattened(): def test_update_feature_flattened_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3882,7 +3872,7 @@ def test_update_feature_flattened_error(): @pytest.mark.asyncio async def test_update_feature_flattened_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3919,7 +3909,7 @@ async def test_update_feature_flattened_async(): @pytest.mark.asyncio async def test_update_feature_flattened_error_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3942,7 +3932,7 @@ async def test_update_feature_flattened_error_async(): ) def test_generate_connect_manifest(request_type, transport: str = "grpc"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3971,7 +3961,7 @@ def test_generate_connect_manifest_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3990,7 +3980,7 @@ async def test_generate_connect_manifest_async( transport: str = "grpc_asyncio", request_type=service.GenerateConnectManifestRequest ): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4024,7 +4014,7 @@ async def test_generate_connect_manifest_async_from_dict(): def test_generate_connect_manifest_field_headers(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4056,7 +4046,7 @@ def test_generate_connect_manifest_field_headers(): @pytest.mark.asyncio async def test_generate_connect_manifest_field_headers_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4096,7 +4086,7 @@ async def test_generate_connect_manifest_field_headers_async(): ) def test_list_memberships_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4149,7 +4139,7 @@ def test_list_memberships_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_memberships._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4158,7 +4148,7 @@ def test_list_memberships_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_memberships._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -4176,7 +4166,7 @@ def test_list_memberships_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4218,7 +4208,7 @@ def test_list_memberships_rest_required_fields( def test_list_memberships_rest_unset_required_fields(): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_memberships._get_unset_required_fields({}) @@ -4238,7 +4228,7 @@ def test_list_memberships_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_memberships_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -4292,7 +4282,7 @@ def test_list_memberships_rest_bad_request( transport: str = "rest", request_type=service.ListMembershipsRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4314,7 +4304,7 @@ def test_list_memberships_rest_bad_request( def test_list_memberships_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4356,7 +4346,7 @@ def test_list_memberships_rest_flattened(): def test_list_memberships_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4371,7 +4361,7 @@ def test_list_memberships_rest_flattened_error(transport: str = "rest"): def test_list_memberships_rest_pager(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4439,7 +4429,7 @@ def test_list_memberships_rest_pager(transport: str = "rest"): ) def test_list_features_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4473,7 +4463,7 @@ def test_list_features_rest(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_features_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -4527,7 +4517,7 @@ def test_list_features_rest_bad_request( transport: str = "rest", request_type=service.ListFeaturesRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4549,7 +4539,7 @@ def test_list_features_rest_bad_request( def test_list_features_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4590,7 +4580,7 @@ def test_list_features_rest_flattened(): def test_list_features_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4605,7 +4595,7 @@ def test_list_features_rest_flattened_error(transport: str = "rest"): def test_list_features_rest_pager(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4673,7 +4663,7 @@ def test_list_features_rest_pager(transport: str = "rest"): ) def test_get_membership_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4728,7 +4718,7 @@ def test_get_membership_rest_required_fields(request_type=service.GetMembershipR # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_membership._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4737,7 +4727,7 @@ def test_get_membership_rest_required_fields(request_type=service.GetMembershipR jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_membership._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4746,7 +4736,7 @@ def test_get_membership_rest_required_fields(request_type=service.GetMembershipR assert jsonified_request["name"] == "name_value" client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4788,7 +4778,7 @@ def test_get_membership_rest_required_fields(request_type=service.GetMembershipR def test_get_membership_rest_unset_required_fields(): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_membership._get_unset_required_fields({}) @@ -4798,7 +4788,7 @@ def test_get_membership_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_membership_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -4852,7 +4842,7 @@ def test_get_membership_rest_bad_request( transport: str = "rest", request_type=service.GetMembershipRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4874,7 +4864,7 @@ def test_get_membership_rest_bad_request( def test_get_membership_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4918,7 +4908,7 @@ def test_get_membership_rest_flattened(): def test_get_membership_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4933,7 +4923,7 @@ def test_get_membership_rest_flattened_error(transport: str = "rest"): def test_get_membership_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4946,7 +4936,7 @@ def test_get_membership_rest_error(): ) def test_get_feature_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4980,7 +4970,7 @@ def test_get_feature_rest(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_feature_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -5032,7 +5022,7 @@ def test_get_feature_rest_bad_request( transport: str = "rest", request_type=service.GetFeatureRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5054,7 +5044,7 @@ def test_get_feature_rest_bad_request( def test_get_feature_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5095,7 +5085,7 @@ def test_get_feature_rest_flattened(): def test_get_feature_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5110,7 +5100,7 @@ def test_get_feature_rest_flattened_error(transport: str = "rest"): def test_get_feature_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5123,7 +5113,7 @@ def test_get_feature_rest_error(): ) def test_create_membership_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5290,7 +5280,7 @@ def test_create_membership_rest_required_fields( assert "membershipId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_membership._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5302,7 +5292,7 @@ def test_create_membership_rest_required_fields( jsonified_request["membershipId"] = "membership_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_membership._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5320,7 +5310,7 @@ def test_create_membership_rest_required_fields( assert jsonified_request["membershipId"] == "membership_id_value" client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5366,7 +5356,7 @@ def test_create_membership_rest_required_fields( def test_create_membership_rest_unset_required_fields(): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_membership._get_unset_required_fields({}) @@ -5390,7 +5380,7 @@ def test_create_membership_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_membership_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -5448,7 +5438,7 @@ def test_create_membership_rest_bad_request( transport: str = "rest", request_type=service.CreateMembershipRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5470,7 +5460,7 @@ def test_create_membership_rest_bad_request( def test_create_membership_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5518,7 +5508,7 @@ def test_create_membership_rest_flattened(): def test_create_membership_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5541,7 +5531,7 @@ def test_create_membership_rest_flattened_error(transport: str = "rest"): def test_create_membership_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5554,7 +5544,7 @@ def test_create_membership_rest_error(): ) def test_create_feature_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5670,7 +5660,7 @@ def get_message_fields(field): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_feature_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -5726,7 +5716,7 @@ def test_create_feature_rest_bad_request( transport: str = "rest", request_type=service.CreateFeatureRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5748,7 +5738,7 @@ def test_create_feature_rest_bad_request( def test_create_feature_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5789,7 +5779,7 @@ def test_create_feature_rest_flattened(): def test_create_feature_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5806,7 +5796,7 @@ def test_create_feature_rest_flattened_error(transport: str = "rest"): def test_create_feature_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5819,7 +5809,7 @@ def test_create_feature_rest_error(): ) def test_delete_membership_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5865,7 +5855,7 @@ def test_delete_membership_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_membership._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5874,7 +5864,7 @@ def test_delete_membership_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_membership._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5890,7 +5880,7 @@ def test_delete_membership_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5929,7 +5919,7 @@ def test_delete_membership_rest_required_fields( def test_delete_membership_rest_unset_required_fields(): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_membership._get_unset_required_fields({}) @@ -5947,7 +5937,7 @@ def test_delete_membership_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_membership_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -6005,7 +5995,7 @@ def test_delete_membership_rest_bad_request( transport: str = "rest", request_type=service.DeleteMembershipRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6027,7 +6017,7 @@ def test_delete_membership_rest_bad_request( def test_delete_membership_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6069,7 +6059,7 @@ def test_delete_membership_rest_flattened(): def test_delete_membership_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6084,7 +6074,7 @@ def test_delete_membership_rest_flattened_error(transport: str = "rest"): def test_delete_membership_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6097,7 +6087,7 @@ def test_delete_membership_rest_error(): ) def test_delete_feature_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6126,7 +6116,7 @@ def test_delete_feature_rest(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_feature_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -6182,7 +6172,7 @@ def test_delete_feature_rest_bad_request( transport: str = "rest", request_type=service.DeleteFeatureRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6204,7 +6194,7 @@ def test_delete_feature_rest_bad_request( def test_delete_feature_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6243,7 +6233,7 @@ def test_delete_feature_rest_flattened(): def test_delete_feature_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6258,7 +6248,7 @@ def test_delete_feature_rest_flattened_error(transport: str = "rest"): def test_delete_feature_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6271,7 +6261,7 @@ def test_delete_feature_rest_error(): ) def test_update_membership_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6436,7 +6426,7 @@ def test_update_membership_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_membership._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6445,7 +6435,7 @@ def test_update_membership_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_membership._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -6461,7 +6451,7 @@ def test_update_membership_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6501,7 +6491,7 @@ def test_update_membership_rest_required_fields( def test_update_membership_rest_unset_required_fields(): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_membership._get_unset_required_fields({}) @@ -6525,7 +6515,7 @@ def test_update_membership_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_membership_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -6583,7 +6573,7 @@ def test_update_membership_rest_bad_request( transport: str = "rest", request_type=service.UpdateMembershipRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6605,7 +6595,7 @@ def test_update_membership_rest_bad_request( def test_update_membership_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6655,7 +6645,7 @@ def test_update_membership_rest_flattened(): def test_update_membership_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6678,7 +6668,7 @@ def test_update_membership_rest_flattened_error(transport: str = "rest"): def test_update_membership_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6691,7 +6681,7 @@ def test_update_membership_rest_error(): ) def test_update_feature_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6807,7 +6797,7 @@ def get_message_fields(field): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_feature_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -6863,7 +6853,7 @@ def test_update_feature_rest_bad_request( transport: str = "rest", request_type=service.UpdateFeatureRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6885,7 +6875,7 @@ def test_update_feature_rest_bad_request( def test_update_feature_rest_flattened(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6926,7 +6916,7 @@ def test_update_feature_rest_flattened(): def test_update_feature_rest_flattened_error(transport: str = "rest"): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6943,7 +6933,7 @@ def test_update_feature_rest_flattened_error(transport: str = "rest"): def test_update_feature_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6956,7 +6946,7 @@ def test_update_feature_rest_error(): ) def test_generate_connect_manifest_rest(request_type): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7004,7 +6994,7 @@ def test_generate_connect_manifest_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_connect_manifest._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7013,7 +7003,7 @@ def test_generate_connect_manifest_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_connect_manifest._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -7033,7 +7023,7 @@ def test_generate_connect_manifest_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7075,7 +7065,7 @@ def test_generate_connect_manifest_rest_required_fields( def test_generate_connect_manifest_rest_unset_required_fields(): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.generate_connect_manifest._get_unset_required_fields({}) @@ -7097,7 +7087,7 @@ def test_generate_connect_manifest_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_connect_manifest_rest_interceptors(null_interceptor): transport = transports.GkeHubRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GkeHubRestInterceptor(), ) client = GkeHubClient(transport=transport) @@ -7153,7 +7143,7 @@ def test_generate_connect_manifest_rest_bad_request( transport: str = "rest", request_type=service.GenerateConnectManifestRequest ): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7175,24 +7165,24 @@ def test_generate_connect_manifest_rest_bad_request( def test_generate_connect_manifest_rest_error(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.GkeHubGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.GkeHubGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GkeHubClient( @@ -7202,7 +7192,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.GkeHubGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -7217,13 +7207,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = GkeHubClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.GkeHubGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GkeHubClient( @@ -7235,7 +7224,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.GkeHubGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = GkeHubClient(transport=transport) assert client.transport is transport @@ -7244,13 +7233,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.GkeHubGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.GkeHubGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -7267,7 +7256,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -7281,7 +7270,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = GkeHubClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -7289,7 +7278,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -7301,7 +7290,7 @@ def test_gke_hub_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.GkeHubTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -7313,7 +7302,7 @@ def test_gke_hub_base_transport(): ) as Transport: Transport.return_value = None transport = transports.GkeHubTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -7360,7 +7349,7 @@ def test_gke_hub_base_transport_with_credentials_file(): "google.cloud.gkehub_v1.services.gke_hub.transports.GkeHubTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.GkeHubTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -7379,7 +7368,7 @@ def test_gke_hub_base_transport_with_adc(): "google.cloud.gkehub_v1.services.gke_hub.transports.GkeHubTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.GkeHubTransport() adc.assert_called_once() @@ -7387,7 +7376,7 @@ def test_gke_hub_base_transport_with_adc(): def test_gke_hub_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) GkeHubClient() adc.assert_called_once_with( scopes=None, @@ -7407,7 +7396,7 @@ def test_gke_hub_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -7454,7 +7443,7 @@ def test_gke_hub_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -7479,7 +7468,7 @@ def test_gke_hub_transport_create_channel(transport_class, grpc_helpers): [transports.GkeHubGrpcTransport, transports.GkeHubGrpcAsyncIOTransport], ) def test_gke_hub_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -7517,7 +7506,7 @@ def test_gke_hub_grpc_transport_client_cert_source_for_mtls(transport_class): def test_gke_hub_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -7529,7 +7518,7 @@ def test_gke_hub_http_transport_client_cert_source_for_mtls(): def test_gke_hub_rest_lro_client(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -7554,7 +7543,7 @@ def test_gke_hub_rest_lro_client(): ) def test_gke_hub_host_no_port(transport_name): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkehub.googleapis.com" ), @@ -7577,7 +7566,7 @@ def test_gke_hub_host_no_port(transport_name): ) def test_gke_hub_host_with_port(transport_name): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkehub.googleapis.com:8000" ), @@ -7597,8 +7586,8 @@ def test_gke_hub_host_with_port(transport_name): ], ) def test_gke_hub_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = GkeHubClient( credentials=creds1, transport=transport_name, @@ -7687,7 +7676,7 @@ def test_gke_hub_transport_channel_mtls_with_client_cert_source(transport_class) mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -7762,7 +7751,7 @@ def test_gke_hub_transport_channel_mtls_with_adc(transport_class): def test_gke_hub_grpc_lro_client(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -7779,7 +7768,7 @@ def test_gke_hub_grpc_lro_client(): def test_gke_hub_grpc_lro_async_client(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -7958,7 +7947,7 @@ def test_client_with_default_client_info(): transports.GkeHubTransport, "_prep_wrapped_messages" ) as prep: client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7968,7 +7957,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = GkeHubClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7977,7 +7966,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = GkeHubAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -7996,7 +7985,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -8013,7 +8002,7 @@ def test_client_ctx(): ] for transport in transports: client = GkeHubClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud/gapic_version.py b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud/gapic_version.py index 31104fb7ab8e..360a0d13ebdd 100644 --- a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud/gapic_version.py +++ b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.6.6" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/gapic_version.py b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/gapic_version.py index 31104fb7ab8e..360a0d13ebdd 100644 --- a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/gapic_version.py +++ b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.6.6" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/attached_clusters/client.py b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/attached_clusters/client.py index f17e96b95f78..5f4843ffe24a 100644 --- a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/attached_clusters/client.py +++ b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/attached_clusters/client.py @@ -416,6 +416,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -434,6 +435,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -508,17 +510,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = AttachedClustersClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = AttachedClustersClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/aws_clusters/client.py b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/aws_clusters/client.py index 28b7d0cb5b78..d272ded112ed 100644 --- a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/aws_clusters/client.py +++ b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/aws_clusters/client.py @@ -440,6 +440,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -458,6 +459,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -532,17 +534,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = AwsClustersClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = AwsClustersClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/azure_clusters/client.py b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/azure_clusters/client.py index d669ae3c749a..47d7d50e26ba 100644 --- a/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/azure_clusters/client.py +++ b/packages/google-cloud-gke-multicloud/google/cloud/gke_multicloud_v1/services/azure_clusters/client.py @@ -460,6 +460,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -478,6 +479,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -552,17 +554,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = AzureClustersClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = AzureClustersClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-gke-multicloud/samples/generated_samples/snippet_metadata_google.cloud.gkemulticloud.v1.json b/packages/google-cloud-gke-multicloud/samples/generated_samples/snippet_metadata_google.cloud.gkemulticloud.v1.json index 6e6d05fce6e0..08dd05577dce 100644 --- a/packages/google-cloud-gke-multicloud/samples/generated_samples/snippet_metadata_google.cloud.gkemulticloud.v1.json +++ b/packages/google-cloud-gke-multicloud/samples/generated_samples/snippet_metadata_google.cloud.gkemulticloud.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-gke-multicloud", - "version": "0.6.6" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-gke-multicloud/setup.py b/packages/google-cloud-gke-multicloud/setup.py index 9b57769e0447..9c61b742be77 100644 --- a/packages/google-cloud-gke-multicloud/setup.py +++ b/packages/google-cloud-gke-multicloud/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-gke-multicloud/testing/constraints-3.7.txt b/packages/google-cloud-gke-multicloud/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-gke-multicloud/testing/constraints-3.7.txt +++ b/packages/google-cloud-gke-multicloud/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_attached_clusters.py b/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_attached_clusters.py index aa398d1ed8be..44ce944ea7f9 100644 --- a/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_attached_clusters.py +++ b/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_attached_clusters.py @@ -94,18 +94,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -333,7 +321,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -360,42 +348,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -408,7 +403,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_attached_clusters_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -462,7 +457,7 @@ def test_attached_clusters_client_service_account_always_use_jwt( def test_attached_clusters_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -525,9 +520,7 @@ def test_attached_clusters_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(AttachedClustersClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -946,20 +939,20 @@ def test_attached_clusters_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -971,13 +964,11 @@ def test_attached_clusters_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -993,8 +984,7 @@ def test_attached_clusters_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1152,8 +1142,8 @@ def test_attached_clusters_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1182,7 +1172,7 @@ def test_attached_clusters_client_create_channel_credentials_file( ) def test_create_attached_cluster(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1211,7 +1201,7 @@ def test_create_attached_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1231,7 +1221,7 @@ async def test_create_attached_cluster_async( request_type=attached_service.CreateAttachedClusterRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1265,7 +1255,7 @@ async def test_create_attached_cluster_async_from_dict(): def test_create_attached_cluster_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1297,7 +1287,7 @@ def test_create_attached_cluster_field_headers(): @pytest.mark.asyncio async def test_create_attached_cluster_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1330,7 +1320,7 @@ async def test_create_attached_cluster_field_headers_async(): def test_create_attached_cluster_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1364,7 +1354,7 @@ def test_create_attached_cluster_flattened(): def test_create_attached_cluster_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1381,7 +1371,7 @@ def test_create_attached_cluster_flattened_error(): @pytest.mark.asyncio async def test_create_attached_cluster_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1420,7 +1410,7 @@ async def test_create_attached_cluster_flattened_async(): @pytest.mark.asyncio async def test_create_attached_cluster_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1443,7 +1433,7 @@ async def test_create_attached_cluster_flattened_error_async(): ) def test_update_attached_cluster(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1472,7 +1462,7 @@ def test_update_attached_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1492,7 +1482,7 @@ async def test_update_attached_cluster_async( request_type=attached_service.UpdateAttachedClusterRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1526,7 +1516,7 @@ async def test_update_attached_cluster_async_from_dict(): def test_update_attached_cluster_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1558,7 +1548,7 @@ def test_update_attached_cluster_field_headers(): @pytest.mark.asyncio async def test_update_attached_cluster_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1591,7 +1581,7 @@ async def test_update_attached_cluster_field_headers_async(): def test_update_attached_cluster_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1621,7 +1611,7 @@ def test_update_attached_cluster_flattened(): def test_update_attached_cluster_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1637,7 +1627,7 @@ def test_update_attached_cluster_flattened_error(): @pytest.mark.asyncio async def test_update_attached_cluster_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1672,7 +1662,7 @@ async def test_update_attached_cluster_flattened_async(): @pytest.mark.asyncio async def test_update_attached_cluster_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1694,7 +1684,7 @@ async def test_update_attached_cluster_flattened_error_async(): ) def test_import_attached_cluster(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1723,7 +1713,7 @@ def test_import_attached_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1743,7 +1733,7 @@ async def test_import_attached_cluster_async( request_type=attached_service.ImportAttachedClusterRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1777,7 +1767,7 @@ async def test_import_attached_cluster_async_from_dict(): def test_import_attached_cluster_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1809,7 +1799,7 @@ def test_import_attached_cluster_field_headers(): @pytest.mark.asyncio async def test_import_attached_cluster_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1842,7 +1832,7 @@ async def test_import_attached_cluster_field_headers_async(): def test_import_attached_cluster_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1872,7 +1862,7 @@ def test_import_attached_cluster_flattened(): def test_import_attached_cluster_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1888,7 +1878,7 @@ def test_import_attached_cluster_flattened_error(): @pytest.mark.asyncio async def test_import_attached_cluster_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1923,7 +1913,7 @@ async def test_import_attached_cluster_flattened_async(): @pytest.mark.asyncio async def test_import_attached_cluster_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1945,7 +1935,7 @@ async def test_import_attached_cluster_flattened_error_async(): ) def test_get_attached_cluster(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1995,7 +1985,7 @@ def test_get_attached_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2015,7 +2005,7 @@ async def test_get_attached_cluster_async( request_type=attached_service.GetAttachedClusterRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2070,7 +2060,7 @@ async def test_get_attached_cluster_async_from_dict(): def test_get_attached_cluster_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2102,7 +2092,7 @@ def test_get_attached_cluster_field_headers(): @pytest.mark.asyncio async def test_get_attached_cluster_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2135,7 +2125,7 @@ async def test_get_attached_cluster_field_headers_async(): def test_get_attached_cluster_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2161,7 +2151,7 @@ def test_get_attached_cluster_flattened(): def test_get_attached_cluster_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2176,7 +2166,7 @@ def test_get_attached_cluster_flattened_error(): @pytest.mark.asyncio async def test_get_attached_cluster_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2207,7 +2197,7 @@ async def test_get_attached_cluster_flattened_async(): @pytest.mark.asyncio async def test_get_attached_cluster_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2228,7 +2218,7 @@ async def test_get_attached_cluster_flattened_error_async(): ) def test_list_attached_clusters(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2260,7 +2250,7 @@ def test_list_attached_clusters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2280,7 +2270,7 @@ async def test_list_attached_clusters_async( request_type=attached_service.ListAttachedClustersRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2317,7 +2307,7 @@ async def test_list_attached_clusters_async_from_dict(): def test_list_attached_clusters_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2349,7 +2339,7 @@ def test_list_attached_clusters_field_headers(): @pytest.mark.asyncio async def test_list_attached_clusters_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2382,7 +2372,7 @@ async def test_list_attached_clusters_field_headers_async(): def test_list_attached_clusters_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2408,7 +2398,7 @@ def test_list_attached_clusters_flattened(): def test_list_attached_clusters_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2423,7 +2413,7 @@ def test_list_attached_clusters_flattened_error(): @pytest.mark.asyncio async def test_list_attached_clusters_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2454,7 +2444,7 @@ async def test_list_attached_clusters_flattened_async(): @pytest.mark.asyncio async def test_list_attached_clusters_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2468,7 +2458,7 @@ async def test_list_attached_clusters_flattened_error_async(): def test_list_attached_clusters_pager(transport_name: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2520,7 +2510,7 @@ def test_list_attached_clusters_pager(transport_name: str = "grpc"): def test_list_attached_clusters_pages(transport_name: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2564,7 +2554,7 @@ def test_list_attached_clusters_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_attached_clusters_async_pager(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2616,7 +2606,7 @@ async def test_list_attached_clusters_async_pager(): @pytest.mark.asyncio async def test_list_attached_clusters_async_pages(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2673,7 +2663,7 @@ async def test_list_attached_clusters_async_pages(): ) def test_delete_attached_cluster(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2702,7 +2692,7 @@ def test_delete_attached_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2722,7 +2712,7 @@ async def test_delete_attached_cluster_async( request_type=attached_service.DeleteAttachedClusterRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2756,7 +2746,7 @@ async def test_delete_attached_cluster_async_from_dict(): def test_delete_attached_cluster_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2788,7 +2778,7 @@ def test_delete_attached_cluster_field_headers(): @pytest.mark.asyncio async def test_delete_attached_cluster_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2821,7 +2811,7 @@ async def test_delete_attached_cluster_field_headers_async(): def test_delete_attached_cluster_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2847,7 +2837,7 @@ def test_delete_attached_cluster_flattened(): def test_delete_attached_cluster_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2862,7 +2852,7 @@ def test_delete_attached_cluster_flattened_error(): @pytest.mark.asyncio async def test_delete_attached_cluster_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2893,7 +2883,7 @@ async def test_delete_attached_cluster_flattened_async(): @pytest.mark.asyncio async def test_delete_attached_cluster_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2914,7 +2904,7 @@ async def test_delete_attached_cluster_flattened_error_async(): ) def test_get_attached_server_config(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2946,7 +2936,7 @@ def test_get_attached_server_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2966,7 +2956,7 @@ async def test_get_attached_server_config_async( request_type=attached_service.GetAttachedServerConfigRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3003,7 +2993,7 @@ async def test_get_attached_server_config_async_from_dict(): def test_get_attached_server_config_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3035,7 +3025,7 @@ def test_get_attached_server_config_field_headers(): @pytest.mark.asyncio async def test_get_attached_server_config_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3068,7 +3058,7 @@ async def test_get_attached_server_config_field_headers_async(): def test_get_attached_server_config_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3094,7 +3084,7 @@ def test_get_attached_server_config_flattened(): def test_get_attached_server_config_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3109,7 +3099,7 @@ def test_get_attached_server_config_flattened_error(): @pytest.mark.asyncio async def test_get_attached_server_config_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3140,7 +3130,7 @@ async def test_get_attached_server_config_flattened_async(): @pytest.mark.asyncio async def test_get_attached_server_config_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3163,7 +3153,7 @@ def test_generate_attached_cluster_install_manifest( request_type, transport: str = "grpc" ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3201,7 +3191,7 @@ def test_generate_attached_cluster_install_manifest_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3223,7 +3213,7 @@ async def test_generate_attached_cluster_install_manifest_async( request_type=attached_service.GenerateAttachedClusterInstallManifestRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3264,7 +3254,7 @@ async def test_generate_attached_cluster_install_manifest_async_from_dict(): def test_generate_attached_cluster_install_manifest_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3298,7 +3288,7 @@ def test_generate_attached_cluster_install_manifest_field_headers(): @pytest.mark.asyncio async def test_generate_attached_cluster_install_manifest_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3331,7 +3321,7 @@ async def test_generate_attached_cluster_install_manifest_field_headers_async(): def test_generate_attached_cluster_install_manifest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3363,7 +3353,7 @@ def test_generate_attached_cluster_install_manifest_flattened(): def test_generate_attached_cluster_install_manifest_flattened_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3379,7 +3369,7 @@ def test_generate_attached_cluster_install_manifest_flattened_error(): @pytest.mark.asyncio async def test_generate_attached_cluster_install_manifest_flattened_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3416,7 +3406,7 @@ async def test_generate_attached_cluster_install_manifest_flattened_async(): @pytest.mark.asyncio async def test_generate_attached_cluster_install_manifest_flattened_error_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3438,7 +3428,7 @@ async def test_generate_attached_cluster_install_manifest_flattened_error_async( ) def test_generate_attached_cluster_agent_token(request_type, transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3476,7 +3466,7 @@ def test_generate_attached_cluster_agent_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3496,7 +3486,7 @@ async def test_generate_attached_cluster_agent_token_async( request_type=attached_service.GenerateAttachedClusterAgentTokenRequest, ): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3539,7 +3529,7 @@ async def test_generate_attached_cluster_agent_token_async_from_dict(): def test_generate_attached_cluster_agent_token_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3571,7 +3561,7 @@ def test_generate_attached_cluster_agent_token_field_headers(): @pytest.mark.asyncio async def test_generate_attached_cluster_agent_token_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3611,7 +3601,7 @@ async def test_generate_attached_cluster_agent_token_field_headers_async(): ) def test_create_attached_cluster_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3761,7 +3751,7 @@ def test_create_attached_cluster_rest_required_fields( assert "attachedClusterId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3773,7 +3763,7 @@ def test_create_attached_cluster_rest_required_fields( jsonified_request["attachedClusterId"] = "attached_cluster_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_attached_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -3791,7 +3781,7 @@ def test_create_attached_cluster_rest_required_fields( assert jsonified_request["attachedClusterId"] == "attached_cluster_id_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3836,7 +3826,7 @@ def test_create_attached_cluster_rest_required_fields( def test_create_attached_cluster_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_attached_cluster._get_unset_required_fields({}) @@ -3860,7 +3850,7 @@ def test_create_attached_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_attached_cluster_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -3920,7 +3910,7 @@ def test_create_attached_cluster_rest_bad_request( transport: str = "rest", request_type=attached_service.CreateAttachedClusterRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3942,7 +3932,7 @@ def test_create_attached_cluster_rest_bad_request( def test_create_attached_cluster_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3984,7 +3974,7 @@ def test_create_attached_cluster_rest_flattened(): def test_create_attached_cluster_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4001,7 +3991,7 @@ def test_create_attached_cluster_rest_flattened_error(transport: str = "rest"): def test_create_attached_cluster_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4014,7 +4004,7 @@ def test_create_attached_cluster_rest_error(): ) def test_update_attached_cluster_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4165,14 +4155,14 @@ def test_update_attached_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_attached_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -4186,7 +4176,7 @@ def test_update_attached_cluster_rest_required_fields( # verify required fields with non-default values are left alone client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4226,7 +4216,7 @@ def test_update_attached_cluster_rest_required_fields( def test_update_attached_cluster_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_attached_cluster._get_unset_required_fields({}) @@ -4249,7 +4239,7 @@ def test_update_attached_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_attached_cluster_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -4309,7 +4299,7 @@ def test_update_attached_cluster_rest_bad_request( transport: str = "rest", request_type=attached_service.UpdateAttachedClusterRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4335,7 +4325,7 @@ def test_update_attached_cluster_rest_bad_request( def test_update_attached_cluster_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4380,7 +4370,7 @@ def test_update_attached_cluster_rest_flattened(): def test_update_attached_cluster_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4396,7 +4386,7 @@ def test_update_attached_cluster_rest_flattened_error(transport: str = "rest"): def test_update_attached_cluster_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4409,7 +4399,7 @@ def test_update_attached_cluster_rest_error(): ) def test_import_attached_cluster_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4458,7 +4448,7 @@ def test_import_attached_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).import_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4470,7 +4460,7 @@ def test_import_attached_cluster_rest_required_fields( jsonified_request["distribution"] = "distribution_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).import_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4485,7 +4475,7 @@ def test_import_attached_cluster_rest_required_fields( assert jsonified_request["distribution"] == "distribution_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4525,7 +4515,7 @@ def test_import_attached_cluster_rest_required_fields( def test_import_attached_cluster_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.import_attached_cluster._get_unset_required_fields({}) @@ -4545,7 +4535,7 @@ def test_import_attached_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_import_attached_cluster_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -4605,7 +4595,7 @@ def test_import_attached_cluster_rest_bad_request( transport: str = "rest", request_type=attached_service.ImportAttachedClusterRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4627,7 +4617,7 @@ def test_import_attached_cluster_rest_bad_request( def test_import_attached_cluster_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4668,7 +4658,7 @@ def test_import_attached_cluster_rest_flattened(): def test_import_attached_cluster_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4684,7 +4674,7 @@ def test_import_attached_cluster_rest_flattened_error(transport: str = "rest"): def test_import_attached_cluster_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4697,7 +4687,7 @@ def test_import_attached_cluster_rest_error(): ) def test_get_attached_cluster_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4768,7 +4758,7 @@ def test_get_attached_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4777,7 +4767,7 @@ def test_get_attached_cluster_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4786,7 +4776,7 @@ def test_get_attached_cluster_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4828,7 +4818,7 @@ def test_get_attached_cluster_rest_required_fields( def test_get_attached_cluster_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_attached_cluster._get_unset_required_fields({}) @@ -4838,7 +4828,7 @@ def test_get_attached_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_attached_cluster_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -4896,7 +4886,7 @@ def test_get_attached_cluster_rest_bad_request( transport: str = "rest", request_type=attached_service.GetAttachedClusterRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4920,7 +4910,7 @@ def test_get_attached_cluster_rest_bad_request( def test_get_attached_cluster_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4964,7 +4954,7 @@ def test_get_attached_cluster_rest_flattened(): def test_get_attached_cluster_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4979,7 +4969,7 @@ def test_get_attached_cluster_rest_flattened_error(transport: str = "rest"): def test_get_attached_cluster_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4992,7 +4982,7 @@ def test_get_attached_cluster_rest_error(): ) def test_list_attached_clusters_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5043,7 +5033,7 @@ def test_list_attached_clusters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_attached_clusters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5052,7 +5042,7 @@ def test_list_attached_clusters_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_attached_clusters._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5068,7 +5058,7 @@ def test_list_attached_clusters_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5112,7 +5102,7 @@ def test_list_attached_clusters_rest_required_fields( def test_list_attached_clusters_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_attached_clusters._get_unset_required_fields({}) @@ -5130,7 +5120,7 @@ def test_list_attached_clusters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_attached_clusters_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -5190,7 +5180,7 @@ def test_list_attached_clusters_rest_bad_request( transport: str = "rest", request_type=attached_service.ListAttachedClustersRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5212,7 +5202,7 @@ def test_list_attached_clusters_rest_bad_request( def test_list_attached_clusters_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5254,7 +5244,7 @@ def test_list_attached_clusters_rest_flattened(): def test_list_attached_clusters_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5269,7 +5259,7 @@ def test_list_attached_clusters_rest_flattened_error(transport: str = "rest"): def test_list_attached_clusters_rest_pager(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5339,7 +5329,7 @@ def test_list_attached_clusters_rest_pager(transport: str = "rest"): ) def test_delete_attached_cluster_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5387,7 +5377,7 @@ def test_delete_attached_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_attached_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5396,7 +5386,7 @@ def test_delete_attached_cluster_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_attached_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5414,7 +5404,7 @@ def test_delete_attached_cluster_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5453,7 +5443,7 @@ def test_delete_attached_cluster_rest_required_fields( def test_delete_attached_cluster_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_attached_cluster._get_unset_required_fields({}) @@ -5473,7 +5463,7 @@ def test_delete_attached_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_attached_cluster_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -5533,7 +5523,7 @@ def test_delete_attached_cluster_rest_bad_request( transport: str = "rest", request_type=attached_service.DeleteAttachedClusterRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5557,7 +5547,7 @@ def test_delete_attached_cluster_rest_bad_request( def test_delete_attached_cluster_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5599,7 +5589,7 @@ def test_delete_attached_cluster_rest_flattened(): def test_delete_attached_cluster_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5614,7 +5604,7 @@ def test_delete_attached_cluster_rest_flattened_error(transport: str = "rest"): def test_delete_attached_cluster_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5627,7 +5617,7 @@ def test_delete_attached_cluster_rest_error(): ) def test_get_attached_server_config_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5678,7 +5668,7 @@ def test_get_attached_server_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_attached_server_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5687,7 +5677,7 @@ def test_get_attached_server_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_attached_server_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5696,7 +5686,7 @@ def test_get_attached_server_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5738,7 +5728,7 @@ def test_get_attached_server_config_rest_required_fields( def test_get_attached_server_config_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_attached_server_config._get_unset_required_fields({}) @@ -5748,7 +5738,7 @@ def test_get_attached_server_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_attached_server_config_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -5807,7 +5797,7 @@ def test_get_attached_server_config_rest_bad_request( request_type=attached_service.GetAttachedServerConfigRequest, ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5829,7 +5819,7 @@ def test_get_attached_server_config_rest_bad_request( def test_get_attached_server_config_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5873,7 +5863,7 @@ def test_get_attached_server_config_rest_flattened(): def test_get_attached_server_config_rest_flattened_error(transport: str = "rest"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5888,7 +5878,7 @@ def test_get_attached_server_config_rest_flattened_error(transport: str = "rest" def test_get_attached_server_config_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5901,7 +5891,7 @@ def test_get_attached_server_config_rest_error(): ) def test_generate_attached_cluster_install_manifest_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5962,7 +5952,7 @@ def test_generate_attached_cluster_install_manifest_rest_required_fields( assert "platformVersion" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_attached_cluster_install_manifest._get_unset_required_fields( jsonified_request ) @@ -5979,7 +5969,7 @@ def test_generate_attached_cluster_install_manifest_rest_required_fields( jsonified_request["platformVersion"] = "platform_version_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_attached_cluster_install_manifest._get_unset_required_fields( jsonified_request ) @@ -6002,7 +5992,7 @@ def test_generate_attached_cluster_install_manifest_rest_required_fields( assert jsonified_request["platformVersion"] == "platform_version_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6057,7 +6047,7 @@ def test_generate_attached_cluster_install_manifest_rest_required_fields( def test_generate_attached_cluster_install_manifest_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -6086,7 +6076,7 @@ def test_generate_attached_cluster_install_manifest_rest_unset_required_fields() @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_attached_cluster_install_manifest_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -6151,7 +6141,7 @@ def test_generate_attached_cluster_install_manifest_rest_bad_request( request_type=attached_service.GenerateAttachedClusterInstallManifestRequest, ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6173,7 +6163,7 @@ def test_generate_attached_cluster_install_manifest_rest_bad_request( def test_generate_attached_cluster_install_manifest_rest_flattened(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6222,7 +6212,7 @@ def test_generate_attached_cluster_install_manifest_rest_flattened_error( transport: str = "rest", ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6238,7 +6228,7 @@ def test_generate_attached_cluster_install_manifest_rest_flattened_error( def test_generate_attached_cluster_install_manifest_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6251,7 +6241,7 @@ def test_generate_attached_cluster_install_manifest_rest_error(): ) def test_generate_attached_cluster_agent_token_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6315,7 +6305,7 @@ def test_generate_attached_cluster_agent_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_attached_cluster_agent_token._get_unset_required_fields( jsonified_request ) @@ -6329,7 +6319,7 @@ def test_generate_attached_cluster_agent_token_rest_required_fields( jsonified_request["version"] = "version_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_attached_cluster_agent_token._get_unset_required_fields( jsonified_request ) @@ -6346,7 +6336,7 @@ def test_generate_attached_cluster_agent_token_rest_required_fields( assert jsonified_request["version"] == "version_value" client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6393,7 +6383,7 @@ def test_generate_attached_cluster_agent_token_rest_required_fields( def test_generate_attached_cluster_agent_token_rest_unset_required_fields(): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -6415,7 +6405,7 @@ def test_generate_attached_cluster_agent_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_attached_cluster_agent_token_rest_interceptors(null_interceptor): transport = transports.AttachedClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AttachedClustersRestInterceptor(), @@ -6478,7 +6468,7 @@ def test_generate_attached_cluster_agent_token_rest_bad_request( request_type=attached_service.GenerateAttachedClusterAgentTokenRequest, ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6502,24 +6492,24 @@ def test_generate_attached_cluster_agent_token_rest_bad_request( def test_generate_attached_cluster_agent_token_rest_error(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.AttachedClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.AttachedClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AttachedClustersClient( @@ -6529,7 +6519,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.AttachedClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -6544,13 +6534,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = AttachedClustersClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.AttachedClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AttachedClustersClient( @@ -6562,7 +6551,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.AttachedClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = AttachedClustersClient(transport=transport) assert client.transport is transport @@ -6571,13 +6560,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.AttachedClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.AttachedClustersGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -6594,7 +6583,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -6608,7 +6597,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = AttachedClustersClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -6616,7 +6605,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -6628,7 +6617,7 @@ def test_attached_clusters_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.AttachedClustersTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -6640,7 +6629,7 @@ def test_attached_clusters_base_transport(): ) as Transport: Transport.return_value = None transport = transports.AttachedClustersTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -6689,7 +6678,7 @@ def test_attached_clusters_base_transport_with_credentials_file(): "google.cloud.gke_multicloud_v1.services.attached_clusters.transports.AttachedClustersTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AttachedClustersTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -6708,7 +6697,7 @@ def test_attached_clusters_base_transport_with_adc(): "google.cloud.gke_multicloud_v1.services.attached_clusters.transports.AttachedClustersTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AttachedClustersTransport() adc.assert_called_once() @@ -6716,7 +6705,7 @@ def test_attached_clusters_base_transport_with_adc(): def test_attached_clusters_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) AttachedClustersClient() adc.assert_called_once_with( scopes=None, @@ -6736,7 +6725,7 @@ def test_attached_clusters_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -6783,7 +6772,7 @@ def test_attached_clusters_transport_create_channel(transport_class, grpc_helper ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -6811,7 +6800,7 @@ def test_attached_clusters_transport_create_channel(transport_class, grpc_helper ], ) def test_attached_clusters_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -6849,7 +6838,7 @@ def test_attached_clusters_grpc_transport_client_cert_source_for_mtls(transport_ def test_attached_clusters_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -6861,7 +6850,7 @@ def test_attached_clusters_http_transport_client_cert_source_for_mtls(): def test_attached_clusters_rest_lro_client(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -6886,7 +6875,7 @@ def test_attached_clusters_rest_lro_client(): ) def test_attached_clusters_host_no_port(transport_name): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkemulticloud.googleapis.com" ), @@ -6909,7 +6898,7 @@ def test_attached_clusters_host_no_port(transport_name): ) def test_attached_clusters_host_with_port(transport_name): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkemulticloud.googleapis.com:8000" ), @@ -6929,8 +6918,8 @@ def test_attached_clusters_host_with_port(transport_name): ], ) def test_attached_clusters_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = AttachedClustersClient( credentials=creds1, transport=transport_name, @@ -7018,7 +7007,7 @@ def test_attached_clusters_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -7096,7 +7085,7 @@ def test_attached_clusters_transport_channel_mtls_with_adc(transport_class): def test_attached_clusters_grpc_lro_client(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -7113,7 +7102,7 @@ def test_attached_clusters_grpc_lro_client(): def test_attached_clusters_grpc_lro_async_client(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -7289,7 +7278,7 @@ def test_client_with_default_client_info(): transports.AttachedClustersTransport, "_prep_wrapped_messages" ) as prep: client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7299,7 +7288,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = AttachedClustersClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7308,7 +7297,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -7323,7 +7312,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7353,7 +7342,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -7381,7 +7370,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7411,7 +7400,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -7439,7 +7428,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7469,7 +7458,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -7497,7 +7486,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7527,7 +7516,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -7553,7 +7542,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7578,7 +7567,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7602,7 +7591,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7631,7 +7620,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7658,7 +7647,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7676,7 +7665,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7692,7 +7681,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7717,7 +7706,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7741,7 +7730,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7770,7 +7759,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7797,7 +7786,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7815,7 +7804,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7831,7 +7820,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7856,7 +7845,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7882,7 +7871,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7911,7 +7900,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7940,7 +7929,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -7958,7 +7947,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -7976,7 +7965,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8001,7 +7990,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8027,7 +8016,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8056,7 +8045,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8085,7 +8074,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -8103,7 +8092,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = AttachedClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -8127,7 +8116,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -8144,7 +8133,7 @@ def test_client_ctx(): ] for transport in transports: client = AttachedClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_aws_clusters.py b/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_aws_clusters.py index bf28d680ffb2..fc48451f3c4c 100644 --- a/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_aws_clusters.py +++ b/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_aws_clusters.py @@ -94,18 +94,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -313,7 +301,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -340,42 +328,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -386,7 +381,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_aws_clusters_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -438,7 +433,7 @@ def test_aws_clusters_client_service_account_always_use_jwt( ], ) def test_aws_clusters_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -501,9 +496,7 @@ def test_aws_clusters_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(AwsClustersClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -896,20 +889,20 @@ def test_aws_clusters_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -921,13 +914,11 @@ def test_aws_clusters_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -943,8 +934,7 @@ def test_aws_clusters_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1085,8 +1075,8 @@ def test_aws_clusters_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1115,7 +1105,7 @@ def test_aws_clusters_client_create_channel_credentials_file( ) def test_create_aws_cluster(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1144,7 +1134,7 @@ def test_create_aws_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1163,7 +1153,7 @@ async def test_create_aws_cluster_async( transport: str = "grpc_asyncio", request_type=aws_service.CreateAwsClusterRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1197,7 +1187,7 @@ async def test_create_aws_cluster_async_from_dict(): def test_create_aws_cluster_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1229,7 +1219,7 @@ def test_create_aws_cluster_field_headers(): @pytest.mark.asyncio async def test_create_aws_cluster_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1262,7 +1252,7 @@ async def test_create_aws_cluster_field_headers_async(): def test_create_aws_cluster_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1296,7 +1286,7 @@ def test_create_aws_cluster_flattened(): def test_create_aws_cluster_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1313,7 +1303,7 @@ def test_create_aws_cluster_flattened_error(): @pytest.mark.asyncio async def test_create_aws_cluster_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1352,7 +1342,7 @@ async def test_create_aws_cluster_flattened_async(): @pytest.mark.asyncio async def test_create_aws_cluster_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1375,7 +1365,7 @@ async def test_create_aws_cluster_flattened_error_async(): ) def test_update_aws_cluster(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1404,7 +1394,7 @@ def test_update_aws_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1423,7 +1413,7 @@ async def test_update_aws_cluster_async( transport: str = "grpc_asyncio", request_type=aws_service.UpdateAwsClusterRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1457,7 +1447,7 @@ async def test_update_aws_cluster_async_from_dict(): def test_update_aws_cluster_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1489,7 +1479,7 @@ def test_update_aws_cluster_field_headers(): @pytest.mark.asyncio async def test_update_aws_cluster_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1522,7 +1512,7 @@ async def test_update_aws_cluster_field_headers_async(): def test_update_aws_cluster_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1552,7 +1542,7 @@ def test_update_aws_cluster_flattened(): def test_update_aws_cluster_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1568,7 +1558,7 @@ def test_update_aws_cluster_flattened_error(): @pytest.mark.asyncio async def test_update_aws_cluster_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1603,7 +1593,7 @@ async def test_update_aws_cluster_flattened_async(): @pytest.mark.asyncio async def test_update_aws_cluster_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1625,7 +1615,7 @@ async def test_update_aws_cluster_flattened_error_async(): ) def test_get_aws_cluster(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1671,7 +1661,7 @@ def test_get_aws_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1688,7 +1678,7 @@ async def test_get_aws_cluster_async( transport: str = "grpc_asyncio", request_type=aws_service.GetAwsClusterRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1739,7 +1729,7 @@ async def test_get_aws_cluster_async_from_dict(): def test_get_aws_cluster_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1769,7 +1759,7 @@ def test_get_aws_cluster_field_headers(): @pytest.mark.asyncio async def test_get_aws_cluster_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1800,7 +1790,7 @@ async def test_get_aws_cluster_field_headers_async(): def test_get_aws_cluster_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1824,7 +1814,7 @@ def test_get_aws_cluster_flattened(): def test_get_aws_cluster_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1839,7 +1829,7 @@ def test_get_aws_cluster_flattened_error(): @pytest.mark.asyncio async def test_get_aws_cluster_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1868,7 +1858,7 @@ async def test_get_aws_cluster_flattened_async(): @pytest.mark.asyncio async def test_get_aws_cluster_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1889,7 +1879,7 @@ async def test_get_aws_cluster_flattened_error_async(): ) def test_list_aws_clusters(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1921,7 +1911,7 @@ def test_list_aws_clusters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1940,7 +1930,7 @@ async def test_list_aws_clusters_async( transport: str = "grpc_asyncio", request_type=aws_service.ListAwsClustersRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1977,7 +1967,7 @@ async def test_list_aws_clusters_async_from_dict(): def test_list_aws_clusters_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2009,7 +1999,7 @@ def test_list_aws_clusters_field_headers(): @pytest.mark.asyncio async def test_list_aws_clusters_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2042,7 +2032,7 @@ async def test_list_aws_clusters_field_headers_async(): def test_list_aws_clusters_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2068,7 +2058,7 @@ def test_list_aws_clusters_flattened(): def test_list_aws_clusters_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2083,7 +2073,7 @@ def test_list_aws_clusters_flattened_error(): @pytest.mark.asyncio async def test_list_aws_clusters_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2114,7 +2104,7 @@ async def test_list_aws_clusters_flattened_async(): @pytest.mark.asyncio async def test_list_aws_clusters_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2128,7 +2118,7 @@ async def test_list_aws_clusters_flattened_error_async(): def test_list_aws_clusters_pager(transport_name: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2180,7 +2170,7 @@ def test_list_aws_clusters_pager(transport_name: str = "grpc"): def test_list_aws_clusters_pages(transport_name: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2224,7 +2214,7 @@ def test_list_aws_clusters_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_aws_clusters_async_pager(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2276,7 +2266,7 @@ async def test_list_aws_clusters_async_pager(): @pytest.mark.asyncio async def test_list_aws_clusters_async_pages(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2333,7 +2323,7 @@ async def test_list_aws_clusters_async_pages(): ) def test_delete_aws_cluster(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2362,7 +2352,7 @@ def test_delete_aws_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2381,7 +2371,7 @@ async def test_delete_aws_cluster_async( transport: str = "grpc_asyncio", request_type=aws_service.DeleteAwsClusterRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2415,7 +2405,7 @@ async def test_delete_aws_cluster_async_from_dict(): def test_delete_aws_cluster_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2447,7 +2437,7 @@ def test_delete_aws_cluster_field_headers(): @pytest.mark.asyncio async def test_delete_aws_cluster_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2480,7 +2470,7 @@ async def test_delete_aws_cluster_field_headers_async(): def test_delete_aws_cluster_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2506,7 +2496,7 @@ def test_delete_aws_cluster_flattened(): def test_delete_aws_cluster_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2521,7 +2511,7 @@ def test_delete_aws_cluster_flattened_error(): @pytest.mark.asyncio async def test_delete_aws_cluster_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2552,7 +2542,7 @@ async def test_delete_aws_cluster_flattened_async(): @pytest.mark.asyncio async def test_delete_aws_cluster_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2573,7 +2563,7 @@ async def test_delete_aws_cluster_flattened_error_async(): ) def test_generate_aws_cluster_agent_token(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2609,7 +2599,7 @@ def test_generate_aws_cluster_agent_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2629,7 +2619,7 @@ async def test_generate_aws_cluster_agent_token_async( request_type=aws_service.GenerateAwsClusterAgentTokenRequest, ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2670,7 +2660,7 @@ async def test_generate_aws_cluster_agent_token_async_from_dict(): def test_generate_aws_cluster_agent_token_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2702,7 +2692,7 @@ def test_generate_aws_cluster_agent_token_field_headers(): @pytest.mark.asyncio async def test_generate_aws_cluster_agent_token_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2742,7 +2732,7 @@ async def test_generate_aws_cluster_agent_token_field_headers_async(): ) def test_generate_aws_access_token(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2774,7 +2764,7 @@ def test_generate_aws_access_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2794,7 +2784,7 @@ async def test_generate_aws_access_token_async( request_type=aws_service.GenerateAwsAccessTokenRequest, ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2831,7 +2821,7 @@ async def test_generate_aws_access_token_async_from_dict(): def test_generate_aws_access_token_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2863,7 +2853,7 @@ def test_generate_aws_access_token_field_headers(): @pytest.mark.asyncio async def test_generate_aws_access_token_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2903,7 +2893,7 @@ async def test_generate_aws_access_token_field_headers_async(): ) def test_create_aws_node_pool(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2932,7 +2922,7 @@ def test_create_aws_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2951,7 +2941,7 @@ async def test_create_aws_node_pool_async( transport: str = "grpc_asyncio", request_type=aws_service.CreateAwsNodePoolRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2985,7 +2975,7 @@ async def test_create_aws_node_pool_async_from_dict(): def test_create_aws_node_pool_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3017,7 +3007,7 @@ def test_create_aws_node_pool_field_headers(): @pytest.mark.asyncio async def test_create_aws_node_pool_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3050,7 +3040,7 @@ async def test_create_aws_node_pool_field_headers_async(): def test_create_aws_node_pool_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3084,7 +3074,7 @@ def test_create_aws_node_pool_flattened(): def test_create_aws_node_pool_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3101,7 +3091,7 @@ def test_create_aws_node_pool_flattened_error(): @pytest.mark.asyncio async def test_create_aws_node_pool_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3140,7 +3130,7 @@ async def test_create_aws_node_pool_flattened_async(): @pytest.mark.asyncio async def test_create_aws_node_pool_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3163,7 +3153,7 @@ async def test_create_aws_node_pool_flattened_error_async(): ) def test_update_aws_node_pool(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3192,7 +3182,7 @@ def test_update_aws_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3211,7 +3201,7 @@ async def test_update_aws_node_pool_async( transport: str = "grpc_asyncio", request_type=aws_service.UpdateAwsNodePoolRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3245,7 +3235,7 @@ async def test_update_aws_node_pool_async_from_dict(): def test_update_aws_node_pool_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3277,7 +3267,7 @@ def test_update_aws_node_pool_field_headers(): @pytest.mark.asyncio async def test_update_aws_node_pool_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3310,7 +3300,7 @@ async def test_update_aws_node_pool_field_headers_async(): def test_update_aws_node_pool_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3340,7 +3330,7 @@ def test_update_aws_node_pool_flattened(): def test_update_aws_node_pool_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3356,7 +3346,7 @@ def test_update_aws_node_pool_flattened_error(): @pytest.mark.asyncio async def test_update_aws_node_pool_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3391,7 +3381,7 @@ async def test_update_aws_node_pool_flattened_async(): @pytest.mark.asyncio async def test_update_aws_node_pool_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3413,7 +3403,7 @@ async def test_update_aws_node_pool_flattened_error_async(): ) def test_rollback_aws_node_pool_update(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3442,7 +3432,7 @@ def test_rollback_aws_node_pool_update_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3462,7 +3452,7 @@ async def test_rollback_aws_node_pool_update_async( request_type=aws_service.RollbackAwsNodePoolUpdateRequest, ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3496,7 +3486,7 @@ async def test_rollback_aws_node_pool_update_async_from_dict(): def test_rollback_aws_node_pool_update_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3528,7 +3518,7 @@ def test_rollback_aws_node_pool_update_field_headers(): @pytest.mark.asyncio async def test_rollback_aws_node_pool_update_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3561,7 +3551,7 @@ async def test_rollback_aws_node_pool_update_field_headers_async(): def test_rollback_aws_node_pool_update_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3587,7 +3577,7 @@ def test_rollback_aws_node_pool_update_flattened(): def test_rollback_aws_node_pool_update_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3602,7 +3592,7 @@ def test_rollback_aws_node_pool_update_flattened_error(): @pytest.mark.asyncio async def test_rollback_aws_node_pool_update_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3633,7 +3623,7 @@ async def test_rollback_aws_node_pool_update_flattened_async(): @pytest.mark.asyncio async def test_rollback_aws_node_pool_update_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3654,7 +3644,7 @@ async def test_rollback_aws_node_pool_update_flattened_error_async(): ) def test_get_aws_node_pool(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3698,7 +3688,7 @@ def test_get_aws_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3717,7 +3707,7 @@ async def test_get_aws_node_pool_async( transport: str = "grpc_asyncio", request_type=aws_service.GetAwsNodePoolRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3766,7 +3756,7 @@ async def test_get_aws_node_pool_async_from_dict(): def test_get_aws_node_pool_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3798,7 +3788,7 @@ def test_get_aws_node_pool_field_headers(): @pytest.mark.asyncio async def test_get_aws_node_pool_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3831,7 +3821,7 @@ async def test_get_aws_node_pool_field_headers_async(): def test_get_aws_node_pool_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3857,7 +3847,7 @@ def test_get_aws_node_pool_flattened(): def test_get_aws_node_pool_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3872,7 +3862,7 @@ def test_get_aws_node_pool_flattened_error(): @pytest.mark.asyncio async def test_get_aws_node_pool_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3903,7 +3893,7 @@ async def test_get_aws_node_pool_flattened_async(): @pytest.mark.asyncio async def test_get_aws_node_pool_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3924,7 +3914,7 @@ async def test_get_aws_node_pool_flattened_error_async(): ) def test_list_aws_node_pools(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3956,7 +3946,7 @@ def test_list_aws_node_pools_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3975,7 +3965,7 @@ async def test_list_aws_node_pools_async( transport: str = "grpc_asyncio", request_type=aws_service.ListAwsNodePoolsRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4012,7 +4002,7 @@ async def test_list_aws_node_pools_async_from_dict(): def test_list_aws_node_pools_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4044,7 +4034,7 @@ def test_list_aws_node_pools_field_headers(): @pytest.mark.asyncio async def test_list_aws_node_pools_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4077,7 +4067,7 @@ async def test_list_aws_node_pools_field_headers_async(): def test_list_aws_node_pools_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4103,7 +4093,7 @@ def test_list_aws_node_pools_flattened(): def test_list_aws_node_pools_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4118,7 +4108,7 @@ def test_list_aws_node_pools_flattened_error(): @pytest.mark.asyncio async def test_list_aws_node_pools_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4149,7 +4139,7 @@ async def test_list_aws_node_pools_flattened_async(): @pytest.mark.asyncio async def test_list_aws_node_pools_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4163,7 +4153,7 @@ async def test_list_aws_node_pools_flattened_error_async(): def test_list_aws_node_pools_pager(transport_name: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -4215,7 +4205,7 @@ def test_list_aws_node_pools_pager(transport_name: str = "grpc"): def test_list_aws_node_pools_pages(transport_name: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -4259,7 +4249,7 @@ def test_list_aws_node_pools_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_aws_node_pools_async_pager(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4311,7 +4301,7 @@ async def test_list_aws_node_pools_async_pager(): @pytest.mark.asyncio async def test_list_aws_node_pools_async_pages(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4368,7 +4358,7 @@ async def test_list_aws_node_pools_async_pages(): ) def test_delete_aws_node_pool(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4397,7 +4387,7 @@ def test_delete_aws_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4416,7 +4406,7 @@ async def test_delete_aws_node_pool_async( transport: str = "grpc_asyncio", request_type=aws_service.DeleteAwsNodePoolRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4450,7 +4440,7 @@ async def test_delete_aws_node_pool_async_from_dict(): def test_delete_aws_node_pool_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4482,7 +4472,7 @@ def test_delete_aws_node_pool_field_headers(): @pytest.mark.asyncio async def test_delete_aws_node_pool_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4515,7 +4505,7 @@ async def test_delete_aws_node_pool_field_headers_async(): def test_delete_aws_node_pool_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4541,7 +4531,7 @@ def test_delete_aws_node_pool_flattened(): def test_delete_aws_node_pool_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4556,7 +4546,7 @@ def test_delete_aws_node_pool_flattened_error(): @pytest.mark.asyncio async def test_delete_aws_node_pool_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4587,7 +4577,7 @@ async def test_delete_aws_node_pool_flattened_async(): @pytest.mark.asyncio async def test_delete_aws_node_pool_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4608,7 +4598,7 @@ async def test_delete_aws_node_pool_flattened_error_async(): ) def test_get_aws_open_id_config(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4656,7 +4646,7 @@ def test_get_aws_open_id_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4675,7 +4665,7 @@ async def test_get_aws_open_id_config_async( transport: str = "grpc_asyncio", request_type=aws_service.GetAwsOpenIdConfigRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4728,7 +4718,7 @@ async def test_get_aws_open_id_config_async_from_dict(): def test_get_aws_open_id_config_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4760,7 +4750,7 @@ def test_get_aws_open_id_config_field_headers(): @pytest.mark.asyncio async def test_get_aws_open_id_config_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4800,7 +4790,7 @@ async def test_get_aws_open_id_config_field_headers_async(): ) def test_get_aws_json_web_keys(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4829,7 +4819,7 @@ def test_get_aws_json_web_keys_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4848,7 +4838,7 @@ async def test_get_aws_json_web_keys_async( transport: str = "grpc_asyncio", request_type=aws_service.GetAwsJsonWebKeysRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4882,7 +4872,7 @@ async def test_get_aws_json_web_keys_async_from_dict(): def test_get_aws_json_web_keys_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4914,7 +4904,7 @@ def test_get_aws_json_web_keys_field_headers(): @pytest.mark.asyncio async def test_get_aws_json_web_keys_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4954,7 +4944,7 @@ async def test_get_aws_json_web_keys_field_headers_async(): ) def test_get_aws_server_config(request_type, transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4988,7 +4978,7 @@ def test_get_aws_server_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5007,7 +4997,7 @@ async def test_get_aws_server_config_async( transport: str = "grpc_asyncio", request_type=aws_service.GetAwsServerConfigRequest ): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5046,7 +5036,7 @@ async def test_get_aws_server_config_async_from_dict(): def test_get_aws_server_config_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5078,7 +5068,7 @@ def test_get_aws_server_config_field_headers(): @pytest.mark.asyncio async def test_get_aws_server_config_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5111,7 +5101,7 @@ async def test_get_aws_server_config_field_headers_async(): def test_get_aws_server_config_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5137,7 +5127,7 @@ def test_get_aws_server_config_flattened(): def test_get_aws_server_config_flattened_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5152,7 +5142,7 @@ def test_get_aws_server_config_flattened_error(): @pytest.mark.asyncio async def test_get_aws_server_config_flattened_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5183,7 +5173,7 @@ async def test_get_aws_server_config_flattened_async(): @pytest.mark.asyncio async def test_get_aws_server_config_flattened_error_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5204,7 +5194,7 @@ async def test_get_aws_server_config_flattened_error_async(): ) def test_create_aws_cluster_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5390,7 +5380,7 @@ def test_create_aws_cluster_rest_required_fields( assert "awsClusterId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_aws_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5402,7 +5392,7 @@ def test_create_aws_cluster_rest_required_fields( jsonified_request["awsClusterId"] = "aws_cluster_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_aws_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5420,7 +5410,7 @@ def test_create_aws_cluster_rest_required_fields( assert jsonified_request["awsClusterId"] == "aws_cluster_id_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5465,7 +5455,7 @@ def test_create_aws_cluster_rest_required_fields( def test_create_aws_cluster_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_aws_cluster._get_unset_required_fields({}) @@ -5489,7 +5479,7 @@ def test_create_aws_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_aws_cluster_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -5549,7 +5539,7 @@ def test_create_aws_cluster_rest_bad_request( transport: str = "rest", request_type=aws_service.CreateAwsClusterRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5571,7 +5561,7 @@ def test_create_aws_cluster_rest_bad_request( def test_create_aws_cluster_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5613,7 +5603,7 @@ def test_create_aws_cluster_rest_flattened(): def test_create_aws_cluster_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5630,7 +5620,7 @@ def test_create_aws_cluster_rest_flattened_error(transport: str = "rest"): def test_create_aws_cluster_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5643,7 +5633,7 @@ def test_create_aws_cluster_rest_error(): ) def test_update_aws_cluster_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5830,14 +5820,14 @@ def test_update_aws_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_aws_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_aws_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5851,7 +5841,7 @@ def test_update_aws_cluster_rest_required_fields( # verify required fields with non-default values are left alone client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5891,7 +5881,7 @@ def test_update_aws_cluster_rest_required_fields( def test_update_aws_cluster_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_aws_cluster._get_unset_required_fields({}) @@ -5914,7 +5904,7 @@ def test_update_aws_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_aws_cluster_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -5974,7 +5964,7 @@ def test_update_aws_cluster_rest_bad_request( transport: str = "rest", request_type=aws_service.UpdateAwsClusterRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6000,7 +5990,7 @@ def test_update_aws_cluster_rest_bad_request( def test_update_aws_cluster_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6045,7 +6035,7 @@ def test_update_aws_cluster_rest_flattened(): def test_update_aws_cluster_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6061,7 +6051,7 @@ def test_update_aws_cluster_rest_flattened_error(transport: str = "rest"): def test_update_aws_cluster_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6074,7 +6064,7 @@ def test_update_aws_cluster_rest_error(): ) def test_get_aws_cluster_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6141,7 +6131,7 @@ def test_get_aws_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6150,7 +6140,7 @@ def test_get_aws_cluster_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6159,7 +6149,7 @@ def test_get_aws_cluster_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6201,7 +6191,7 @@ def test_get_aws_cluster_rest_required_fields( def test_get_aws_cluster_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_aws_cluster._get_unset_required_fields({}) @@ -6211,7 +6201,7 @@ def test_get_aws_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_aws_cluster_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -6269,7 +6259,7 @@ def test_get_aws_cluster_rest_bad_request( transport: str = "rest", request_type=aws_service.GetAwsClusterRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6291,7 +6281,7 @@ def test_get_aws_cluster_rest_bad_request( def test_get_aws_cluster_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6335,7 +6325,7 @@ def test_get_aws_cluster_rest_flattened(): def test_get_aws_cluster_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6350,7 +6340,7 @@ def test_get_aws_cluster_rest_flattened_error(transport: str = "rest"): def test_get_aws_cluster_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6363,7 +6353,7 @@ def test_get_aws_cluster_rest_error(): ) def test_list_aws_clusters_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6414,7 +6404,7 @@ def test_list_aws_clusters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_aws_clusters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6423,7 +6413,7 @@ def test_list_aws_clusters_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_aws_clusters._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -6439,7 +6429,7 @@ def test_list_aws_clusters_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6481,7 +6471,7 @@ def test_list_aws_clusters_rest_required_fields( def test_list_aws_clusters_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_aws_clusters._get_unset_required_fields({}) @@ -6499,7 +6489,7 @@ def test_list_aws_clusters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_aws_clusters_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -6557,7 +6547,7 @@ def test_list_aws_clusters_rest_bad_request( transport: str = "rest", request_type=aws_service.ListAwsClustersRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6579,7 +6569,7 @@ def test_list_aws_clusters_rest_bad_request( def test_list_aws_clusters_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6621,7 +6611,7 @@ def test_list_aws_clusters_rest_flattened(): def test_list_aws_clusters_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6636,7 +6626,7 @@ def test_list_aws_clusters_rest_flattened_error(transport: str = "rest"): def test_list_aws_clusters_rest_pager(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6706,7 +6696,7 @@ def test_list_aws_clusters_rest_pager(transport: str = "rest"): ) def test_delete_aws_cluster_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6752,7 +6742,7 @@ def test_delete_aws_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_aws_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6761,7 +6751,7 @@ def test_delete_aws_cluster_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_aws_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -6779,7 +6769,7 @@ def test_delete_aws_cluster_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6818,7 +6808,7 @@ def test_delete_aws_cluster_rest_required_fields( def test_delete_aws_cluster_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_aws_cluster._get_unset_required_fields({}) @@ -6838,7 +6828,7 @@ def test_delete_aws_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_aws_cluster_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -6898,7 +6888,7 @@ def test_delete_aws_cluster_rest_bad_request( transport: str = "rest", request_type=aws_service.DeleteAwsClusterRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6920,7 +6910,7 @@ def test_delete_aws_cluster_rest_bad_request( def test_delete_aws_cluster_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6962,7 +6952,7 @@ def test_delete_aws_cluster_rest_flattened(): def test_delete_aws_cluster_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6977,7 +6967,7 @@ def test_delete_aws_cluster_rest_flattened_error(transport: str = "rest"): def test_delete_aws_cluster_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6990,7 +6980,7 @@ def test_delete_aws_cluster_rest_error(): ) def test_generate_aws_cluster_agent_token_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7050,7 +7040,7 @@ def test_generate_aws_cluster_agent_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_aws_cluster_agent_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7062,7 +7052,7 @@ def test_generate_aws_cluster_agent_token_rest_required_fields( jsonified_request["version"] = "version_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_aws_cluster_agent_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7077,7 +7067,7 @@ def test_generate_aws_cluster_agent_token_rest_required_fields( assert jsonified_request["version"] == "version_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7122,7 +7112,7 @@ def test_generate_aws_cluster_agent_token_rest_required_fields( def test_generate_aws_cluster_agent_token_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -7144,7 +7134,7 @@ def test_generate_aws_cluster_agent_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_aws_cluster_agent_token_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -7205,7 +7195,7 @@ def test_generate_aws_cluster_agent_token_rest_bad_request( request_type=aws_service.GenerateAwsClusterAgentTokenRequest, ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7229,7 +7219,7 @@ def test_generate_aws_cluster_agent_token_rest_bad_request( def test_generate_aws_cluster_agent_token_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -7242,7 +7232,7 @@ def test_generate_aws_cluster_agent_token_rest_error(): ) def test_generate_aws_access_token_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7295,7 +7285,7 @@ def test_generate_aws_access_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_aws_access_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7304,7 +7294,7 @@ def test_generate_aws_access_token_rest_required_fields( jsonified_request["awsCluster"] = "aws_cluster_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_aws_access_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7313,7 +7303,7 @@ def test_generate_aws_access_token_rest_required_fields( assert jsonified_request["awsCluster"] == "aws_cluster_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7355,7 +7345,7 @@ def test_generate_aws_access_token_rest_required_fields( def test_generate_aws_access_token_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.generate_aws_access_token._get_unset_required_fields({}) @@ -7365,7 +7355,7 @@ def test_generate_aws_access_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_aws_access_token_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -7423,7 +7413,7 @@ def test_generate_aws_access_token_rest_bad_request( transport: str = "rest", request_type=aws_service.GenerateAwsAccessTokenRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7447,7 +7437,7 @@ def test_generate_aws_access_token_rest_bad_request( def test_generate_aws_access_token_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -7460,7 +7450,7 @@ def test_generate_aws_access_token_rest_error(): ) def test_create_aws_node_pool_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7627,7 +7617,7 @@ def test_create_aws_node_pool_rest_required_fields( assert "awsNodePoolId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_aws_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7639,7 +7629,7 @@ def test_create_aws_node_pool_rest_required_fields( jsonified_request["awsNodePoolId"] = "aws_node_pool_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_aws_node_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -7657,7 +7647,7 @@ def test_create_aws_node_pool_rest_required_fields( assert jsonified_request["awsNodePoolId"] == "aws_node_pool_id_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7702,7 +7692,7 @@ def test_create_aws_node_pool_rest_required_fields( def test_create_aws_node_pool_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_aws_node_pool._get_unset_required_fields({}) @@ -7726,7 +7716,7 @@ def test_create_aws_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_aws_node_pool_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -7786,7 +7776,7 @@ def test_create_aws_node_pool_rest_bad_request( transport: str = "rest", request_type=aws_service.CreateAwsNodePoolRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7808,7 +7798,7 @@ def test_create_aws_node_pool_rest_bad_request( def test_create_aws_node_pool_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7852,7 +7842,7 @@ def test_create_aws_node_pool_rest_flattened(): def test_create_aws_node_pool_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7869,7 +7859,7 @@ def test_create_aws_node_pool_rest_flattened_error(transport: str = "rest"): def test_create_aws_node_pool_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -7882,7 +7872,7 @@ def test_create_aws_node_pool_rest_error(): ) def test_update_aws_node_pool_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8050,14 +8040,14 @@ def test_update_aws_node_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_aws_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_aws_node_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -8071,7 +8061,7 @@ def test_update_aws_node_pool_rest_required_fields( # verify required fields with non-default values are left alone client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8111,7 +8101,7 @@ def test_update_aws_node_pool_rest_required_fields( def test_update_aws_node_pool_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_aws_node_pool._get_unset_required_fields({}) @@ -8134,7 +8124,7 @@ def test_update_aws_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_aws_node_pool_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -8194,7 +8184,7 @@ def test_update_aws_node_pool_rest_bad_request( transport: str = "rest", request_type=aws_service.UpdateAwsNodePoolRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8220,7 +8210,7 @@ def test_update_aws_node_pool_rest_bad_request( def test_update_aws_node_pool_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8265,7 +8255,7 @@ def test_update_aws_node_pool_rest_flattened(): def test_update_aws_node_pool_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8281,7 +8271,7 @@ def test_update_aws_node_pool_rest_flattened_error(transport: str = "rest"): def test_update_aws_node_pool_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -8294,7 +8284,7 @@ def test_update_aws_node_pool_rest_error(): ) def test_rollback_aws_node_pool_update_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8342,7 +8332,7 @@ def test_rollback_aws_node_pool_update_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).rollback_aws_node_pool_update._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8351,7 +8341,7 @@ def test_rollback_aws_node_pool_update_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).rollback_aws_node_pool_update._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8360,7 +8350,7 @@ def test_rollback_aws_node_pool_update_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8400,7 +8390,7 @@ def test_rollback_aws_node_pool_update_rest_required_fields( def test_rollback_aws_node_pool_update_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.rollback_aws_node_pool_update._get_unset_required_fields( @@ -8412,7 +8402,7 @@ def test_rollback_aws_node_pool_update_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_rollback_aws_node_pool_update_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -8472,7 +8462,7 @@ def test_rollback_aws_node_pool_update_rest_bad_request( transport: str = "rest", request_type=aws_service.RollbackAwsNodePoolUpdateRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8496,7 +8486,7 @@ def test_rollback_aws_node_pool_update_rest_bad_request( def test_rollback_aws_node_pool_update_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8538,7 +8528,7 @@ def test_rollback_aws_node_pool_update_rest_flattened(): def test_rollback_aws_node_pool_update_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8553,7 +8543,7 @@ def test_rollback_aws_node_pool_update_rest_flattened_error(transport: str = "re def test_rollback_aws_node_pool_update_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -8566,7 +8556,7 @@ def test_rollback_aws_node_pool_update_rest_error(): ) def test_get_aws_node_pool_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8631,7 +8621,7 @@ def test_get_aws_node_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8640,7 +8630,7 @@ def test_get_aws_node_pool_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8649,7 +8639,7 @@ def test_get_aws_node_pool_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8691,7 +8681,7 @@ def test_get_aws_node_pool_rest_required_fields( def test_get_aws_node_pool_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_aws_node_pool._get_unset_required_fields({}) @@ -8701,7 +8691,7 @@ def test_get_aws_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_aws_node_pool_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -8759,7 +8749,7 @@ def test_get_aws_node_pool_rest_bad_request( transport: str = "rest", request_type=aws_service.GetAwsNodePoolRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8783,7 +8773,7 @@ def test_get_aws_node_pool_rest_bad_request( def test_get_aws_node_pool_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8827,7 +8817,7 @@ def test_get_aws_node_pool_rest_flattened(): def test_get_aws_node_pool_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8842,7 +8832,7 @@ def test_get_aws_node_pool_rest_flattened_error(transport: str = "rest"): def test_get_aws_node_pool_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -8855,7 +8845,7 @@ def test_get_aws_node_pool_rest_error(): ) def test_list_aws_node_pools_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8906,7 +8896,7 @@ def test_list_aws_node_pools_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_aws_node_pools._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8915,7 +8905,7 @@ def test_list_aws_node_pools_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_aws_node_pools._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -8931,7 +8921,7 @@ def test_list_aws_node_pools_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8973,7 +8963,7 @@ def test_list_aws_node_pools_rest_required_fields( def test_list_aws_node_pools_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_aws_node_pools._get_unset_required_fields({}) @@ -8991,7 +8981,7 @@ def test_list_aws_node_pools_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_aws_node_pools_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -9049,7 +9039,7 @@ def test_list_aws_node_pools_rest_bad_request( transport: str = "rest", request_type=aws_service.ListAwsNodePoolsRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9071,7 +9061,7 @@ def test_list_aws_node_pools_rest_bad_request( def test_list_aws_node_pools_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9115,7 +9105,7 @@ def test_list_aws_node_pools_rest_flattened(): def test_list_aws_node_pools_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9130,7 +9120,7 @@ def test_list_aws_node_pools_rest_flattened_error(transport: str = "rest"): def test_list_aws_node_pools_rest_pager(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9202,7 +9192,7 @@ def test_list_aws_node_pools_rest_pager(transport: str = "rest"): ) def test_delete_aws_node_pool_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9250,7 +9240,7 @@ def test_delete_aws_node_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_aws_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9259,7 +9249,7 @@ def test_delete_aws_node_pool_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_aws_node_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -9277,7 +9267,7 @@ def test_delete_aws_node_pool_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9316,7 +9306,7 @@ def test_delete_aws_node_pool_rest_required_fields( def test_delete_aws_node_pool_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_aws_node_pool._get_unset_required_fields({}) @@ -9336,7 +9326,7 @@ def test_delete_aws_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_aws_node_pool_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -9396,7 +9386,7 @@ def test_delete_aws_node_pool_rest_bad_request( transport: str = "rest", request_type=aws_service.DeleteAwsNodePoolRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9420,7 +9410,7 @@ def test_delete_aws_node_pool_rest_bad_request( def test_delete_aws_node_pool_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9462,7 +9452,7 @@ def test_delete_aws_node_pool_rest_flattened(): def test_delete_aws_node_pool_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9477,7 +9467,7 @@ def test_delete_aws_node_pool_rest_flattened_error(transport: str = "rest"): def test_delete_aws_node_pool_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -9490,7 +9480,7 @@ def test_delete_aws_node_pool_rest_error(): ) def test_get_aws_open_id_config_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9559,7 +9549,7 @@ def test_get_aws_open_id_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_open_id_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9568,7 +9558,7 @@ def test_get_aws_open_id_config_rest_required_fields( jsonified_request["awsCluster"] = "aws_cluster_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_open_id_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9577,7 +9567,7 @@ def test_get_aws_open_id_config_rest_required_fields( assert jsonified_request["awsCluster"] == "aws_cluster_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9619,7 +9609,7 @@ def test_get_aws_open_id_config_rest_required_fields( def test_get_aws_open_id_config_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_aws_open_id_config._get_unset_required_fields({}) @@ -9629,7 +9619,7 @@ def test_get_aws_open_id_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_aws_open_id_config_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -9687,7 +9677,7 @@ def test_get_aws_open_id_config_rest_bad_request( transport: str = "rest", request_type=aws_service.GetAwsOpenIdConfigRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9711,7 +9701,7 @@ def test_get_aws_open_id_config_rest_bad_request( def test_get_aws_open_id_config_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -9724,7 +9714,7 @@ def test_get_aws_open_id_config_rest_error(): ) def test_get_aws_json_web_keys_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9774,7 +9764,7 @@ def test_get_aws_json_web_keys_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_json_web_keys._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9783,7 +9773,7 @@ def test_get_aws_json_web_keys_rest_required_fields( jsonified_request["awsCluster"] = "aws_cluster_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_json_web_keys._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9792,7 +9782,7 @@ def test_get_aws_json_web_keys_rest_required_fields( assert jsonified_request["awsCluster"] == "aws_cluster_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9834,7 +9824,7 @@ def test_get_aws_json_web_keys_rest_required_fields( def test_get_aws_json_web_keys_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_aws_json_web_keys._get_unset_required_fields({}) @@ -9844,7 +9834,7 @@ def test_get_aws_json_web_keys_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_aws_json_web_keys_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -9902,7 +9892,7 @@ def test_get_aws_json_web_keys_rest_bad_request( transport: str = "rest", request_type=aws_service.GetAwsJsonWebKeysRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9926,7 +9916,7 @@ def test_get_aws_json_web_keys_rest_bad_request( def test_get_aws_json_web_keys_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -9939,7 +9929,7 @@ def test_get_aws_json_web_keys_rest_error(): ) def test_get_aws_server_config_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9992,7 +9982,7 @@ def test_get_aws_server_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_server_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10001,7 +9991,7 @@ def test_get_aws_server_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_aws_server_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10010,7 +10000,7 @@ def test_get_aws_server_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10052,7 +10042,7 @@ def test_get_aws_server_config_rest_required_fields( def test_get_aws_server_config_rest_unset_required_fields(): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_aws_server_config._get_unset_required_fields({}) @@ -10062,7 +10052,7 @@ def test_get_aws_server_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_aws_server_config_rest_interceptors(null_interceptor): transport = transports.AwsClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AwsClustersRestInterceptor(), @@ -10120,7 +10110,7 @@ def test_get_aws_server_config_rest_bad_request( transport: str = "rest", request_type=aws_service.GetAwsServerConfigRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10142,7 +10132,7 @@ def test_get_aws_server_config_rest_bad_request( def test_get_aws_server_config_rest_flattened(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10184,7 +10174,7 @@ def test_get_aws_server_config_rest_flattened(): def test_get_aws_server_config_rest_flattened_error(transport: str = "rest"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10199,24 +10189,24 @@ def test_get_aws_server_config_rest_flattened_error(transport: str = "rest"): def test_get_aws_server_config_rest_error(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.AwsClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.AwsClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AwsClustersClient( @@ -10226,7 +10216,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.AwsClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -10241,13 +10231,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = AwsClustersClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.AwsClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AwsClustersClient( @@ -10259,7 +10248,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.AwsClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = AwsClustersClient(transport=transport) assert client.transport is transport @@ -10268,13 +10257,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.AwsClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.AwsClustersGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -10291,7 +10280,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -10305,7 +10294,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = AwsClustersClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -10313,7 +10302,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -10325,7 +10314,7 @@ def test_aws_clusters_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.AwsClustersTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -10337,7 +10326,7 @@ def test_aws_clusters_base_transport(): ) as Transport: Transport.return_value = None transport = transports.AwsClustersTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -10393,7 +10382,7 @@ def test_aws_clusters_base_transport_with_credentials_file(): "google.cloud.gke_multicloud_v1.services.aws_clusters.transports.AwsClustersTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AwsClustersTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -10412,7 +10401,7 @@ def test_aws_clusters_base_transport_with_adc(): "google.cloud.gke_multicloud_v1.services.aws_clusters.transports.AwsClustersTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AwsClustersTransport() adc.assert_called_once() @@ -10420,7 +10409,7 @@ def test_aws_clusters_base_transport_with_adc(): def test_aws_clusters_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) AwsClustersClient() adc.assert_called_once_with( scopes=None, @@ -10440,7 +10429,7 @@ def test_aws_clusters_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -10487,7 +10476,7 @@ def test_aws_clusters_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -10512,7 +10501,7 @@ def test_aws_clusters_transport_create_channel(transport_class, grpc_helpers): [transports.AwsClustersGrpcTransport, transports.AwsClustersGrpcAsyncIOTransport], ) def test_aws_clusters_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -10550,7 +10539,7 @@ def test_aws_clusters_grpc_transport_client_cert_source_for_mtls(transport_class def test_aws_clusters_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -10562,7 +10551,7 @@ def test_aws_clusters_http_transport_client_cert_source_for_mtls(): def test_aws_clusters_rest_lro_client(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -10587,7 +10576,7 @@ def test_aws_clusters_rest_lro_client(): ) def test_aws_clusters_host_no_port(transport_name): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkemulticloud.googleapis.com" ), @@ -10610,7 +10599,7 @@ def test_aws_clusters_host_no_port(transport_name): ) def test_aws_clusters_host_with_port(transport_name): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkemulticloud.googleapis.com:8000" ), @@ -10630,8 +10619,8 @@ def test_aws_clusters_host_with_port(transport_name): ], ) def test_aws_clusters_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = AwsClustersClient( credentials=creds1, transport=transport_name, @@ -10735,7 +10724,7 @@ def test_aws_clusters_transport_channel_mtls_with_client_cert_source(transport_c mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -10810,7 +10799,7 @@ def test_aws_clusters_transport_channel_mtls_with_adc(transport_class): def test_aws_clusters_grpc_lro_client(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -10827,7 +10816,7 @@ def test_aws_clusters_grpc_lro_client(): def test_aws_clusters_grpc_lro_async_client(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -11034,7 +11023,7 @@ def test_client_with_default_client_info(): transports.AwsClustersTransport, "_prep_wrapped_messages" ) as prep: client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -11044,7 +11033,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = AwsClustersClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -11053,7 +11042,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -11068,7 +11057,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11098,7 +11087,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -11126,7 +11115,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11156,7 +11145,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -11184,7 +11173,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11214,7 +11203,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -11242,7 +11231,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11272,7 +11261,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -11298,7 +11287,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11323,7 +11312,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11347,7 +11336,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11376,7 +11365,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11403,7 +11392,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -11421,7 +11410,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -11437,7 +11426,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11462,7 +11451,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11486,7 +11475,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11515,7 +11504,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11542,7 +11531,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -11560,7 +11549,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -11576,7 +11565,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11601,7 +11590,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11627,7 +11616,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11656,7 +11645,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11685,7 +11674,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -11703,7 +11692,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -11721,7 +11710,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11746,7 +11735,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11772,7 +11761,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11801,7 +11790,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11830,7 +11819,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -11848,7 +11837,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = AwsClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -11872,7 +11861,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -11889,7 +11878,7 @@ def test_client_ctx(): ] for transport in transports: client = AwsClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_azure_clusters.py b/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_azure_clusters.py index f356b4c56585..3970244d0c45 100644 --- a/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_azure_clusters.py +++ b/packages/google-cloud-gke-multicloud/tests/unit/gapic/gke_multicloud_v1/test_azure_clusters.py @@ -94,18 +94,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -328,7 +316,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -355,42 +343,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -401,7 +396,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_azure_clusters_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -453,7 +448,7 @@ def test_azure_clusters_client_service_account_always_use_jwt( ], ) def test_azure_clusters_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -516,9 +511,7 @@ def test_azure_clusters_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(AzureClustersClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -917,20 +910,20 @@ def test_azure_clusters_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -942,13 +935,11 @@ def test_azure_clusters_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -964,8 +955,7 @@ def test_azure_clusters_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1118,8 +1108,8 @@ def test_azure_clusters_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1148,7 +1138,7 @@ def test_azure_clusters_client_create_channel_credentials_file( ) def test_create_azure_client(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1177,7 +1167,7 @@ def test_create_azure_client_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1196,7 +1186,7 @@ async def test_create_azure_client_async( transport: str = "grpc_asyncio", request_type=azure_service.CreateAzureClientRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1230,7 +1220,7 @@ async def test_create_azure_client_async_from_dict(): def test_create_azure_client_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1262,7 +1252,7 @@ def test_create_azure_client_field_headers(): @pytest.mark.asyncio async def test_create_azure_client_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1295,7 +1285,7 @@ async def test_create_azure_client_field_headers_async(): def test_create_azure_client_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1329,7 +1319,7 @@ def test_create_azure_client_flattened(): def test_create_azure_client_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1346,7 +1336,7 @@ def test_create_azure_client_flattened_error(): @pytest.mark.asyncio async def test_create_azure_client_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1385,7 +1375,7 @@ async def test_create_azure_client_flattened_async(): @pytest.mark.asyncio async def test_create_azure_client_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1408,7 +1398,7 @@ async def test_create_azure_client_flattened_error_async(): ) def test_get_azure_client(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1448,7 +1438,7 @@ def test_get_azure_client_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1465,7 +1455,7 @@ async def test_get_azure_client_async( transport: str = "grpc_asyncio", request_type=azure_service.GetAzureClientRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1510,7 +1500,7 @@ async def test_get_azure_client_async_from_dict(): def test_get_azure_client_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1540,7 +1530,7 @@ def test_get_azure_client_field_headers(): @pytest.mark.asyncio async def test_get_azure_client_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1571,7 +1561,7 @@ async def test_get_azure_client_field_headers_async(): def test_get_azure_client_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1595,7 +1585,7 @@ def test_get_azure_client_flattened(): def test_get_azure_client_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1610,7 +1600,7 @@ def test_get_azure_client_flattened_error(): @pytest.mark.asyncio async def test_get_azure_client_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1639,7 +1629,7 @@ async def test_get_azure_client_flattened_async(): @pytest.mark.asyncio async def test_get_azure_client_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1660,7 +1650,7 @@ async def test_get_azure_client_flattened_error_async(): ) def test_list_azure_clients(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1692,7 +1682,7 @@ def test_list_azure_clients_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1711,7 +1701,7 @@ async def test_list_azure_clients_async( transport: str = "grpc_asyncio", request_type=azure_service.ListAzureClientsRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1748,7 +1738,7 @@ async def test_list_azure_clients_async_from_dict(): def test_list_azure_clients_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1780,7 +1770,7 @@ def test_list_azure_clients_field_headers(): @pytest.mark.asyncio async def test_list_azure_clients_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1813,7 +1803,7 @@ async def test_list_azure_clients_field_headers_async(): def test_list_azure_clients_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1839,7 +1829,7 @@ def test_list_azure_clients_flattened(): def test_list_azure_clients_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1854,7 +1844,7 @@ def test_list_azure_clients_flattened_error(): @pytest.mark.asyncio async def test_list_azure_clients_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1885,7 +1875,7 @@ async def test_list_azure_clients_flattened_async(): @pytest.mark.asyncio async def test_list_azure_clients_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1899,7 +1889,7 @@ async def test_list_azure_clients_flattened_error_async(): def test_list_azure_clients_pager(transport_name: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1951,7 +1941,7 @@ def test_list_azure_clients_pager(transport_name: str = "grpc"): def test_list_azure_clients_pages(transport_name: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1995,7 +1985,7 @@ def test_list_azure_clients_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_azure_clients_async_pager(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2047,7 +2037,7 @@ async def test_list_azure_clients_async_pager(): @pytest.mark.asyncio async def test_list_azure_clients_async_pages(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2104,7 +2094,7 @@ async def test_list_azure_clients_async_pages(): ) def test_delete_azure_client(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2133,7 +2123,7 @@ def test_delete_azure_client_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2152,7 +2142,7 @@ async def test_delete_azure_client_async( transport: str = "grpc_asyncio", request_type=azure_service.DeleteAzureClientRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2186,7 +2176,7 @@ async def test_delete_azure_client_async_from_dict(): def test_delete_azure_client_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2218,7 +2208,7 @@ def test_delete_azure_client_field_headers(): @pytest.mark.asyncio async def test_delete_azure_client_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2251,7 +2241,7 @@ async def test_delete_azure_client_field_headers_async(): def test_delete_azure_client_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2277,7 +2267,7 @@ def test_delete_azure_client_flattened(): def test_delete_azure_client_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2292,7 +2282,7 @@ def test_delete_azure_client_flattened_error(): @pytest.mark.asyncio async def test_delete_azure_client_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2323,7 +2313,7 @@ async def test_delete_azure_client_flattened_async(): @pytest.mark.asyncio async def test_delete_azure_client_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2344,7 +2334,7 @@ async def test_delete_azure_client_flattened_error_async(): ) def test_create_azure_cluster(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2373,7 +2363,7 @@ def test_create_azure_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2393,7 +2383,7 @@ async def test_create_azure_cluster_async( request_type=azure_service.CreateAzureClusterRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2427,7 +2417,7 @@ async def test_create_azure_cluster_async_from_dict(): def test_create_azure_cluster_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2459,7 +2449,7 @@ def test_create_azure_cluster_field_headers(): @pytest.mark.asyncio async def test_create_azure_cluster_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2492,7 +2482,7 @@ async def test_create_azure_cluster_field_headers_async(): def test_create_azure_cluster_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2526,7 +2516,7 @@ def test_create_azure_cluster_flattened(): def test_create_azure_cluster_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2543,7 +2533,7 @@ def test_create_azure_cluster_flattened_error(): @pytest.mark.asyncio async def test_create_azure_cluster_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2582,7 +2572,7 @@ async def test_create_azure_cluster_flattened_async(): @pytest.mark.asyncio async def test_create_azure_cluster_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2605,7 +2595,7 @@ async def test_create_azure_cluster_flattened_error_async(): ) def test_update_azure_cluster(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2634,7 +2624,7 @@ def test_update_azure_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2654,7 +2644,7 @@ async def test_update_azure_cluster_async( request_type=azure_service.UpdateAzureClusterRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2688,7 +2678,7 @@ async def test_update_azure_cluster_async_from_dict(): def test_update_azure_cluster_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2720,7 +2710,7 @@ def test_update_azure_cluster_field_headers(): @pytest.mark.asyncio async def test_update_azure_cluster_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2753,7 +2743,7 @@ async def test_update_azure_cluster_field_headers_async(): def test_update_azure_cluster_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2783,7 +2773,7 @@ def test_update_azure_cluster_flattened(): def test_update_azure_cluster_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2799,7 +2789,7 @@ def test_update_azure_cluster_flattened_error(): @pytest.mark.asyncio async def test_update_azure_cluster_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2834,7 +2824,7 @@ async def test_update_azure_cluster_flattened_async(): @pytest.mark.asyncio async def test_update_azure_cluster_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2856,7 +2846,7 @@ async def test_update_azure_cluster_flattened_error_async(): ) def test_get_azure_cluster(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2908,7 +2898,7 @@ def test_get_azure_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2927,7 +2917,7 @@ async def test_get_azure_cluster_async( transport: str = "grpc_asyncio", request_type=azure_service.GetAzureClusterRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2984,7 +2974,7 @@ async def test_get_azure_cluster_async_from_dict(): def test_get_azure_cluster_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3016,7 +3006,7 @@ def test_get_azure_cluster_field_headers(): @pytest.mark.asyncio async def test_get_azure_cluster_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3049,7 +3039,7 @@ async def test_get_azure_cluster_field_headers_async(): def test_get_azure_cluster_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3075,7 +3065,7 @@ def test_get_azure_cluster_flattened(): def test_get_azure_cluster_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3090,7 +3080,7 @@ def test_get_azure_cluster_flattened_error(): @pytest.mark.asyncio async def test_get_azure_cluster_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3121,7 +3111,7 @@ async def test_get_azure_cluster_flattened_async(): @pytest.mark.asyncio async def test_get_azure_cluster_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3142,7 +3132,7 @@ async def test_get_azure_cluster_flattened_error_async(): ) def test_list_azure_clusters(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3174,7 +3164,7 @@ def test_list_azure_clusters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3193,7 +3183,7 @@ async def test_list_azure_clusters_async( transport: str = "grpc_asyncio", request_type=azure_service.ListAzureClustersRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3230,7 +3220,7 @@ async def test_list_azure_clusters_async_from_dict(): def test_list_azure_clusters_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3262,7 +3252,7 @@ def test_list_azure_clusters_field_headers(): @pytest.mark.asyncio async def test_list_azure_clusters_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3295,7 +3285,7 @@ async def test_list_azure_clusters_field_headers_async(): def test_list_azure_clusters_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3321,7 +3311,7 @@ def test_list_azure_clusters_flattened(): def test_list_azure_clusters_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3336,7 +3326,7 @@ def test_list_azure_clusters_flattened_error(): @pytest.mark.asyncio async def test_list_azure_clusters_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3367,7 +3357,7 @@ async def test_list_azure_clusters_flattened_async(): @pytest.mark.asyncio async def test_list_azure_clusters_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3381,7 +3371,7 @@ async def test_list_azure_clusters_flattened_error_async(): def test_list_azure_clusters_pager(transport_name: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3433,7 +3423,7 @@ def test_list_azure_clusters_pager(transport_name: str = "grpc"): def test_list_azure_clusters_pages(transport_name: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3477,7 +3467,7 @@ def test_list_azure_clusters_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_azure_clusters_async_pager(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3529,7 +3519,7 @@ async def test_list_azure_clusters_async_pager(): @pytest.mark.asyncio async def test_list_azure_clusters_async_pages(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3586,7 +3576,7 @@ async def test_list_azure_clusters_async_pages(): ) def test_delete_azure_cluster(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3615,7 +3605,7 @@ def test_delete_azure_cluster_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3635,7 +3625,7 @@ async def test_delete_azure_cluster_async( request_type=azure_service.DeleteAzureClusterRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3669,7 +3659,7 @@ async def test_delete_azure_cluster_async_from_dict(): def test_delete_azure_cluster_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3701,7 +3691,7 @@ def test_delete_azure_cluster_field_headers(): @pytest.mark.asyncio async def test_delete_azure_cluster_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3734,7 +3724,7 @@ async def test_delete_azure_cluster_field_headers_async(): def test_delete_azure_cluster_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3760,7 +3750,7 @@ def test_delete_azure_cluster_flattened(): def test_delete_azure_cluster_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3775,7 +3765,7 @@ def test_delete_azure_cluster_flattened_error(): @pytest.mark.asyncio async def test_delete_azure_cluster_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3806,7 +3796,7 @@ async def test_delete_azure_cluster_flattened_async(): @pytest.mark.asyncio async def test_delete_azure_cluster_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3827,7 +3817,7 @@ async def test_delete_azure_cluster_flattened_error_async(): ) def test_generate_azure_cluster_agent_token(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3863,7 +3853,7 @@ def test_generate_azure_cluster_agent_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3883,7 +3873,7 @@ async def test_generate_azure_cluster_agent_token_async( request_type=azure_service.GenerateAzureClusterAgentTokenRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3924,7 +3914,7 @@ async def test_generate_azure_cluster_agent_token_async_from_dict(): def test_generate_azure_cluster_agent_token_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3956,7 +3946,7 @@ def test_generate_azure_cluster_agent_token_field_headers(): @pytest.mark.asyncio async def test_generate_azure_cluster_agent_token_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3996,7 +3986,7 @@ async def test_generate_azure_cluster_agent_token_field_headers_async(): ) def test_generate_azure_access_token(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4028,7 +4018,7 @@ def test_generate_azure_access_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4048,7 +4038,7 @@ async def test_generate_azure_access_token_async( request_type=azure_service.GenerateAzureAccessTokenRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4085,7 +4075,7 @@ async def test_generate_azure_access_token_async_from_dict(): def test_generate_azure_access_token_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4117,7 +4107,7 @@ def test_generate_azure_access_token_field_headers(): @pytest.mark.asyncio async def test_generate_azure_access_token_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4157,7 +4147,7 @@ async def test_generate_azure_access_token_field_headers_async(): ) def test_create_azure_node_pool(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4186,7 +4176,7 @@ def test_create_azure_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4206,7 +4196,7 @@ async def test_create_azure_node_pool_async( request_type=azure_service.CreateAzureNodePoolRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4240,7 +4230,7 @@ async def test_create_azure_node_pool_async_from_dict(): def test_create_azure_node_pool_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4272,7 +4262,7 @@ def test_create_azure_node_pool_field_headers(): @pytest.mark.asyncio async def test_create_azure_node_pool_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4305,7 +4295,7 @@ async def test_create_azure_node_pool_field_headers_async(): def test_create_azure_node_pool_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4339,7 +4329,7 @@ def test_create_azure_node_pool_flattened(): def test_create_azure_node_pool_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4356,7 +4346,7 @@ def test_create_azure_node_pool_flattened_error(): @pytest.mark.asyncio async def test_create_azure_node_pool_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4395,7 +4385,7 @@ async def test_create_azure_node_pool_flattened_async(): @pytest.mark.asyncio async def test_create_azure_node_pool_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4418,7 +4408,7 @@ async def test_create_azure_node_pool_flattened_error_async(): ) def test_update_azure_node_pool(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4447,7 +4437,7 @@ def test_update_azure_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4467,7 +4457,7 @@ async def test_update_azure_node_pool_async( request_type=azure_service.UpdateAzureNodePoolRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4501,7 +4491,7 @@ async def test_update_azure_node_pool_async_from_dict(): def test_update_azure_node_pool_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4533,7 +4523,7 @@ def test_update_azure_node_pool_field_headers(): @pytest.mark.asyncio async def test_update_azure_node_pool_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4566,7 +4556,7 @@ async def test_update_azure_node_pool_field_headers_async(): def test_update_azure_node_pool_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4596,7 +4586,7 @@ def test_update_azure_node_pool_flattened(): def test_update_azure_node_pool_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4612,7 +4602,7 @@ def test_update_azure_node_pool_flattened_error(): @pytest.mark.asyncio async def test_update_azure_node_pool_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4647,7 +4637,7 @@ async def test_update_azure_node_pool_flattened_async(): @pytest.mark.asyncio async def test_update_azure_node_pool_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4669,7 +4659,7 @@ async def test_update_azure_node_pool_flattened_error_async(): ) def test_get_azure_node_pool(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4715,7 +4705,7 @@ def test_get_azure_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4734,7 +4724,7 @@ async def test_get_azure_node_pool_async( transport: str = "grpc_asyncio", request_type=azure_service.GetAzureNodePoolRequest ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4785,7 +4775,7 @@ async def test_get_azure_node_pool_async_from_dict(): def test_get_azure_node_pool_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4817,7 +4807,7 @@ def test_get_azure_node_pool_field_headers(): @pytest.mark.asyncio async def test_get_azure_node_pool_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4850,7 +4840,7 @@ async def test_get_azure_node_pool_field_headers_async(): def test_get_azure_node_pool_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4876,7 +4866,7 @@ def test_get_azure_node_pool_flattened(): def test_get_azure_node_pool_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4891,7 +4881,7 @@ def test_get_azure_node_pool_flattened_error(): @pytest.mark.asyncio async def test_get_azure_node_pool_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4922,7 +4912,7 @@ async def test_get_azure_node_pool_flattened_async(): @pytest.mark.asyncio async def test_get_azure_node_pool_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4943,7 +4933,7 @@ async def test_get_azure_node_pool_flattened_error_async(): ) def test_list_azure_node_pools(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4975,7 +4965,7 @@ def test_list_azure_node_pools_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4995,7 +4985,7 @@ async def test_list_azure_node_pools_async( request_type=azure_service.ListAzureNodePoolsRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5032,7 +5022,7 @@ async def test_list_azure_node_pools_async_from_dict(): def test_list_azure_node_pools_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5064,7 +5054,7 @@ def test_list_azure_node_pools_field_headers(): @pytest.mark.asyncio async def test_list_azure_node_pools_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5097,7 +5087,7 @@ async def test_list_azure_node_pools_field_headers_async(): def test_list_azure_node_pools_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5123,7 +5113,7 @@ def test_list_azure_node_pools_flattened(): def test_list_azure_node_pools_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5138,7 +5128,7 @@ def test_list_azure_node_pools_flattened_error(): @pytest.mark.asyncio async def test_list_azure_node_pools_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5169,7 +5159,7 @@ async def test_list_azure_node_pools_flattened_async(): @pytest.mark.asyncio async def test_list_azure_node_pools_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5183,7 +5173,7 @@ async def test_list_azure_node_pools_flattened_error_async(): def test_list_azure_node_pools_pager(transport_name: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5235,7 +5225,7 @@ def test_list_azure_node_pools_pager(transport_name: str = "grpc"): def test_list_azure_node_pools_pages(transport_name: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5279,7 +5269,7 @@ def test_list_azure_node_pools_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_azure_node_pools_async_pager(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5331,7 +5321,7 @@ async def test_list_azure_node_pools_async_pager(): @pytest.mark.asyncio async def test_list_azure_node_pools_async_pages(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5388,7 +5378,7 @@ async def test_list_azure_node_pools_async_pages(): ) def test_delete_azure_node_pool(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5417,7 +5407,7 @@ def test_delete_azure_node_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5437,7 +5427,7 @@ async def test_delete_azure_node_pool_async( request_type=azure_service.DeleteAzureNodePoolRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5471,7 +5461,7 @@ async def test_delete_azure_node_pool_async_from_dict(): def test_delete_azure_node_pool_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5503,7 +5493,7 @@ def test_delete_azure_node_pool_field_headers(): @pytest.mark.asyncio async def test_delete_azure_node_pool_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5536,7 +5526,7 @@ async def test_delete_azure_node_pool_field_headers_async(): def test_delete_azure_node_pool_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5562,7 +5552,7 @@ def test_delete_azure_node_pool_flattened(): def test_delete_azure_node_pool_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5577,7 +5567,7 @@ def test_delete_azure_node_pool_flattened_error(): @pytest.mark.asyncio async def test_delete_azure_node_pool_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5608,7 +5598,7 @@ async def test_delete_azure_node_pool_flattened_async(): @pytest.mark.asyncio async def test_delete_azure_node_pool_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5629,7 +5619,7 @@ async def test_delete_azure_node_pool_flattened_error_async(): ) def test_get_azure_open_id_config(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5677,7 +5667,7 @@ def test_get_azure_open_id_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5697,7 +5687,7 @@ async def test_get_azure_open_id_config_async( request_type=azure_service.GetAzureOpenIdConfigRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5750,7 +5740,7 @@ async def test_get_azure_open_id_config_async_from_dict(): def test_get_azure_open_id_config_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5782,7 +5772,7 @@ def test_get_azure_open_id_config_field_headers(): @pytest.mark.asyncio async def test_get_azure_open_id_config_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5815,7 +5805,7 @@ async def test_get_azure_open_id_config_field_headers_async(): def test_get_azure_open_id_config_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5841,7 +5831,7 @@ def test_get_azure_open_id_config_flattened(): def test_get_azure_open_id_config_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5856,7 +5846,7 @@ def test_get_azure_open_id_config_flattened_error(): @pytest.mark.asyncio async def test_get_azure_open_id_config_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5887,7 +5877,7 @@ async def test_get_azure_open_id_config_flattened_async(): @pytest.mark.asyncio async def test_get_azure_open_id_config_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5908,7 +5898,7 @@ async def test_get_azure_open_id_config_flattened_error_async(): ) def test_get_azure_json_web_keys(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5937,7 +5927,7 @@ def test_get_azure_json_web_keys_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5957,7 +5947,7 @@ async def test_get_azure_json_web_keys_async( request_type=azure_service.GetAzureJsonWebKeysRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5991,7 +5981,7 @@ async def test_get_azure_json_web_keys_async_from_dict(): def test_get_azure_json_web_keys_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6023,7 +6013,7 @@ def test_get_azure_json_web_keys_field_headers(): @pytest.mark.asyncio async def test_get_azure_json_web_keys_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6056,7 +6046,7 @@ async def test_get_azure_json_web_keys_field_headers_async(): def test_get_azure_json_web_keys_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6082,7 +6072,7 @@ def test_get_azure_json_web_keys_flattened(): def test_get_azure_json_web_keys_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6097,7 +6087,7 @@ def test_get_azure_json_web_keys_flattened_error(): @pytest.mark.asyncio async def test_get_azure_json_web_keys_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6128,7 +6118,7 @@ async def test_get_azure_json_web_keys_flattened_async(): @pytest.mark.asyncio async def test_get_azure_json_web_keys_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6149,7 +6139,7 @@ async def test_get_azure_json_web_keys_flattened_error_async(): ) def test_get_azure_server_config(request_type, transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6183,7 +6173,7 @@ def test_get_azure_server_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6203,7 +6193,7 @@ async def test_get_azure_server_config_async( request_type=azure_service.GetAzureServerConfigRequest, ): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6242,7 +6232,7 @@ async def test_get_azure_server_config_async_from_dict(): def test_get_azure_server_config_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6274,7 +6264,7 @@ def test_get_azure_server_config_field_headers(): @pytest.mark.asyncio async def test_get_azure_server_config_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6307,7 +6297,7 @@ async def test_get_azure_server_config_field_headers_async(): def test_get_azure_server_config_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6333,7 +6323,7 @@ def test_get_azure_server_config_flattened(): def test_get_azure_server_config_flattened_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6348,7 +6338,7 @@ def test_get_azure_server_config_flattened_error(): @pytest.mark.asyncio async def test_get_azure_server_config_flattened_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6379,7 +6369,7 @@ async def test_get_azure_server_config_flattened_async(): @pytest.mark.asyncio async def test_get_azure_server_config_flattened_error_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6400,7 +6390,7 @@ async def test_get_azure_server_config_flattened_error_async(): ) def test_create_azure_client_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6526,7 +6516,7 @@ def test_create_azure_client_rest_required_fields( assert "azureClientId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_azure_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6538,7 +6528,7 @@ def test_create_azure_client_rest_required_fields( jsonified_request["azureClientId"] = "azure_client_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_azure_client._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -6556,7 +6546,7 @@ def test_create_azure_client_rest_required_fields( assert jsonified_request["azureClientId"] == "azure_client_id_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6601,7 +6591,7 @@ def test_create_azure_client_rest_required_fields( def test_create_azure_client_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_azure_client._get_unset_required_fields({}) @@ -6625,7 +6615,7 @@ def test_create_azure_client_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_azure_client_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -6685,7 +6675,7 @@ def test_create_azure_client_rest_bad_request( transport: str = "rest", request_type=azure_service.CreateAzureClientRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6707,7 +6697,7 @@ def test_create_azure_client_rest_bad_request( def test_create_azure_client_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6749,7 +6739,7 @@ def test_create_azure_client_rest_flattened(): def test_create_azure_client_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6766,7 +6756,7 @@ def test_create_azure_client_rest_flattened_error(transport: str = "rest"): def test_create_azure_client_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6779,7 +6769,7 @@ def test_create_azure_client_rest_error(): ) def test_get_azure_client_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6840,7 +6830,7 @@ def test_get_azure_client_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6849,7 +6839,7 @@ def test_get_azure_client_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6858,7 +6848,7 @@ def test_get_azure_client_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6900,7 +6890,7 @@ def test_get_azure_client_rest_required_fields( def test_get_azure_client_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_azure_client._get_unset_required_fields({}) @@ -6910,7 +6900,7 @@ def test_get_azure_client_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_azure_client_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -6968,7 +6958,7 @@ def test_get_azure_client_rest_bad_request( transport: str = "rest", request_type=azure_service.GetAzureClientRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6990,7 +6980,7 @@ def test_get_azure_client_rest_bad_request( def test_get_azure_client_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7034,7 +7024,7 @@ def test_get_azure_client_rest_flattened(): def test_get_azure_client_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7049,7 +7039,7 @@ def test_get_azure_client_rest_flattened_error(transport: str = "rest"): def test_get_azure_client_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -7062,7 +7052,7 @@ def test_get_azure_client_rest_error(): ) def test_list_azure_clients_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7113,7 +7103,7 @@ def test_list_azure_clients_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_azure_clients._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7122,7 +7112,7 @@ def test_list_azure_clients_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_azure_clients._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -7138,7 +7128,7 @@ def test_list_azure_clients_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7180,7 +7170,7 @@ def test_list_azure_clients_rest_required_fields( def test_list_azure_clients_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_azure_clients._get_unset_required_fields({}) @@ -7198,7 +7188,7 @@ def test_list_azure_clients_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_azure_clients_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -7256,7 +7246,7 @@ def test_list_azure_clients_rest_bad_request( transport: str = "rest", request_type=azure_service.ListAzureClientsRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7278,7 +7268,7 @@ def test_list_azure_clients_rest_bad_request( def test_list_azure_clients_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7320,7 +7310,7 @@ def test_list_azure_clients_rest_flattened(): def test_list_azure_clients_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7335,7 +7325,7 @@ def test_list_azure_clients_rest_flattened_error(transport: str = "rest"): def test_list_azure_clients_rest_pager(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7405,7 +7395,7 @@ def test_list_azure_clients_rest_pager(transport: str = "rest"): ) def test_delete_azure_client_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7451,7 +7441,7 @@ def test_delete_azure_client_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_azure_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7460,7 +7450,7 @@ def test_delete_azure_client_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_azure_client._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -7476,7 +7466,7 @@ def test_delete_azure_client_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7515,7 +7505,7 @@ def test_delete_azure_client_rest_required_fields( def test_delete_azure_client_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_azure_client._get_unset_required_fields({}) @@ -7533,7 +7523,7 @@ def test_delete_azure_client_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_azure_client_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -7593,7 +7583,7 @@ def test_delete_azure_client_rest_bad_request( transport: str = "rest", request_type=azure_service.DeleteAzureClientRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7615,7 +7605,7 @@ def test_delete_azure_client_rest_bad_request( def test_delete_azure_client_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7657,7 +7647,7 @@ def test_delete_azure_client_rest_flattened(): def test_delete_azure_client_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7672,7 +7662,7 @@ def test_delete_azure_client_rest_flattened_error(transport: str = "rest"): def test_delete_azure_client_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -7685,7 +7675,7 @@ def test_delete_azure_client_rest_error(): ) def test_create_azure_cluster_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -7874,7 +7864,7 @@ def test_create_azure_cluster_rest_required_fields( assert "azureClusterId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_azure_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -7886,7 +7876,7 @@ def test_create_azure_cluster_rest_required_fields( jsonified_request["azureClusterId"] = "azure_cluster_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_azure_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -7904,7 +7894,7 @@ def test_create_azure_cluster_rest_required_fields( assert jsonified_request["azureClusterId"] == "azure_cluster_id_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -7949,7 +7939,7 @@ def test_create_azure_cluster_rest_required_fields( def test_create_azure_cluster_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_azure_cluster._get_unset_required_fields({}) @@ -7973,7 +7963,7 @@ def test_create_azure_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_azure_cluster_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -8033,7 +8023,7 @@ def test_create_azure_cluster_rest_bad_request( transport: str = "rest", request_type=azure_service.CreateAzureClusterRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8055,7 +8045,7 @@ def test_create_azure_cluster_rest_bad_request( def test_create_azure_cluster_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8097,7 +8087,7 @@ def test_create_azure_cluster_rest_flattened(): def test_create_azure_cluster_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8114,7 +8104,7 @@ def test_create_azure_cluster_rest_flattened_error(transport: str = "rest"): def test_create_azure_cluster_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -8127,7 +8117,7 @@ def test_create_azure_cluster_rest_error(): ) def test_update_azure_cluster_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8317,14 +8307,14 @@ def test_update_azure_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_azure_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_azure_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -8338,7 +8328,7 @@ def test_update_azure_cluster_rest_required_fields( # verify required fields with non-default values are left alone client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8378,7 +8368,7 @@ def test_update_azure_cluster_rest_required_fields( def test_update_azure_cluster_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_azure_cluster._get_unset_required_fields({}) @@ -8401,7 +8391,7 @@ def test_update_azure_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_azure_cluster_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -8461,7 +8451,7 @@ def test_update_azure_cluster_rest_bad_request( transport: str = "rest", request_type=azure_service.UpdateAzureClusterRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8487,7 +8477,7 @@ def test_update_azure_cluster_rest_bad_request( def test_update_azure_cluster_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8532,7 +8522,7 @@ def test_update_azure_cluster_rest_flattened(): def test_update_azure_cluster_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8548,7 +8538,7 @@ def test_update_azure_cluster_rest_flattened_error(transport: str = "rest"): def test_update_azure_cluster_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -8561,7 +8551,7 @@ def test_update_azure_cluster_rest_error(): ) def test_get_azure_cluster_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8632,7 +8622,7 @@ def test_get_azure_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8641,7 +8631,7 @@ def test_get_azure_cluster_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8650,7 +8640,7 @@ def test_get_azure_cluster_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8692,7 +8682,7 @@ def test_get_azure_cluster_rest_required_fields( def test_get_azure_cluster_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_azure_cluster._get_unset_required_fields({}) @@ -8702,7 +8692,7 @@ def test_get_azure_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_azure_cluster_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -8760,7 +8750,7 @@ def test_get_azure_cluster_rest_bad_request( transport: str = "rest", request_type=azure_service.GetAzureClusterRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8782,7 +8772,7 @@ def test_get_azure_cluster_rest_bad_request( def test_get_azure_cluster_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8826,7 +8816,7 @@ def test_get_azure_cluster_rest_flattened(): def test_get_azure_cluster_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8841,7 +8831,7 @@ def test_get_azure_cluster_rest_flattened_error(transport: str = "rest"): def test_get_azure_cluster_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -8854,7 +8844,7 @@ def test_get_azure_cluster_rest_error(): ) def test_list_azure_clusters_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -8905,7 +8895,7 @@ def test_list_azure_clusters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_azure_clusters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -8914,7 +8904,7 @@ def test_list_azure_clusters_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_azure_clusters._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -8930,7 +8920,7 @@ def test_list_azure_clusters_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -8972,7 +8962,7 @@ def test_list_azure_clusters_rest_required_fields( def test_list_azure_clusters_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_azure_clusters._get_unset_required_fields({}) @@ -8990,7 +8980,7 @@ def test_list_azure_clusters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_azure_clusters_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -9048,7 +9038,7 @@ def test_list_azure_clusters_rest_bad_request( transport: str = "rest", request_type=azure_service.ListAzureClustersRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9070,7 +9060,7 @@ def test_list_azure_clusters_rest_bad_request( def test_list_azure_clusters_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9112,7 +9102,7 @@ def test_list_azure_clusters_rest_flattened(): def test_list_azure_clusters_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9127,7 +9117,7 @@ def test_list_azure_clusters_rest_flattened_error(transport: str = "rest"): def test_list_azure_clusters_rest_pager(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9197,7 +9187,7 @@ def test_list_azure_clusters_rest_pager(transport: str = "rest"): ) def test_delete_azure_cluster_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9243,7 +9233,7 @@ def test_delete_azure_cluster_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_azure_cluster._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9252,7 +9242,7 @@ def test_delete_azure_cluster_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_azure_cluster._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -9269,7 +9259,7 @@ def test_delete_azure_cluster_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9308,7 +9298,7 @@ def test_delete_azure_cluster_rest_required_fields( def test_delete_azure_cluster_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_azure_cluster._get_unset_required_fields({}) @@ -9327,7 +9317,7 @@ def test_delete_azure_cluster_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_azure_cluster_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -9387,7 +9377,7 @@ def test_delete_azure_cluster_rest_bad_request( transport: str = "rest", request_type=azure_service.DeleteAzureClusterRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9409,7 +9399,7 @@ def test_delete_azure_cluster_rest_bad_request( def test_delete_azure_cluster_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9451,7 +9441,7 @@ def test_delete_azure_cluster_rest_flattened(): def test_delete_azure_cluster_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9466,7 +9456,7 @@ def test_delete_azure_cluster_rest_flattened_error(transport: str = "rest"): def test_delete_azure_cluster_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -9479,7 +9469,7 @@ def test_delete_azure_cluster_rest_error(): ) def test_generate_azure_cluster_agent_token_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9541,7 +9531,7 @@ def test_generate_azure_cluster_agent_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_azure_cluster_agent_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9553,7 +9543,7 @@ def test_generate_azure_cluster_agent_token_rest_required_fields( jsonified_request["version"] = "version_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_azure_cluster_agent_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9568,7 +9558,7 @@ def test_generate_azure_cluster_agent_token_rest_required_fields( assert jsonified_request["version"] == "version_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9613,7 +9603,7 @@ def test_generate_azure_cluster_agent_token_rest_required_fields( def test_generate_azure_cluster_agent_token_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -9635,7 +9625,7 @@ def test_generate_azure_cluster_agent_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_azure_cluster_agent_token_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -9698,7 +9688,7 @@ def test_generate_azure_cluster_agent_token_rest_bad_request( request_type=azure_service.GenerateAzureClusterAgentTokenRequest, ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9722,7 +9712,7 @@ def test_generate_azure_cluster_agent_token_rest_bad_request( def test_generate_azure_cluster_agent_token_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -9735,7 +9725,7 @@ def test_generate_azure_cluster_agent_token_rest_error(): ) def test_generate_azure_access_token_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9788,7 +9778,7 @@ def test_generate_azure_access_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_azure_access_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9797,7 +9787,7 @@ def test_generate_azure_access_token_rest_required_fields( jsonified_request["azureCluster"] = "azure_cluster_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_azure_access_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9806,7 +9796,7 @@ def test_generate_azure_access_token_rest_required_fields( assert jsonified_request["azureCluster"] == "azure_cluster_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9850,7 +9840,7 @@ def test_generate_azure_access_token_rest_required_fields( def test_generate_azure_access_token_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.generate_azure_access_token._get_unset_required_fields({}) @@ -9860,7 +9850,7 @@ def test_generate_azure_access_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_azure_access_token_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -9920,7 +9910,7 @@ def test_generate_azure_access_token_rest_bad_request( transport: str = "rest", request_type=azure_service.GenerateAzureAccessTokenRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9944,7 +9934,7 @@ def test_generate_azure_access_token_rest_bad_request( def test_generate_azure_access_token_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -9957,7 +9947,7 @@ def test_generate_azure_access_token_rest_error(): ) def test_create_azure_node_pool_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10108,7 +10098,7 @@ def test_create_azure_node_pool_rest_required_fields( assert "azureNodePoolId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_azure_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10120,7 +10110,7 @@ def test_create_azure_node_pool_rest_required_fields( jsonified_request["azureNodePoolId"] = "azure_node_pool_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_azure_node_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -10138,7 +10128,7 @@ def test_create_azure_node_pool_rest_required_fields( assert jsonified_request["azureNodePoolId"] == "azure_node_pool_id_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10183,7 +10173,7 @@ def test_create_azure_node_pool_rest_required_fields( def test_create_azure_node_pool_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_azure_node_pool._get_unset_required_fields({}) @@ -10207,7 +10197,7 @@ def test_create_azure_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_azure_node_pool_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -10267,7 +10257,7 @@ def test_create_azure_node_pool_rest_bad_request( transport: str = "rest", request_type=azure_service.CreateAzureNodePoolRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10291,7 +10281,7 @@ def test_create_azure_node_pool_rest_bad_request( def test_create_azure_node_pool_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10335,7 +10325,7 @@ def test_create_azure_node_pool_rest_flattened(): def test_create_azure_node_pool_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10352,7 +10342,7 @@ def test_create_azure_node_pool_rest_flattened_error(transport: str = "rest"): def test_create_azure_node_pool_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -10365,7 +10355,7 @@ def test_create_azure_node_pool_rest_error(): ) def test_update_azure_node_pool_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10515,14 +10505,14 @@ def test_update_azure_node_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_azure_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_azure_node_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -10536,7 +10526,7 @@ def test_update_azure_node_pool_rest_required_fields( # verify required fields with non-default values are left alone client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10576,7 +10566,7 @@ def test_update_azure_node_pool_rest_required_fields( def test_update_azure_node_pool_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_azure_node_pool._get_unset_required_fields({}) @@ -10599,7 +10589,7 @@ def test_update_azure_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_azure_node_pool_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -10659,7 +10649,7 @@ def test_update_azure_node_pool_rest_bad_request( transport: str = "rest", request_type=azure_service.UpdateAzureNodePoolRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10685,7 +10675,7 @@ def test_update_azure_node_pool_rest_bad_request( def test_update_azure_node_pool_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10730,7 +10720,7 @@ def test_update_azure_node_pool_rest_flattened(): def test_update_azure_node_pool_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10746,7 +10736,7 @@ def test_update_azure_node_pool_rest_flattened_error(transport: str = "rest"): def test_update_azure_node_pool_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -10759,7 +10749,7 @@ def test_update_azure_node_pool_rest_error(): ) def test_get_azure_node_pool_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10826,7 +10816,7 @@ def test_get_azure_node_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10835,7 +10825,7 @@ def test_get_azure_node_pool_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10844,7 +10834,7 @@ def test_get_azure_node_pool_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10886,7 +10876,7 @@ def test_get_azure_node_pool_rest_required_fields( def test_get_azure_node_pool_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_azure_node_pool._get_unset_required_fields({}) @@ -10896,7 +10886,7 @@ def test_get_azure_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_azure_node_pool_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -10954,7 +10944,7 @@ def test_get_azure_node_pool_rest_bad_request( transport: str = "rest", request_type=azure_service.GetAzureNodePoolRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10978,7 +10968,7 @@ def test_get_azure_node_pool_rest_bad_request( def test_get_azure_node_pool_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11022,7 +11012,7 @@ def test_get_azure_node_pool_rest_flattened(): def test_get_azure_node_pool_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11037,7 +11027,7 @@ def test_get_azure_node_pool_rest_flattened_error(transport: str = "rest"): def test_get_azure_node_pool_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11050,7 +11040,7 @@ def test_get_azure_node_pool_rest_error(): ) def test_list_azure_node_pools_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11103,7 +11093,7 @@ def test_list_azure_node_pools_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_azure_node_pools._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11112,7 +11102,7 @@ def test_list_azure_node_pools_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_azure_node_pools._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -11128,7 +11118,7 @@ def test_list_azure_node_pools_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -11170,7 +11160,7 @@ def test_list_azure_node_pools_rest_required_fields( def test_list_azure_node_pools_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_azure_node_pools._get_unset_required_fields({}) @@ -11188,7 +11178,7 @@ def test_list_azure_node_pools_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_azure_node_pools_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -11246,7 +11236,7 @@ def test_list_azure_node_pools_rest_bad_request( transport: str = "rest", request_type=azure_service.ListAzureNodePoolsRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11270,7 +11260,7 @@ def test_list_azure_node_pools_rest_bad_request( def test_list_azure_node_pools_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11314,7 +11304,7 @@ def test_list_azure_node_pools_rest_flattened(): def test_list_azure_node_pools_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11329,7 +11319,7 @@ def test_list_azure_node_pools_rest_flattened_error(transport: str = "rest"): def test_list_azure_node_pools_rest_pager(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11401,7 +11391,7 @@ def test_list_azure_node_pools_rest_pager(transport: str = "rest"): ) def test_delete_azure_node_pool_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11449,7 +11439,7 @@ def test_delete_azure_node_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_azure_node_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11458,7 +11448,7 @@ def test_delete_azure_node_pool_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_azure_node_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -11475,7 +11465,7 @@ def test_delete_azure_node_pool_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -11514,7 +11504,7 @@ def test_delete_azure_node_pool_rest_required_fields( def test_delete_azure_node_pool_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_azure_node_pool._get_unset_required_fields({}) @@ -11533,7 +11523,7 @@ def test_delete_azure_node_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_azure_node_pool_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -11593,7 +11583,7 @@ def test_delete_azure_node_pool_rest_bad_request( transport: str = "rest", request_type=azure_service.DeleteAzureNodePoolRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11617,7 +11607,7 @@ def test_delete_azure_node_pool_rest_bad_request( def test_delete_azure_node_pool_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11659,7 +11649,7 @@ def test_delete_azure_node_pool_rest_flattened(): def test_delete_azure_node_pool_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11674,7 +11664,7 @@ def test_delete_azure_node_pool_rest_flattened_error(transport: str = "rest"): def test_delete_azure_node_pool_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11687,7 +11677,7 @@ def test_delete_azure_node_pool_rest_error(): ) def test_get_azure_open_id_config_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11756,7 +11746,7 @@ def test_get_azure_open_id_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_open_id_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11765,7 +11755,7 @@ def test_get_azure_open_id_config_rest_required_fields( jsonified_request["azureCluster"] = "azure_cluster_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_open_id_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11774,7 +11764,7 @@ def test_get_azure_open_id_config_rest_required_fields( assert jsonified_request["azureCluster"] == "azure_cluster_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -11816,7 +11806,7 @@ def test_get_azure_open_id_config_rest_required_fields( def test_get_azure_open_id_config_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_azure_open_id_config._get_unset_required_fields({}) @@ -11826,7 +11816,7 @@ def test_get_azure_open_id_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_azure_open_id_config_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -11884,7 +11874,7 @@ def test_get_azure_open_id_config_rest_bad_request( transport: str = "rest", request_type=azure_service.GetAzureOpenIdConfigRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11908,7 +11898,7 @@ def test_get_azure_open_id_config_rest_bad_request( def test_get_azure_open_id_config_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11952,7 +11942,7 @@ def test_get_azure_open_id_config_rest_flattened(): def test_get_azure_open_id_config_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11967,7 +11957,7 @@ def test_get_azure_open_id_config_rest_flattened_error(transport: str = "rest"): def test_get_azure_open_id_config_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11980,7 +11970,7 @@ def test_get_azure_open_id_config_rest_error(): ) def test_get_azure_json_web_keys_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12030,7 +12020,7 @@ def test_get_azure_json_web_keys_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_json_web_keys._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12039,7 +12029,7 @@ def test_get_azure_json_web_keys_rest_required_fields( jsonified_request["azureCluster"] = "azure_cluster_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_json_web_keys._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12048,7 +12038,7 @@ def test_get_azure_json_web_keys_rest_required_fields( assert jsonified_request["azureCluster"] == "azure_cluster_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -12090,7 +12080,7 @@ def test_get_azure_json_web_keys_rest_required_fields( def test_get_azure_json_web_keys_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_azure_json_web_keys._get_unset_required_fields({}) @@ -12100,7 +12090,7 @@ def test_get_azure_json_web_keys_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_azure_json_web_keys_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -12158,7 +12148,7 @@ def test_get_azure_json_web_keys_rest_bad_request( transport: str = "rest", request_type=azure_service.GetAzureJsonWebKeysRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12182,7 +12172,7 @@ def test_get_azure_json_web_keys_rest_bad_request( def test_get_azure_json_web_keys_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12226,7 +12216,7 @@ def test_get_azure_json_web_keys_rest_flattened(): def test_get_azure_json_web_keys_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12241,7 +12231,7 @@ def test_get_azure_json_web_keys_rest_flattened_error(transport: str = "rest"): def test_get_azure_json_web_keys_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -12254,7 +12244,7 @@ def test_get_azure_json_web_keys_rest_error(): ) def test_get_azure_server_config_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12307,7 +12297,7 @@ def test_get_azure_server_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_server_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12316,7 +12306,7 @@ def test_get_azure_server_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_azure_server_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12325,7 +12315,7 @@ def test_get_azure_server_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -12367,7 +12357,7 @@ def test_get_azure_server_config_rest_required_fields( def test_get_azure_server_config_rest_unset_required_fields(): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_azure_server_config._get_unset_required_fields({}) @@ -12377,7 +12367,7 @@ def test_get_azure_server_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_azure_server_config_rest_interceptors(null_interceptor): transport = transports.AzureClustersRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.AzureClustersRestInterceptor(), @@ -12435,7 +12425,7 @@ def test_get_azure_server_config_rest_bad_request( transport: str = "rest", request_type=azure_service.GetAzureServerConfigRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12457,7 +12447,7 @@ def test_get_azure_server_config_rest_bad_request( def test_get_azure_server_config_rest_flattened(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12501,7 +12491,7 @@ def test_get_azure_server_config_rest_flattened(): def test_get_azure_server_config_rest_flattened_error(transport: str = "rest"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12516,24 +12506,24 @@ def test_get_azure_server_config_rest_flattened_error(transport: str = "rest"): def test_get_azure_server_config_rest_error(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.AzureClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.AzureClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AzureClustersClient( @@ -12543,7 +12533,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.AzureClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -12558,13 +12548,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = AzureClustersClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.AzureClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AzureClustersClient( @@ -12576,7 +12565,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.AzureClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = AzureClustersClient(transport=transport) assert client.transport is transport @@ -12585,13 +12574,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.AzureClustersGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.AzureClustersGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -12608,7 +12597,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -12622,7 +12611,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = AzureClustersClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -12630,7 +12619,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -12642,7 +12631,7 @@ def test_azure_clusters_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.AzureClustersTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -12654,7 +12643,7 @@ def test_azure_clusters_base_transport(): ) as Transport: Transport.return_value = None transport = transports.AzureClustersTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -12713,7 +12702,7 @@ def test_azure_clusters_base_transport_with_credentials_file(): "google.cloud.gke_multicloud_v1.services.azure_clusters.transports.AzureClustersTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AzureClustersTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -12732,7 +12721,7 @@ def test_azure_clusters_base_transport_with_adc(): "google.cloud.gke_multicloud_v1.services.azure_clusters.transports.AzureClustersTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AzureClustersTransport() adc.assert_called_once() @@ -12740,7 +12729,7 @@ def test_azure_clusters_base_transport_with_adc(): def test_azure_clusters_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) AzureClustersClient() adc.assert_called_once_with( scopes=None, @@ -12760,7 +12749,7 @@ def test_azure_clusters_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -12807,7 +12796,7 @@ def test_azure_clusters_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -12835,7 +12824,7 @@ def test_azure_clusters_transport_create_channel(transport_class, grpc_helpers): ], ) def test_azure_clusters_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -12873,7 +12862,7 @@ def test_azure_clusters_grpc_transport_client_cert_source_for_mtls(transport_cla def test_azure_clusters_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -12885,7 +12874,7 @@ def test_azure_clusters_http_transport_client_cert_source_for_mtls(): def test_azure_clusters_rest_lro_client(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -12910,7 +12899,7 @@ def test_azure_clusters_rest_lro_client(): ) def test_azure_clusters_host_no_port(transport_name): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkemulticloud.googleapis.com" ), @@ -12933,7 +12922,7 @@ def test_azure_clusters_host_no_port(transport_name): ) def test_azure_clusters_host_with_port(transport_name): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gkemulticloud.googleapis.com:8000" ), @@ -12953,8 +12942,8 @@ def test_azure_clusters_host_with_port(transport_name): ], ) def test_azure_clusters_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = AzureClustersClient( credentials=creds1, transport=transport_name, @@ -13070,7 +13059,7 @@ def test_azure_clusters_transport_channel_mtls_with_client_cert_source(transport mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -13148,7 +13137,7 @@ def test_azure_clusters_transport_channel_mtls_with_adc(transport_class): def test_azure_clusters_grpc_lro_client(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -13165,7 +13154,7 @@ def test_azure_clusters_grpc_lro_client(): def test_azure_clusters_grpc_lro_async_client(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -13400,7 +13389,7 @@ def test_client_with_default_client_info(): transports.AzureClustersTransport, "_prep_wrapped_messages" ) as prep: client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -13410,7 +13399,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = AzureClustersClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -13419,7 +13408,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -13434,7 +13423,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13464,7 +13453,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -13492,7 +13481,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13522,7 +13511,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -13550,7 +13539,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13580,7 +13569,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -13608,7 +13597,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13638,7 +13627,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -13664,7 +13653,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13689,7 +13678,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13713,7 +13702,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13742,7 +13731,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13769,7 +13758,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -13787,7 +13776,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -13803,7 +13792,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13828,7 +13817,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13852,7 +13841,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13881,7 +13870,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13908,7 +13897,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -13926,7 +13915,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -13942,7 +13931,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13967,7 +13956,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13993,7 +13982,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14022,7 +14011,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14051,7 +14040,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -14069,7 +14058,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -14087,7 +14076,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14112,7 +14101,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14138,7 +14127,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14167,7 +14156,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14196,7 +14185,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -14214,7 +14203,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = AzureClustersAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -14238,7 +14227,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -14255,7 +14244,7 @@ def test_client_ctx(): ] for transport in transports: client = AzureClustersClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons/gapic_version.py b/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons/gapic_version.py index 288d10b11145..360a0d13ebdd 100644 --- a/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons/gapic_version.py +++ b/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.5" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/gapic_version.py b/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/gapic_version.py index 288d10b11145..360a0d13ebdd 100644 --- a/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/gapic_version.py +++ b/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.5" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/services/g_suite_add_ons/client.py b/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/services/g_suite_add_ons/client.py index 6b8f578c436c..7ddba800a188 100644 --- a/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/services/g_suite_add_ons/client.py +++ b/packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/services/g_suite_add_ons/client.py @@ -449,6 +449,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -467,6 +468,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -541,17 +543,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = GSuiteAddOnsClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = GSuiteAddOnsClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-gsuiteaddons/samples/generated_samples/snippet_metadata_google.cloud.gsuiteaddons.v1.json b/packages/google-cloud-gsuiteaddons/samples/generated_samples/snippet_metadata_google.cloud.gsuiteaddons.v1.json index 72c180ed4062..1a4e67e71b2d 100644 --- a/packages/google-cloud-gsuiteaddons/samples/generated_samples/snippet_metadata_google.cloud.gsuiteaddons.v1.json +++ b/packages/google-cloud-gsuiteaddons/samples/generated_samples/snippet_metadata_google.cloud.gsuiteaddons.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-gsuiteaddons", - "version": "0.3.5" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-gsuiteaddons/setup.py b/packages/google-cloud-gsuiteaddons/setup.py index 6bf7b891fadb..828284759173 100644 --- a/packages/google-cloud-gsuiteaddons/setup.py +++ b/packages/google-cloud-gsuiteaddons/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", "google-apps-script-type >= 0.2.0, <1.0.0dev", diff --git a/packages/google-cloud-gsuiteaddons/testing/constraints-3.7.txt b/packages/google-cloud-gsuiteaddons/testing/constraints-3.7.txt index dce7aa947754..2a3bcd01e396 100644 --- a/packages/google-cloud-gsuiteaddons/testing/constraints-3.7.txt +++ b/packages/google-cloud-gsuiteaddons/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 google-apps-script-type==0.2.0 diff --git a/packages/google-cloud-gsuiteaddons/tests/unit/gapic/gsuiteaddons_v1/test_g_suite_add_ons.py b/packages/google-cloud-gsuiteaddons/tests/unit/gapic/gsuiteaddons_v1/test_g_suite_add_ons.py index 31883298f13c..42c1d767a18b 100644 --- a/packages/google-cloud-gsuiteaddons/tests/unit/gapic/gsuiteaddons_v1/test_g_suite_add_ons.py +++ b/packages/google-cloud-gsuiteaddons/tests/unit/gapic/gsuiteaddons_v1/test_g_suite_add_ons.py @@ -90,18 +90,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -313,7 +301,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -340,42 +328,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -386,7 +381,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_g_suite_add_ons_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -438,7 +433,7 @@ def test_g_suite_add_ons_client_service_account_always_use_jwt( ], ) def test_g_suite_add_ons_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -501,9 +496,7 @@ def test_g_suite_add_ons_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(GSuiteAddOnsClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -896,20 +889,20 @@ def test_g_suite_add_ons_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -921,13 +914,11 @@ def test_g_suite_add_ons_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -943,8 +934,7 @@ def test_g_suite_add_ons_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1095,8 +1085,8 @@ def test_g_suite_add_ons_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1125,7 +1115,7 @@ def test_g_suite_add_ons_client_create_channel_credentials_file( ) def test_get_authorization(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1161,7 +1151,7 @@ def test_get_authorization_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1180,7 +1170,7 @@ async def test_get_authorization_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.GetAuthorizationRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1221,7 +1211,7 @@ async def test_get_authorization_async_from_dict(): def test_get_authorization_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1253,7 +1243,7 @@ def test_get_authorization_field_headers(): @pytest.mark.asyncio async def test_get_authorization_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1286,7 +1276,7 @@ async def test_get_authorization_field_headers_async(): def test_get_authorization_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1312,7 +1302,7 @@ def test_get_authorization_flattened(): def test_get_authorization_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1327,7 +1317,7 @@ def test_get_authorization_flattened_error(): @pytest.mark.asyncio async def test_get_authorization_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1358,7 +1348,7 @@ async def test_get_authorization_flattened_async(): @pytest.mark.asyncio async def test_get_authorization_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1379,7 +1369,7 @@ async def test_get_authorization_flattened_error_async(): ) def test_create_deployment(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1415,7 +1405,7 @@ def test_create_deployment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1434,7 +1424,7 @@ async def test_create_deployment_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.CreateDeploymentRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1475,7 +1465,7 @@ async def test_create_deployment_async_from_dict(): def test_create_deployment_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1507,7 +1497,7 @@ def test_create_deployment_field_headers(): @pytest.mark.asyncio async def test_create_deployment_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1540,7 +1530,7 @@ async def test_create_deployment_field_headers_async(): def test_create_deployment_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1574,7 +1564,7 @@ def test_create_deployment_flattened(): def test_create_deployment_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1591,7 +1581,7 @@ def test_create_deployment_flattened_error(): @pytest.mark.asyncio async def test_create_deployment_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1630,7 +1620,7 @@ async def test_create_deployment_flattened_async(): @pytest.mark.asyncio async def test_create_deployment_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1653,7 +1643,7 @@ async def test_create_deployment_flattened_error_async(): ) def test_replace_deployment(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1689,7 +1679,7 @@ def test_replace_deployment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1708,7 +1698,7 @@ async def test_replace_deployment_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.ReplaceDeploymentRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1749,7 +1739,7 @@ async def test_replace_deployment_async_from_dict(): def test_replace_deployment_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1781,7 +1771,7 @@ def test_replace_deployment_field_headers(): @pytest.mark.asyncio async def test_replace_deployment_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1814,7 +1804,7 @@ async def test_replace_deployment_field_headers_async(): def test_replace_deployment_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1840,7 +1830,7 @@ def test_replace_deployment_flattened(): def test_replace_deployment_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1855,7 +1845,7 @@ def test_replace_deployment_flattened_error(): @pytest.mark.asyncio async def test_replace_deployment_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1886,7 +1876,7 @@ async def test_replace_deployment_flattened_async(): @pytest.mark.asyncio async def test_replace_deployment_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1907,7 +1897,7 @@ async def test_replace_deployment_flattened_error_async(): ) def test_get_deployment(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1941,7 +1931,7 @@ def test_get_deployment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1958,7 +1948,7 @@ async def test_get_deployment_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.GetDeploymentRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1997,7 +1987,7 @@ async def test_get_deployment_async_from_dict(): def test_get_deployment_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2027,7 +2017,7 @@ def test_get_deployment_field_headers(): @pytest.mark.asyncio async def test_get_deployment_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2058,7 +2048,7 @@ async def test_get_deployment_field_headers_async(): def test_get_deployment_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2082,7 +2072,7 @@ def test_get_deployment_flattened(): def test_get_deployment_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2097,7 +2087,7 @@ def test_get_deployment_flattened_error(): @pytest.mark.asyncio async def test_get_deployment_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2126,7 +2116,7 @@ async def test_get_deployment_flattened_async(): @pytest.mark.asyncio async def test_get_deployment_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2147,7 +2137,7 @@ async def test_get_deployment_flattened_error_async(): ) def test_list_deployments(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2177,7 +2167,7 @@ def test_list_deployments_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2194,7 +2184,7 @@ async def test_list_deployments_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.ListDeploymentsRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2229,7 +2219,7 @@ async def test_list_deployments_async_from_dict(): def test_list_deployments_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2259,7 +2249,7 @@ def test_list_deployments_field_headers(): @pytest.mark.asyncio async def test_list_deployments_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2290,7 +2280,7 @@ async def test_list_deployments_field_headers_async(): def test_list_deployments_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2314,7 +2304,7 @@ def test_list_deployments_flattened(): def test_list_deployments_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2329,7 +2319,7 @@ def test_list_deployments_flattened_error(): @pytest.mark.asyncio async def test_list_deployments_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2358,7 +2348,7 @@ async def test_list_deployments_flattened_async(): @pytest.mark.asyncio async def test_list_deployments_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2372,7 +2362,7 @@ async def test_list_deployments_flattened_error_async(): def test_list_deployments_pager(transport_name: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2422,7 +2412,7 @@ def test_list_deployments_pager(transport_name: str = "grpc"): def test_list_deployments_pages(transport_name: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2464,7 +2454,7 @@ def test_list_deployments_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_deployments_async_pager(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2514,7 +2504,7 @@ async def test_list_deployments_async_pager(): @pytest.mark.asyncio async def test_list_deployments_async_pages(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2569,7 +2559,7 @@ async def test_list_deployments_async_pages(): ) def test_delete_deployment(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2598,7 +2588,7 @@ def test_delete_deployment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2617,7 +2607,7 @@ async def test_delete_deployment_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.DeleteDeploymentRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2649,7 +2639,7 @@ async def test_delete_deployment_async_from_dict(): def test_delete_deployment_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2681,7 +2671,7 @@ def test_delete_deployment_field_headers(): @pytest.mark.asyncio async def test_delete_deployment_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2712,7 +2702,7 @@ async def test_delete_deployment_field_headers_async(): def test_delete_deployment_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2738,7 +2728,7 @@ def test_delete_deployment_flattened(): def test_delete_deployment_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2753,7 +2743,7 @@ def test_delete_deployment_flattened_error(): @pytest.mark.asyncio async def test_delete_deployment_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2782,7 +2772,7 @@ async def test_delete_deployment_flattened_async(): @pytest.mark.asyncio async def test_delete_deployment_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2803,7 +2793,7 @@ async def test_delete_deployment_flattened_error_async(): ) def test_install_deployment(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2832,7 +2822,7 @@ def test_install_deployment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2851,7 +2841,7 @@ async def test_install_deployment_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.InstallDeploymentRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2883,7 +2873,7 @@ async def test_install_deployment_async_from_dict(): def test_install_deployment_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2915,7 +2905,7 @@ def test_install_deployment_field_headers(): @pytest.mark.asyncio async def test_install_deployment_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2946,7 +2936,7 @@ async def test_install_deployment_field_headers_async(): def test_install_deployment_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2972,7 +2962,7 @@ def test_install_deployment_flattened(): def test_install_deployment_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2987,7 +2977,7 @@ def test_install_deployment_flattened_error(): @pytest.mark.asyncio async def test_install_deployment_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3016,7 +3006,7 @@ async def test_install_deployment_flattened_async(): @pytest.mark.asyncio async def test_install_deployment_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3037,7 +3027,7 @@ async def test_install_deployment_flattened_error_async(): ) def test_uninstall_deployment(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3066,7 +3056,7 @@ def test_uninstall_deployment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3086,7 +3076,7 @@ async def test_uninstall_deployment_async( request_type=gsuiteaddons.UninstallDeploymentRequest, ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3118,7 +3108,7 @@ async def test_uninstall_deployment_async_from_dict(): def test_uninstall_deployment_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3150,7 +3140,7 @@ def test_uninstall_deployment_field_headers(): @pytest.mark.asyncio async def test_uninstall_deployment_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3181,7 +3171,7 @@ async def test_uninstall_deployment_field_headers_async(): def test_uninstall_deployment_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3207,7 +3197,7 @@ def test_uninstall_deployment_flattened(): def test_uninstall_deployment_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3222,7 +3212,7 @@ def test_uninstall_deployment_flattened_error(): @pytest.mark.asyncio async def test_uninstall_deployment_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3251,7 +3241,7 @@ async def test_uninstall_deployment_flattened_async(): @pytest.mark.asyncio async def test_uninstall_deployment_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3272,7 +3262,7 @@ async def test_uninstall_deployment_flattened_error_async(): ) def test_get_install_status(request_type, transport: str = "grpc"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3304,7 +3294,7 @@ def test_get_install_status_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3323,7 +3313,7 @@ async def test_get_install_status_async( transport: str = "grpc_asyncio", request_type=gsuiteaddons.GetInstallStatusRequest ): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3360,7 +3350,7 @@ async def test_get_install_status_async_from_dict(): def test_get_install_status_field_headers(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3392,7 +3382,7 @@ def test_get_install_status_field_headers(): @pytest.mark.asyncio async def test_get_install_status_field_headers_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3425,7 +3415,7 @@ async def test_get_install_status_field_headers_async(): def test_get_install_status_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3451,7 +3441,7 @@ def test_get_install_status_flattened(): def test_get_install_status_flattened_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3466,7 +3456,7 @@ def test_get_install_status_flattened_error(): @pytest.mark.asyncio async def test_get_install_status_flattened_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3497,7 +3487,7 @@ async def test_get_install_status_flattened_async(): @pytest.mark.asyncio async def test_get_install_status_flattened_error_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3518,7 +3508,7 @@ async def test_get_install_status_flattened_error_async(): ) def test_get_authorization_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3573,7 +3563,7 @@ def test_get_authorization_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_authorization._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3582,7 +3572,7 @@ def test_get_authorization_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_authorization._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3591,7 +3581,7 @@ def test_get_authorization_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3633,7 +3623,7 @@ def test_get_authorization_rest_required_fields( def test_get_authorization_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_authorization._get_unset_required_fields({}) @@ -3643,7 +3633,7 @@ def test_get_authorization_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_authorization_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -3701,7 +3691,7 @@ def test_get_authorization_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.GetAuthorizationRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3723,7 +3713,7 @@ def test_get_authorization_rest_bad_request( def test_get_authorization_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3763,7 +3753,7 @@ def test_get_authorization_rest_flattened(): def test_get_authorization_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3778,7 +3768,7 @@ def test_get_authorization_rest_flattened_error(transport: str = "rest"): def test_get_authorization_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3791,7 +3781,7 @@ def test_get_authorization_rest_error(): ) def test_create_deployment_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4014,7 +4004,7 @@ def test_create_deployment_rest_required_fields( assert "deploymentId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4026,7 +4016,7 @@ def test_create_deployment_rest_required_fields( jsonified_request["deploymentId"] = "deployment_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_deployment._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("deployment_id",)) @@ -4039,7 +4029,7 @@ def test_create_deployment_rest_required_fields( assert jsonified_request["deploymentId"] == "deployment_id_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4088,7 +4078,7 @@ def test_create_deployment_rest_required_fields( def test_create_deployment_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_deployment._get_unset_required_fields({}) @@ -4107,7 +4097,7 @@ def test_create_deployment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_deployment_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -4165,7 +4155,7 @@ def test_create_deployment_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.CreateDeploymentRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4187,7 +4177,7 @@ def test_create_deployment_rest_bad_request( def test_create_deployment_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4229,7 +4219,7 @@ def test_create_deployment_rest_flattened(): def test_create_deployment_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4246,7 +4236,7 @@ def test_create_deployment_rest_flattened_error(transport: str = "rest"): def test_create_deployment_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4259,7 +4249,7 @@ def test_create_deployment_rest_error(): ) def test_replace_deployment_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4479,21 +4469,21 @@ def test_replace_deployment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).replace_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).replace_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4536,7 +4526,7 @@ def test_replace_deployment_rest_required_fields( def test_replace_deployment_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.replace_deployment._get_unset_required_fields({}) @@ -4546,7 +4536,7 @@ def test_replace_deployment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_replace_deployment_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -4604,7 +4594,7 @@ def test_replace_deployment_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.ReplaceDeploymentRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4626,7 +4616,7 @@ def test_replace_deployment_rest_bad_request( def test_replace_deployment_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4669,7 +4659,7 @@ def test_replace_deployment_rest_flattened(): def test_replace_deployment_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4684,7 +4674,7 @@ def test_replace_deployment_rest_flattened_error(transport: str = "rest"): def test_replace_deployment_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4697,7 +4687,7 @@ def test_replace_deployment_rest_error(): ) def test_get_deployment_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4752,7 +4742,7 @@ def test_get_deployment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4761,7 +4751,7 @@ def test_get_deployment_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4770,7 +4760,7 @@ def test_get_deployment_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4812,7 +4802,7 @@ def test_get_deployment_rest_required_fields( def test_get_deployment_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_deployment._get_unset_required_fields({}) @@ -4822,7 +4812,7 @@ def test_get_deployment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_deployment_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -4880,7 +4870,7 @@ def test_get_deployment_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.GetDeploymentRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4902,7 +4892,7 @@ def test_get_deployment_rest_bad_request( def test_get_deployment_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4942,7 +4932,7 @@ def test_get_deployment_rest_flattened(): def test_get_deployment_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4957,7 +4947,7 @@ def test_get_deployment_rest_flattened_error(transport: str = "rest"): def test_get_deployment_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4970,7 +4960,7 @@ def test_get_deployment_rest_error(): ) def test_list_deployments_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5021,7 +5011,7 @@ def test_list_deployments_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_deployments._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5030,7 +5020,7 @@ def test_list_deployments_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_deployments._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -5046,7 +5036,7 @@ def test_list_deployments_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5088,7 +5078,7 @@ def test_list_deployments_rest_required_fields( def test_list_deployments_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_deployments._get_unset_required_fields({}) @@ -5106,7 +5096,7 @@ def test_list_deployments_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_deployments_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -5164,7 +5154,7 @@ def test_list_deployments_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.ListDeploymentsRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5186,7 +5176,7 @@ def test_list_deployments_rest_bad_request( def test_list_deployments_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5226,7 +5216,7 @@ def test_list_deployments_rest_flattened(): def test_list_deployments_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5241,7 +5231,7 @@ def test_list_deployments_rest_flattened_error(transport: str = "rest"): def test_list_deployments_rest_pager(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5311,7 +5301,7 @@ def test_list_deployments_rest_pager(transport: str = "rest"): ) def test_delete_deployment_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5357,7 +5347,7 @@ def test_delete_deployment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5366,7 +5356,7 @@ def test_delete_deployment_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_deployment._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("etag",)) @@ -5377,7 +5367,7 @@ def test_delete_deployment_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5416,7 +5406,7 @@ def test_delete_deployment_rest_required_fields( def test_delete_deployment_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_deployment._get_unset_required_fields({}) @@ -5426,7 +5416,7 @@ def test_delete_deployment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_deployment_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -5476,7 +5466,7 @@ def test_delete_deployment_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.DeleteDeploymentRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5498,7 +5488,7 @@ def test_delete_deployment_rest_bad_request( def test_delete_deployment_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5536,7 +5526,7 @@ def test_delete_deployment_rest_flattened(): def test_delete_deployment_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5551,7 +5541,7 @@ def test_delete_deployment_rest_flattened_error(transport: str = "rest"): def test_delete_deployment_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5564,7 +5554,7 @@ def test_delete_deployment_rest_error(): ) def test_install_deployment_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5610,7 +5600,7 @@ def test_install_deployment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).install_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5619,7 +5609,7 @@ def test_install_deployment_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).install_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5628,7 +5618,7 @@ def test_install_deployment_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5668,7 +5658,7 @@ def test_install_deployment_rest_required_fields( def test_install_deployment_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.install_deployment._get_unset_required_fields({}) @@ -5678,7 +5668,7 @@ def test_install_deployment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_install_deployment_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -5728,7 +5718,7 @@ def test_install_deployment_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.InstallDeploymentRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5750,7 +5740,7 @@ def test_install_deployment_rest_bad_request( def test_install_deployment_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5789,7 +5779,7 @@ def test_install_deployment_rest_flattened(): def test_install_deployment_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5804,7 +5794,7 @@ def test_install_deployment_rest_flattened_error(transport: str = "rest"): def test_install_deployment_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5817,7 +5807,7 @@ def test_install_deployment_rest_error(): ) def test_uninstall_deployment_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5863,7 +5853,7 @@ def test_uninstall_deployment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).uninstall_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5872,7 +5862,7 @@ def test_uninstall_deployment_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).uninstall_deployment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5881,7 +5871,7 @@ def test_uninstall_deployment_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5921,7 +5911,7 @@ def test_uninstall_deployment_rest_required_fields( def test_uninstall_deployment_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.uninstall_deployment._get_unset_required_fields({}) @@ -5931,7 +5921,7 @@ def test_uninstall_deployment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_uninstall_deployment_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -5981,7 +5971,7 @@ def test_uninstall_deployment_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.UninstallDeploymentRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6003,7 +5993,7 @@ def test_uninstall_deployment_rest_bad_request( def test_uninstall_deployment_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6042,7 +6032,7 @@ def test_uninstall_deployment_rest_flattened(): def test_uninstall_deployment_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6057,7 +6047,7 @@ def test_uninstall_deployment_rest_flattened_error(transport: str = "rest"): def test_uninstall_deployment_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6070,7 +6060,7 @@ def test_uninstall_deployment_rest_error(): ) def test_get_install_status_rest(request_type): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6121,7 +6111,7 @@ def test_get_install_status_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_install_status._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6130,7 +6120,7 @@ def test_get_install_status_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_install_status._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6139,7 +6129,7 @@ def test_get_install_status_rest_required_fields( assert jsonified_request["name"] == "name_value" client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6181,7 +6171,7 @@ def test_get_install_status_rest_required_fields( def test_get_install_status_rest_unset_required_fields(): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_install_status._get_unset_required_fields({}) @@ -6191,7 +6181,7 @@ def test_get_install_status_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_install_status_rest_interceptors(null_interceptor): transport = transports.GSuiteAddOnsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.GSuiteAddOnsRestInterceptor(), @@ -6249,7 +6239,7 @@ def test_get_install_status_rest_bad_request( transport: str = "rest", request_type=gsuiteaddons.GetInstallStatusRequest ): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6271,7 +6261,7 @@ def test_get_install_status_rest_bad_request( def test_get_install_status_rest_flattened(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6313,7 +6303,7 @@ def test_get_install_status_rest_flattened(): def test_get_install_status_rest_flattened_error(transport: str = "rest"): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6328,24 +6318,24 @@ def test_get_install_status_rest_flattened_error(transport: str = "rest"): def test_get_install_status_rest_error(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.GSuiteAddOnsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.GSuiteAddOnsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GSuiteAddOnsClient( @@ -6355,7 +6345,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.GSuiteAddOnsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -6370,13 +6360,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = GSuiteAddOnsClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.GSuiteAddOnsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GSuiteAddOnsClient( @@ -6388,7 +6377,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.GSuiteAddOnsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = GSuiteAddOnsClient(transport=transport) assert client.transport is transport @@ -6397,13 +6386,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.GSuiteAddOnsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.GSuiteAddOnsGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -6420,7 +6409,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -6434,7 +6423,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = GSuiteAddOnsClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -6442,7 +6431,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -6454,7 +6443,7 @@ def test_g_suite_add_ons_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.GSuiteAddOnsTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -6466,7 +6455,7 @@ def test_g_suite_add_ons_base_transport(): ) as Transport: Transport.return_value = None transport = transports.GSuiteAddOnsTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -6506,7 +6495,7 @@ def test_g_suite_add_ons_base_transport_with_credentials_file(): "google.cloud.gsuiteaddons_v1.services.g_suite_add_ons.transports.GSuiteAddOnsTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.GSuiteAddOnsTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -6525,7 +6514,7 @@ def test_g_suite_add_ons_base_transport_with_adc(): "google.cloud.gsuiteaddons_v1.services.g_suite_add_ons.transports.GSuiteAddOnsTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.GSuiteAddOnsTransport() adc.assert_called_once() @@ -6533,7 +6522,7 @@ def test_g_suite_add_ons_base_transport_with_adc(): def test_g_suite_add_ons_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) GSuiteAddOnsClient() adc.assert_called_once_with( scopes=None, @@ -6553,7 +6542,7 @@ def test_g_suite_add_ons_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -6600,7 +6589,7 @@ def test_g_suite_add_ons_transport_create_channel(transport_class, grpc_helpers) ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -6625,7 +6614,7 @@ def test_g_suite_add_ons_transport_create_channel(transport_class, grpc_helpers) [transports.GSuiteAddOnsGrpcTransport, transports.GSuiteAddOnsGrpcAsyncIOTransport], ) def test_g_suite_add_ons_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -6663,7 +6652,7 @@ def test_g_suite_add_ons_grpc_transport_client_cert_source_for_mtls(transport_cl def test_g_suite_add_ons_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -6683,7 +6672,7 @@ def test_g_suite_add_ons_http_transport_client_cert_source_for_mtls(): ) def test_g_suite_add_ons_host_no_port(transport_name): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gsuiteaddons.googleapis.com" ), @@ -6706,7 +6695,7 @@ def test_g_suite_add_ons_host_no_port(transport_name): ) def test_g_suite_add_ons_host_with_port(transport_name): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="gsuiteaddons.googleapis.com:8000" ), @@ -6726,8 +6715,8 @@ def test_g_suite_add_ons_host_with_port(transport_name): ], ) def test_g_suite_add_ons_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = GSuiteAddOnsClient( credentials=creds1, transport=transport_name, @@ -6812,7 +6801,7 @@ def test_g_suite_add_ons_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -7061,7 +7050,7 @@ def test_client_with_default_client_info(): transports.GSuiteAddOnsTransport, "_prep_wrapped_messages" ) as prep: client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7071,7 +7060,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = GSuiteAddOnsClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7080,7 +7069,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = GSuiteAddOnsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -7099,7 +7088,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -7116,7 +7105,7 @@ def test_client_ctx(): ] for transport in transports: client = GSuiteAddOnsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-iam-logging/google/cloud/iam_logging/gapic_version.py b/packages/google-cloud-iam-logging/google/cloud/iam_logging/gapic_version.py index 5f7437f6f8d0..360a0d13ebdd 100644 --- a/packages/google-cloud-iam-logging/google/cloud/iam_logging/gapic_version.py +++ b/packages/google-cloud-iam-logging/google/cloud/iam_logging/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.3.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam-logging/google/cloud/iam_logging_v1/gapic_version.py b/packages/google-cloud-iam-logging/google/cloud/iam_logging_v1/gapic_version.py index 5f7437f6f8d0..360a0d13ebdd 100644 --- a/packages/google-cloud-iam-logging/google/cloud/iam_logging_v1/gapic_version.py +++ b/packages/google-cloud-iam-logging/google/cloud/iam_logging_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.3.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam-logging/noxfile.py b/packages/google-cloud-iam-logging/noxfile.py index 7d3551347c78..1e6cd48d0529 100644 --- a/packages/google-cloud-iam-logging/noxfile.py +++ b/packages/google-cloud-iam-logging/noxfile.py @@ -282,6 +282,15 @@ def docs(session): session.install("-e", ".") session.install( + # We need to pin to specific versions of the `sphinxcontrib-*` packages + # which still support sphinx 4.x. + # See https://github.com/googleapis/sphinx-docfx-yaml/issues/344 + # and https://github.com/googleapis/sphinx-docfx-yaml/issues/345. + "sphinxcontrib-applehelp==1.0.4", + "sphinxcontrib-devhelp==1.0.2", + "sphinxcontrib-htmlhelp==2.0.1", + "sphinxcontrib-qthelp==1.0.3", + "sphinxcontrib-serializinghtml==1.1.5", "sphinx==4.5.0", "alabaster", "recommonmark", @@ -308,6 +317,15 @@ def docfx(session): session.install("-e", ".") session.install( + # We need to pin to specific versions of the `sphinxcontrib-*` packages + # which still support sphinx 4.x. + # See https://github.com/googleapis/sphinx-docfx-yaml/issues/344 + # and https://github.com/googleapis/sphinx-docfx-yaml/issues/345. + "sphinxcontrib-applehelp==1.0.4", + "sphinxcontrib-devhelp==1.0.2", + "sphinxcontrib-htmlhelp==2.0.1", + "sphinxcontrib-qthelp==1.0.3", + "sphinxcontrib-serializinghtml==1.1.5", "gcp-sphinx-docfx-yaml", "alabaster", "recommonmark", diff --git a/packages/google-cloud-iam-logging/setup.py b/packages/google-cloud-iam-logging/setup.py index 2dd757f6cd36..57d125a4dfe5 100644 --- a/packages/google-cloud-iam-logging/setup.py +++ b/packages/google-cloud-iam-logging/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", diff --git a/packages/google-cloud-iam-logging/testing/constraints-3.7.txt b/packages/google-cloud-iam-logging/testing/constraints-3.7.txt index 44ffd04543a8..712d45b4c5ea 100644 --- a/packages/google-cloud-iam-logging/testing/constraints-3.7.txt +++ b/packages/google-cloud-iam-logging/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 grpc-google-iam-v1==0.12.4 diff --git a/packages/google-cloud-iam/google/cloud/iam/gapic_version.py b/packages/google-cloud-iam/google/cloud/iam/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-iam/google/cloud/iam/gapic_version.py +++ b/packages/google-cloud-iam/google/cloud/iam/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam/google/cloud/iam_credentials/gapic_version.py b/packages/google-cloud-iam/google/cloud/iam_credentials/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-iam/google/cloud/iam_credentials/gapic_version.py +++ b/packages/google-cloud-iam/google/cloud/iam_credentials/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam/google/cloud/iam_credentials_v1/gapic_version.py b/packages/google-cloud-iam/google/cloud/iam_credentials_v1/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-iam/google/cloud/iam_credentials_v1/gapic_version.py +++ b/packages/google-cloud-iam/google/cloud/iam_credentials_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam/google/cloud/iam_credentials_v1/services/iam_credentials/client.py b/packages/google-cloud-iam/google/cloud/iam_credentials_v1/services/iam_credentials/client.py index bd6fdd97d4fc..5ededf66727e 100644 --- a/packages/google-cloud-iam/google/cloud/iam_credentials_v1/services/iam_credentials/client.py +++ b/packages/google-cloud-iam/google/cloud/iam_credentials_v1/services/iam_credentials/client.py @@ -392,6 +392,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -410,6 +411,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -484,17 +486,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = IAMCredentialsClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = IAMCredentialsClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-iam/google/cloud/iam_v2/gapic_version.py b/packages/google-cloud-iam/google/cloud/iam_v2/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-iam/google/cloud/iam_v2/gapic_version.py +++ b/packages/google-cloud-iam/google/cloud/iam_v2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam/google/cloud/iam_v2/services/policies/client.py b/packages/google-cloud-iam/google/cloud/iam_v2/services/policies/client.py index 35018070726e..cd4586d6df14 100644 --- a/packages/google-cloud-iam/google/cloud/iam_v2/services/policies/client.py +++ b/packages/google-cloud-iam/google/cloud/iam_v2/services/policies/client.py @@ -366,6 +366,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -384,6 +385,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -458,17 +460,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = PoliciesClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = PoliciesClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-iam/google/cloud/iam_v2beta/gapic_version.py b/packages/google-cloud-iam/google/cloud/iam_v2beta/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-iam/google/cloud/iam_v2beta/gapic_version.py +++ b/packages/google-cloud-iam/google/cloud/iam_v2beta/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iam/google/cloud/iam_v2beta/services/policies/client.py b/packages/google-cloud-iam/google/cloud/iam_v2beta/services/policies/client.py index 0208e4d53d70..51aed0001efb 100644 --- a/packages/google-cloud-iam/google/cloud/iam_v2beta/services/policies/client.py +++ b/packages/google-cloud-iam/google/cloud/iam_v2beta/services/policies/client.py @@ -364,6 +364,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -382,6 +383,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -456,17 +458,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = PoliciesClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = PoliciesClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.credentials.v1.json b/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.credentials.v1.json index 2e7ea2b943fb..1e024f5ce6ce 100644 --- a/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.credentials.v1.json +++ b/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.credentials.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-iam", - "version": "2.14.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2.json b/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2.json index 0cd6bc17b856..41cce8e24813 100644 --- a/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2.json +++ b/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-iam", - "version": "2.14.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2beta.json b/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2beta.json index c10ba4fae708..5c06ffb6bc77 100644 --- a/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2beta.json +++ b/packages/google-cloud-iam/samples/generated_samples/snippet_metadata_google.iam.v2beta.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-iam", - "version": "2.14.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-iam/setup.py b/packages/google-cloud-iam/setup.py index 7cfd298263e7..b0e2c41c9b26 100644 --- a/packages/google-cloud-iam/setup.py +++ b/packages/google-cloud-iam/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-iam/testing/constraints-3.7.txt b/packages/google-cloud-iam/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-iam/testing/constraints-3.7.txt +++ b/packages/google-cloud-iam/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-iam/tests/unit/gapic/iam_credentials_v1/test_iam_credentials.py b/packages/google-cloud-iam/tests/unit/gapic/iam_credentials_v1/test_iam_credentials.py index 481a43bcf6df..6ee372e29e0c 100644 --- a/packages/google-cloud-iam/tests/unit/gapic/iam_credentials_v1/test_iam_credentials.py +++ b/packages/google-cloud-iam/tests/unit/gapic/iam_credentials_v1/test_iam_credentials.py @@ -78,18 +78,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -316,7 +304,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -343,42 +331,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -389,7 +384,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_iam_credentials_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -441,7 +436,7 @@ def test_iam_credentials_client_service_account_always_use_jwt( ], ) def test_iam_credentials_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -504,9 +499,7 @@ def test_iam_credentials_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(IAMCredentialsClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -905,20 +898,20 @@ def test_iam_credentials_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -930,13 +923,11 @@ def test_iam_credentials_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -952,8 +943,7 @@ def test_iam_credentials_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1106,8 +1096,8 @@ def test_iam_credentials_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1136,7 +1126,7 @@ def test_iam_credentials_client_create_channel_credentials_file( ) def test_generate_access_token(request_type, transport: str = "grpc"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1168,7 +1158,7 @@ def test_generate_access_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1187,7 +1177,7 @@ async def test_generate_access_token_async( transport: str = "grpc_asyncio", request_type=common.GenerateAccessTokenRequest ): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1224,7 +1214,7 @@ async def test_generate_access_token_async_from_dict(): def test_generate_access_token_field_headers(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1256,7 +1246,7 @@ def test_generate_access_token_field_headers(): @pytest.mark.asyncio async def test_generate_access_token_field_headers_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1289,7 +1279,7 @@ async def test_generate_access_token_field_headers_async(): def test_generate_access_token_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1327,7 +1317,7 @@ def test_generate_access_token_flattened(): def test_generate_access_token_flattened_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1345,7 +1335,7 @@ def test_generate_access_token_flattened_error(): @pytest.mark.asyncio async def test_generate_access_token_flattened_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1388,7 +1378,7 @@ async def test_generate_access_token_flattened_async(): @pytest.mark.asyncio async def test_generate_access_token_flattened_error_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1412,7 +1402,7 @@ async def test_generate_access_token_flattened_error_async(): ) def test_generate_id_token(request_type, transport: str = "grpc"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1444,7 +1434,7 @@ def test_generate_id_token_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1463,7 +1453,7 @@ async def test_generate_id_token_async( transport: str = "grpc_asyncio", request_type=common.GenerateIdTokenRequest ): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1500,7 +1490,7 @@ async def test_generate_id_token_async_from_dict(): def test_generate_id_token_field_headers(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1532,7 +1522,7 @@ def test_generate_id_token_field_headers(): @pytest.mark.asyncio async def test_generate_id_token_field_headers_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1565,7 +1555,7 @@ async def test_generate_id_token_field_headers_async(): def test_generate_id_token_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1603,7 +1593,7 @@ def test_generate_id_token_flattened(): def test_generate_id_token_flattened_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1621,7 +1611,7 @@ def test_generate_id_token_flattened_error(): @pytest.mark.asyncio async def test_generate_id_token_flattened_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1664,7 +1654,7 @@ async def test_generate_id_token_flattened_async(): @pytest.mark.asyncio async def test_generate_id_token_flattened_error_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1688,7 +1678,7 @@ async def test_generate_id_token_flattened_error_async(): ) def test_sign_blob(request_type, transport: str = "grpc"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1720,7 +1710,7 @@ def test_sign_blob_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1737,7 +1727,7 @@ async def test_sign_blob_async( transport: str = "grpc_asyncio", request_type=common.SignBlobRequest ): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1774,7 +1764,7 @@ async def test_sign_blob_async_from_dict(): def test_sign_blob_field_headers(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1804,7 +1794,7 @@ def test_sign_blob_field_headers(): @pytest.mark.asyncio async def test_sign_blob_field_headers_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1835,7 +1825,7 @@ async def test_sign_blob_field_headers_async(): def test_sign_blob_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1867,7 +1857,7 @@ def test_sign_blob_flattened(): def test_sign_blob_flattened_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1884,7 +1874,7 @@ def test_sign_blob_flattened_error(): @pytest.mark.asyncio async def test_sign_blob_flattened_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1921,7 +1911,7 @@ async def test_sign_blob_flattened_async(): @pytest.mark.asyncio async def test_sign_blob_flattened_error_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1944,7 +1934,7 @@ async def test_sign_blob_flattened_error_async(): ) def test_sign_jwt(request_type, transport: str = "grpc"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1976,7 +1966,7 @@ def test_sign_jwt_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1993,7 +1983,7 @@ async def test_sign_jwt_async( transport: str = "grpc_asyncio", request_type=common.SignJwtRequest ): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2030,7 +2020,7 @@ async def test_sign_jwt_async_from_dict(): def test_sign_jwt_field_headers(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2060,7 +2050,7 @@ def test_sign_jwt_field_headers(): @pytest.mark.asyncio async def test_sign_jwt_field_headers_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2091,7 +2081,7 @@ async def test_sign_jwt_field_headers_async(): def test_sign_jwt_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2123,7 +2113,7 @@ def test_sign_jwt_flattened(): def test_sign_jwt_flattened_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2140,7 +2130,7 @@ def test_sign_jwt_flattened_error(): @pytest.mark.asyncio async def test_sign_jwt_flattened_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2177,7 +2167,7 @@ async def test_sign_jwt_flattened_async(): @pytest.mark.asyncio async def test_sign_jwt_flattened_error_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2200,7 +2190,7 @@ async def test_sign_jwt_flattened_error_async(): ) def test_generate_access_token_rest(request_type): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2252,7 +2242,7 @@ def test_generate_access_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_access_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2262,7 +2252,7 @@ def test_generate_access_token_rest_required_fields( jsonified_request["scope"] = "scope_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_access_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2273,7 +2263,7 @@ def test_generate_access_token_rest_required_fields( assert jsonified_request["scope"] == "scope_value" client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2316,7 +2306,7 @@ def test_generate_access_token_rest_required_fields( def test_generate_access_token_rest_unset_required_fields(): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.generate_access_token._get_unset_required_fields({}) @@ -2334,7 +2324,7 @@ def test_generate_access_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_access_token_rest_interceptors(null_interceptor): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IAMCredentialsRestInterceptor(), @@ -2392,7 +2382,7 @@ def test_generate_access_token_rest_bad_request( transport: str = "rest", request_type=common.GenerateAccessTokenRequest ): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2414,7 +2404,7 @@ def test_generate_access_token_rest_bad_request( def test_generate_access_token_rest_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2459,7 +2449,7 @@ def test_generate_access_token_rest_flattened(): def test_generate_access_token_rest_flattened_error(transport: str = "rest"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2477,7 +2467,7 @@ def test_generate_access_token_rest_flattened_error(transport: str = "rest"): def test_generate_access_token_rest_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2490,7 +2480,7 @@ def test_generate_access_token_rest_error(): ) def test_generate_id_token_rest(request_type): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2542,7 +2532,7 @@ def test_generate_id_token_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_id_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2552,7 +2542,7 @@ def test_generate_id_token_rest_required_fields( jsonified_request["audience"] = "audience_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).generate_id_token._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2563,7 +2553,7 @@ def test_generate_id_token_rest_required_fields( assert jsonified_request["audience"] == "audience_value" client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2606,7 +2596,7 @@ def test_generate_id_token_rest_required_fields( def test_generate_id_token_rest_unset_required_fields(): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.generate_id_token._get_unset_required_fields({}) @@ -2624,7 +2614,7 @@ def test_generate_id_token_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_id_token_rest_interceptors(null_interceptor): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IAMCredentialsRestInterceptor(), @@ -2680,7 +2670,7 @@ def test_generate_id_token_rest_bad_request( transport: str = "rest", request_type=common.GenerateIdTokenRequest ): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2702,7 +2692,7 @@ def test_generate_id_token_rest_bad_request( def test_generate_id_token_rest_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2747,7 +2737,7 @@ def test_generate_id_token_rest_flattened(): def test_generate_id_token_rest_flattened_error(transport: str = "rest"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2765,7 +2755,7 @@ def test_generate_id_token_rest_flattened_error(transport: str = "rest"): def test_generate_id_token_rest_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2778,7 +2768,7 @@ def test_generate_id_token_rest_error(): ) def test_sign_blob_rest(request_type): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2830,7 +2820,7 @@ def test_sign_blob_rest_required_fields(request_type=common.SignBlobRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).sign_blob._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2840,7 +2830,7 @@ def test_sign_blob_rest_required_fields(request_type=common.SignBlobRequest): jsonified_request["payload"] = b"payload_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).sign_blob._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2851,7 +2841,7 @@ def test_sign_blob_rest_required_fields(request_type=common.SignBlobRequest): assert jsonified_request["payload"] == b"payload_blob" client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2894,7 +2884,7 @@ def test_sign_blob_rest_required_fields(request_type=common.SignBlobRequest): def test_sign_blob_rest_unset_required_fields(): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.sign_blob._get_unset_required_fields({}) @@ -2912,7 +2902,7 @@ def test_sign_blob_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_sign_blob_rest_interceptors(null_interceptor): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IAMCredentialsRestInterceptor(), @@ -2968,7 +2958,7 @@ def test_sign_blob_rest_bad_request( transport: str = "rest", request_type=common.SignBlobRequest ): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2990,7 +2980,7 @@ def test_sign_blob_rest_bad_request( def test_sign_blob_rest_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3034,7 +3024,7 @@ def test_sign_blob_rest_flattened(): def test_sign_blob_rest_flattened_error(transport: str = "rest"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3051,7 +3041,7 @@ def test_sign_blob_rest_flattened_error(transport: str = "rest"): def test_sign_blob_rest_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3064,7 +3054,7 @@ def test_sign_blob_rest_error(): ) def test_sign_jwt_rest(request_type): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3116,7 +3106,7 @@ def test_sign_jwt_rest_required_fields(request_type=common.SignJwtRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).sign_jwt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3126,7 +3116,7 @@ def test_sign_jwt_rest_required_fields(request_type=common.SignJwtRequest): jsonified_request["payload"] = "payload_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).sign_jwt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3137,7 +3127,7 @@ def test_sign_jwt_rest_required_fields(request_type=common.SignJwtRequest): assert jsonified_request["payload"] == "payload_value" client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3180,7 +3170,7 @@ def test_sign_jwt_rest_required_fields(request_type=common.SignJwtRequest): def test_sign_jwt_rest_unset_required_fields(): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.sign_jwt._get_unset_required_fields({}) @@ -3198,7 +3188,7 @@ def test_sign_jwt_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_sign_jwt_rest_interceptors(null_interceptor): transport = transports.IAMCredentialsRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IAMCredentialsRestInterceptor(), @@ -3254,7 +3244,7 @@ def test_sign_jwt_rest_bad_request( transport: str = "rest", request_type=common.SignJwtRequest ): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3276,7 +3266,7 @@ def test_sign_jwt_rest_bad_request( def test_sign_jwt_rest_flattened(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3320,7 +3310,7 @@ def test_sign_jwt_rest_flattened(): def test_sign_jwt_rest_flattened_error(transport: str = "rest"): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3337,24 +3327,24 @@ def test_sign_jwt_rest_flattened_error(transport: str = "rest"): def test_sign_jwt_rest_error(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.IAMCredentialsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.IAMCredentialsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IAMCredentialsClient( @@ -3364,7 +3354,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.IAMCredentialsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3379,13 +3369,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = IAMCredentialsClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.IAMCredentialsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IAMCredentialsClient( @@ -3397,7 +3386,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.IAMCredentialsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = IAMCredentialsClient(transport=transport) assert client.transport is transport @@ -3406,13 +3395,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.IAMCredentialsGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.IAMCredentialsGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3429,7 +3418,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3443,7 +3432,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = IAMCredentialsClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3451,7 +3440,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3463,7 +3452,7 @@ def test_iam_credentials_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.IAMCredentialsTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3475,7 +3464,7 @@ def test_iam_credentials_base_transport(): ) as Transport: Transport.return_value = None transport = transports.IAMCredentialsTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3510,7 +3499,7 @@ def test_iam_credentials_base_transport_with_credentials_file(): "google.cloud.iam_credentials_v1.services.iam_credentials.transports.IAMCredentialsTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IAMCredentialsTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3529,7 +3518,7 @@ def test_iam_credentials_base_transport_with_adc(): "google.cloud.iam_credentials_v1.services.iam_credentials.transports.IAMCredentialsTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IAMCredentialsTransport() adc.assert_called_once() @@ -3537,7 +3526,7 @@ def test_iam_credentials_base_transport_with_adc(): def test_iam_credentials_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) IAMCredentialsClient() adc.assert_called_once_with( scopes=None, @@ -3557,7 +3546,7 @@ def test_iam_credentials_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -3604,7 +3593,7 @@ def test_iam_credentials_transport_create_channel(transport_class, grpc_helpers) ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -3632,7 +3621,7 @@ def test_iam_credentials_transport_create_channel(transport_class, grpc_helpers) ], ) def test_iam_credentials_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -3670,7 +3659,7 @@ def test_iam_credentials_grpc_transport_client_cert_source_for_mtls(transport_cl def test_iam_credentials_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -3690,7 +3679,7 @@ def test_iam_credentials_http_transport_client_cert_source_for_mtls(): ) def test_iam_credentials_host_no_port(transport_name): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="iamcredentials.googleapis.com" ), @@ -3713,7 +3702,7 @@ def test_iam_credentials_host_no_port(transport_name): ) def test_iam_credentials_host_with_port(transport_name): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="iamcredentials.googleapis.com:8000" ), @@ -3733,8 +3722,8 @@ def test_iam_credentials_host_with_port(transport_name): ], ) def test_iam_credentials_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = IAMCredentialsClient( credentials=creds1, transport=transport_name, @@ -3807,7 +3796,7 @@ def test_iam_credentials_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4016,7 +4005,7 @@ def test_client_with_default_client_info(): transports.IAMCredentialsTransport, "_prep_wrapped_messages" ) as prep: client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4026,7 +4015,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = IAMCredentialsClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4035,7 +4024,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = IAMCredentialsAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4054,7 +4043,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4071,7 +4060,7 @@ def test_client_ctx(): ] for transport in transports: client = IAMCredentialsClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-iam/tests/unit/gapic/iam_v2/test_policies.py b/packages/google-cloud-iam/tests/unit/gapic/iam_v2/test_policies.py index fac5a60fbadb..a5d3ab477289 100644 --- a/packages/google-cloud-iam/tests/unit/gapic/iam_v2/test_policies.py +++ b/packages/google-cloud-iam/tests/unit/gapic/iam_v2/test_policies.py @@ -91,18 +91,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -301,7 +289,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -328,42 +316,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -374,7 +369,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_policies_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -426,7 +421,7 @@ def test_policies_client_service_account_always_use_jwt( ], ) def test_policies_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -483,9 +478,7 @@ def test_policies_client_get_transport_class(): def test_policies_client_client_options(client_class, transport_class, transport_name): # Check that if channel is provided we won't create a new one. with mock.patch.object(PoliciesClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -878,20 +871,20 @@ def test_policies_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -903,13 +896,11 @@ def test_policies_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -925,8 +916,7 @@ def test_policies_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1063,8 +1053,8 @@ def test_policies_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1093,7 +1083,7 @@ def test_policies_client_create_channel_credentials_file( ) def test_list_policies(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1123,7 +1113,7 @@ def test_list_policies_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1140,7 +1130,7 @@ async def test_list_policies_async( transport: str = "grpc_asyncio", request_type=policy.ListPoliciesRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1175,7 +1165,7 @@ async def test_list_policies_async_from_dict(): def test_list_policies_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1205,7 +1195,7 @@ def test_list_policies_field_headers(): @pytest.mark.asyncio async def test_list_policies_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1236,7 +1226,7 @@ async def test_list_policies_field_headers_async(): def test_list_policies_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1260,7 +1250,7 @@ def test_list_policies_flattened(): def test_list_policies_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1275,7 +1265,7 @@ def test_list_policies_flattened_error(): @pytest.mark.asyncio async def test_list_policies_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1304,7 +1294,7 @@ async def test_list_policies_flattened_async(): @pytest.mark.asyncio async def test_list_policies_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1318,7 +1308,7 @@ async def test_list_policies_flattened_error_async(): def test_list_policies_pager(transport_name: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1368,7 +1358,7 @@ def test_list_policies_pager(transport_name: str = "grpc"): def test_list_policies_pages(transport_name: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1410,7 +1400,7 @@ def test_list_policies_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_policies_async_pager(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1460,7 +1450,7 @@ async def test_list_policies_async_pager(): @pytest.mark.asyncio async def test_list_policies_async_pages(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1515,7 +1505,7 @@ async def test_list_policies_async_pages(): ) def test_get_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1555,7 +1545,7 @@ def test_get_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1572,7 +1562,7 @@ async def test_get_policy_async( transport: str = "grpc_asyncio", request_type=policy.GetPolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1617,7 +1607,7 @@ async def test_get_policy_async_from_dict(): def test_get_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1647,7 +1637,7 @@ def test_get_policy_field_headers(): @pytest.mark.asyncio async def test_get_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1676,7 +1666,7 @@ async def test_get_policy_field_headers_async(): def test_get_policy_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1700,7 +1690,7 @@ def test_get_policy_flattened(): def test_get_policy_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1715,7 +1705,7 @@ def test_get_policy_flattened_error(): @pytest.mark.asyncio async def test_get_policy_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1742,7 +1732,7 @@ async def test_get_policy_flattened_async(): @pytest.mark.asyncio async def test_get_policy_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1763,7 +1753,7 @@ async def test_get_policy_flattened_error_async(): ) def test_create_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1790,7 +1780,7 @@ def test_create_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1807,7 +1797,7 @@ async def test_create_policy_async( transport: str = "grpc_asyncio", request_type=gi_policy.CreatePolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1839,7 +1829,7 @@ async def test_create_policy_async_from_dict(): def test_create_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1869,7 +1859,7 @@ def test_create_policy_field_headers(): @pytest.mark.asyncio async def test_create_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1900,7 +1890,7 @@ async def test_create_policy_field_headers_async(): def test_create_policy_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1932,7 +1922,7 @@ def test_create_policy_flattened(): def test_create_policy_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1949,7 +1939,7 @@ def test_create_policy_flattened_error(): @pytest.mark.asyncio async def test_create_policy_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1986,7 +1976,7 @@ async def test_create_policy_flattened_async(): @pytest.mark.asyncio async def test_create_policy_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2009,7 +1999,7 @@ async def test_create_policy_flattened_error_async(): ) def test_update_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2036,7 +2026,7 @@ def test_update_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2053,7 +2043,7 @@ async def test_update_policy_async( transport: str = "grpc_asyncio", request_type=policy.UpdatePolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2085,7 +2075,7 @@ async def test_update_policy_async_from_dict(): def test_update_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2115,7 +2105,7 @@ def test_update_policy_field_headers(): @pytest.mark.asyncio async def test_update_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2153,7 +2143,7 @@ async def test_update_policy_field_headers_async(): ) def test_delete_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2180,7 +2170,7 @@ def test_delete_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2197,7 +2187,7 @@ async def test_delete_policy_async( transport: str = "grpc_asyncio", request_type=policy.DeletePolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2229,7 +2219,7 @@ async def test_delete_policy_async_from_dict(): def test_delete_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2259,7 +2249,7 @@ def test_delete_policy_field_headers(): @pytest.mark.asyncio async def test_delete_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2290,7 +2280,7 @@ async def test_delete_policy_field_headers_async(): def test_delete_policy_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2314,7 +2304,7 @@ def test_delete_policy_flattened(): def test_delete_policy_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2329,7 +2319,7 @@ def test_delete_policy_flattened_error(): @pytest.mark.asyncio async def test_delete_policy_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2358,7 +2348,7 @@ async def test_delete_policy_flattened_async(): @pytest.mark.asyncio async def test_delete_policy_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2379,7 +2369,7 @@ async def test_delete_policy_flattened_error_async(): ) def test_list_policies_rest(request_type): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2428,7 +2418,7 @@ def test_list_policies_rest_required_fields(request_type=policy.ListPoliciesRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_policies._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2437,7 +2427,7 @@ def test_list_policies_rest_required_fields(request_type=policy.ListPoliciesRequ jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_policies._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -2453,7 +2443,7 @@ def test_list_policies_rest_required_fields(request_type=policy.ListPoliciesRequ assert jsonified_request["parent"] == "parent_value" client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2495,7 +2485,7 @@ def test_list_policies_rest_required_fields(request_type=policy.ListPoliciesRequ def test_list_policies_rest_unset_required_fields(): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_policies._get_unset_required_fields({}) @@ -2513,7 +2503,7 @@ def test_list_policies_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_policies_rest_interceptors(null_interceptor): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.PoliciesRestInterceptor(), ) client = PoliciesClient(transport=transport) @@ -2567,7 +2557,7 @@ def test_list_policies_rest_bad_request( transport: str = "rest", request_type=policy.ListPoliciesRequest ): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2589,7 +2579,7 @@ def test_list_policies_rest_bad_request( def test_list_policies_rest_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2629,7 +2619,7 @@ def test_list_policies_rest_flattened(): def test_list_policies_rest_flattened_error(transport: str = "rest"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2644,7 +2634,7 @@ def test_list_policies_rest_flattened_error(transport: str = "rest"): def test_list_policies_rest_pager(transport: str = "rest"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2712,7 +2702,7 @@ def test_list_policies_rest_pager(transport: str = "rest"): ) def test_get_policy_rest(request_type): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2771,7 +2761,7 @@ def test_get_policy_rest_required_fields(request_type=policy.GetPolicyRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2780,7 +2770,7 @@ def test_get_policy_rest_required_fields(request_type=policy.GetPolicyRequest): jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2789,7 +2779,7 @@ def test_get_policy_rest_required_fields(request_type=policy.GetPolicyRequest): assert jsonified_request["name"] == "name_value" client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2831,7 +2821,7 @@ def test_get_policy_rest_required_fields(request_type=policy.GetPolicyRequest): def test_get_policy_rest_unset_required_fields(): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_policy._get_unset_required_fields({}) @@ -2841,7 +2831,7 @@ def test_get_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_policy_rest_interceptors(null_interceptor): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.PoliciesRestInterceptor(), ) client = PoliciesClient(transport=transport) @@ -2893,7 +2883,7 @@ def test_get_policy_rest_bad_request( transport: str = "rest", request_type=policy.GetPolicyRequest ): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2915,7 +2905,7 @@ def test_get_policy_rest_bad_request( def test_get_policy_rest_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2955,7 +2945,7 @@ def test_get_policy_rest_flattened(): def test_get_policy_rest_flattened_error(transport: str = "rest"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2970,7 +2960,7 @@ def test_get_policy_rest_flattened_error(transport: str = "rest"): def test_get_policy_rest_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2983,7 +2973,7 @@ def test_get_policy_rest_error(): ) def test_create_policy_rest(request_type): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3135,7 +3125,7 @@ def test_create_policy_rest_required_fields(request_type=gi_policy.CreatePolicyR # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3144,7 +3134,7 @@ def test_create_policy_rest_required_fields(request_type=gi_policy.CreatePolicyR jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_policy._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("policy_id",)) @@ -3155,7 +3145,7 @@ def test_create_policy_rest_required_fields(request_type=gi_policy.CreatePolicyR assert jsonified_request["parent"] == "parent_value" client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3195,7 +3185,7 @@ def test_create_policy_rest_required_fields(request_type=gi_policy.CreatePolicyR def test_create_policy_rest_unset_required_fields(): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_policy._get_unset_required_fields({}) @@ -3213,7 +3203,7 @@ def test_create_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_policy_rest_interceptors(null_interceptor): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.PoliciesRestInterceptor(), ) client = PoliciesClient(transport=transport) @@ -3269,7 +3259,7 @@ def test_create_policy_rest_bad_request( transport: str = "rest", request_type=gi_policy.CreatePolicyRequest ): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3291,7 +3281,7 @@ def test_create_policy_rest_bad_request( def test_create_policy_rest_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3331,7 +3321,7 @@ def test_create_policy_rest_flattened(): def test_create_policy_rest_flattened_error(transport: str = "rest"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3348,7 +3338,7 @@ def test_create_policy_rest_flattened_error(transport: str = "rest"): def test_create_policy_rest_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3361,7 +3351,7 @@ def test_create_policy_rest_error(): ) def test_update_policy_rest(request_type): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3512,21 +3502,21 @@ def test_update_policy_rest_required_fields(request_type=policy.UpdatePolicyRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3566,7 +3556,7 @@ def test_update_policy_rest_required_fields(request_type=policy.UpdatePolicyRequ def test_update_policy_rest_unset_required_fields(): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_policy._get_unset_required_fields({}) @@ -3576,7 +3566,7 @@ def test_update_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_policy_rest_interceptors(null_interceptor): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.PoliciesRestInterceptor(), ) client = PoliciesClient(transport=transport) @@ -3632,7 +3622,7 @@ def test_update_policy_rest_bad_request( transport: str = "rest", request_type=policy.UpdatePolicyRequest ): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3654,7 +3644,7 @@ def test_update_policy_rest_bad_request( def test_update_policy_rest_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3667,7 +3657,7 @@ def test_update_policy_rest_error(): ) def test_delete_policy_rest(request_type): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3711,7 +3701,7 @@ def test_delete_policy_rest_required_fields(request_type=policy.DeletePolicyRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3720,7 +3710,7 @@ def test_delete_policy_rest_required_fields(request_type=policy.DeletePolicyRequ jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_policy._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("etag",)) @@ -3731,7 +3721,7 @@ def test_delete_policy_rest_required_fields(request_type=policy.DeletePolicyRequ assert jsonified_request["name"] == "name_value" client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3770,7 +3760,7 @@ def test_delete_policy_rest_required_fields(request_type=policy.DeletePolicyRequ def test_delete_policy_rest_unset_required_fields(): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_policy._get_unset_required_fields({}) @@ -3780,7 +3770,7 @@ def test_delete_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_policy_rest_interceptors(null_interceptor): transport = transports.PoliciesRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.PoliciesRestInterceptor(), ) client = PoliciesClient(transport=transport) @@ -3836,7 +3826,7 @@ def test_delete_policy_rest_bad_request( transport: str = "rest", request_type=policy.DeletePolicyRequest ): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3858,7 +3848,7 @@ def test_delete_policy_rest_bad_request( def test_delete_policy_rest_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3896,7 +3886,7 @@ def test_delete_policy_rest_flattened(): def test_delete_policy_rest_flattened_error(transport: str = "rest"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3911,24 +3901,24 @@ def test_delete_policy_rest_flattened_error(transport: str = "rest"): def test_delete_policy_rest_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PoliciesClient( @@ -3938,7 +3928,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3953,13 +3943,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = PoliciesClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PoliciesClient( @@ -3971,7 +3960,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = PoliciesClient(transport=transport) assert client.transport is transport @@ -3980,13 +3969,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.PoliciesGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4003,7 +3992,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4017,7 +4006,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = PoliciesClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4025,7 +4014,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4037,7 +4026,7 @@ def test_policies_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.PoliciesTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4049,7 +4038,7 @@ def test_policies_base_transport(): ) as Transport: Transport.return_value = None transport = transports.PoliciesTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4091,7 +4080,7 @@ def test_policies_base_transport_with_credentials_file(): "google.cloud.iam_v2.services.policies.transports.PoliciesTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.PoliciesTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4110,7 +4099,7 @@ def test_policies_base_transport_with_adc(): "google.cloud.iam_v2.services.policies.transports.PoliciesTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.PoliciesTransport() adc.assert_called_once() @@ -4118,7 +4107,7 @@ def test_policies_base_transport_with_adc(): def test_policies_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) PoliciesClient() adc.assert_called_once_with( scopes=None, @@ -4138,7 +4127,7 @@ def test_policies_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4185,7 +4174,7 @@ def test_policies_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4210,7 +4199,7 @@ def test_policies_transport_create_channel(transport_class, grpc_helpers): [transports.PoliciesGrpcTransport, transports.PoliciesGrpcAsyncIOTransport], ) def test_policies_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4248,7 +4237,7 @@ def test_policies_grpc_transport_client_cert_source_for_mtls(transport_class): def test_policies_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -4260,7 +4249,7 @@ def test_policies_http_transport_client_cert_source_for_mtls(): def test_policies_rest_lro_client(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -4285,7 +4274,7 @@ def test_policies_rest_lro_client(): ) def test_policies_host_no_port(transport_name): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="iam.googleapis.com"), transport=transport_name, ) @@ -4306,7 +4295,7 @@ def test_policies_host_no_port(transport_name): ) def test_policies_host_with_port(transport_name): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="iam.googleapis.com:8000" ), @@ -4326,8 +4315,8 @@ def test_policies_host_with_port(transport_name): ], ) def test_policies_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = PoliciesClient( credentials=creds1, transport=transport_name, @@ -4398,7 +4387,7 @@ def test_policies_transport_channel_mtls_with_client_cert_source(transport_class mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4473,7 +4462,7 @@ def test_policies_transport_channel_mtls_with_adc(transport_class): def test_policies_grpc_lro_client(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -4490,7 +4479,7 @@ def test_policies_grpc_lro_client(): def test_policies_grpc_lro_async_client(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -4615,7 +4604,7 @@ def test_client_with_default_client_info(): transports.PoliciesTransport, "_prep_wrapped_messages" ) as prep: client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4625,7 +4614,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = PoliciesClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4634,7 +4623,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4649,7 +4638,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4679,7 +4668,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "policies/sample1/sample2/sample3/operations/sample4"} @@ -4705,7 +4694,7 @@ def test_get_operation_rest(request_type): def test_get_operation(transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4730,7 +4719,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4756,7 +4745,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4785,7 +4774,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4814,7 +4803,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -4832,7 +4821,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -4856,7 +4845,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4873,7 +4862,7 @@ def test_client_ctx(): ] for transport in transports: client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-iam/tests/unit/gapic/iam_v2beta/test_policies.py b/packages/google-cloud-iam/tests/unit/gapic/iam_v2beta/test_policies.py index 22db118dc1a7..857bcb6e76ac 100644 --- a/packages/google-cloud-iam/tests/unit/gapic/iam_v2beta/test_policies.py +++ b/packages/google-cloud-iam/tests/unit/gapic/iam_v2beta/test_policies.py @@ -86,18 +86,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -295,7 +283,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -322,42 +310,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -367,7 +362,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_policies_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -413,7 +408,7 @@ def test_policies_client_service_account_always_use_jwt( ], ) def test_policies_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -464,9 +459,7 @@ def test_policies_client_get_transport_class(): def test_policies_client_client_options(client_class, transport_class, transport_name): # Check that if channel is provided we won't create a new one. with mock.patch.object(PoliciesClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -857,20 +850,20 @@ def test_policies_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -882,13 +875,11 @@ def test_policies_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -904,8 +895,7 @@ def test_policies_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1040,8 +1030,8 @@ def test_policies_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1070,7 +1060,7 @@ def test_policies_client_create_channel_credentials_file( ) def test_list_policies(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1100,7 +1090,7 @@ def test_list_policies_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1117,7 +1107,7 @@ async def test_list_policies_async( transport: str = "grpc_asyncio", request_type=policy.ListPoliciesRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1152,7 +1142,7 @@ async def test_list_policies_async_from_dict(): def test_list_policies_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1182,7 +1172,7 @@ def test_list_policies_field_headers(): @pytest.mark.asyncio async def test_list_policies_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1213,7 +1203,7 @@ async def test_list_policies_field_headers_async(): def test_list_policies_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1237,7 +1227,7 @@ def test_list_policies_flattened(): def test_list_policies_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1252,7 +1242,7 @@ def test_list_policies_flattened_error(): @pytest.mark.asyncio async def test_list_policies_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1281,7 +1271,7 @@ async def test_list_policies_flattened_async(): @pytest.mark.asyncio async def test_list_policies_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1295,7 +1285,7 @@ async def test_list_policies_flattened_error_async(): def test_list_policies_pager(transport_name: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1345,7 +1335,7 @@ def test_list_policies_pager(transport_name: str = "grpc"): def test_list_policies_pages(transport_name: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1387,7 +1377,7 @@ def test_list_policies_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_policies_async_pager(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1437,7 +1427,7 @@ async def test_list_policies_async_pager(): @pytest.mark.asyncio async def test_list_policies_async_pages(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1492,7 +1482,7 @@ async def test_list_policies_async_pages(): ) def test_get_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1530,7 +1520,7 @@ def test_get_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1547,7 +1537,7 @@ async def test_get_policy_async( transport: str = "grpc_asyncio", request_type=policy.GetPolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1590,7 +1580,7 @@ async def test_get_policy_async_from_dict(): def test_get_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1620,7 +1610,7 @@ def test_get_policy_field_headers(): @pytest.mark.asyncio async def test_get_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1649,7 +1639,7 @@ async def test_get_policy_field_headers_async(): def test_get_policy_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1673,7 +1663,7 @@ def test_get_policy_flattened(): def test_get_policy_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1688,7 +1678,7 @@ def test_get_policy_flattened_error(): @pytest.mark.asyncio async def test_get_policy_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1715,7 +1705,7 @@ async def test_get_policy_flattened_async(): @pytest.mark.asyncio async def test_get_policy_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1736,7 +1726,7 @@ async def test_get_policy_flattened_error_async(): ) def test_create_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1763,7 +1753,7 @@ def test_create_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1780,7 +1770,7 @@ async def test_create_policy_async( transport: str = "grpc_asyncio", request_type=gi_policy.CreatePolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1812,7 +1802,7 @@ async def test_create_policy_async_from_dict(): def test_create_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1842,7 +1832,7 @@ def test_create_policy_field_headers(): @pytest.mark.asyncio async def test_create_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1873,7 +1863,7 @@ async def test_create_policy_field_headers_async(): def test_create_policy_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1905,7 +1895,7 @@ def test_create_policy_flattened(): def test_create_policy_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1922,7 +1912,7 @@ def test_create_policy_flattened_error(): @pytest.mark.asyncio async def test_create_policy_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1959,7 +1949,7 @@ async def test_create_policy_flattened_async(): @pytest.mark.asyncio async def test_create_policy_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1982,7 +1972,7 @@ async def test_create_policy_flattened_error_async(): ) def test_update_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2009,7 +1999,7 @@ def test_update_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2026,7 +2016,7 @@ async def test_update_policy_async( transport: str = "grpc_asyncio", request_type=policy.UpdatePolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2058,7 +2048,7 @@ async def test_update_policy_async_from_dict(): def test_update_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2088,7 +2078,7 @@ def test_update_policy_field_headers(): @pytest.mark.asyncio async def test_update_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2126,7 +2116,7 @@ async def test_update_policy_field_headers_async(): ) def test_delete_policy(request_type, transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2153,7 +2143,7 @@ def test_delete_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2170,7 +2160,7 @@ async def test_delete_policy_async( transport: str = "grpc_asyncio", request_type=policy.DeletePolicyRequest ): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2202,7 +2192,7 @@ async def test_delete_policy_async_from_dict(): def test_delete_policy_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2232,7 +2222,7 @@ def test_delete_policy_field_headers(): @pytest.mark.asyncio async def test_delete_policy_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2263,7 +2253,7 @@ async def test_delete_policy_field_headers_async(): def test_delete_policy_flattened(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2287,7 +2277,7 @@ def test_delete_policy_flattened(): def test_delete_policy_flattened_error(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2302,7 +2292,7 @@ def test_delete_policy_flattened_error(): @pytest.mark.asyncio async def test_delete_policy_flattened_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2331,7 +2321,7 @@ async def test_delete_policy_flattened_async(): @pytest.mark.asyncio async def test_delete_policy_flattened_error_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2346,17 +2336,17 @@ async def test_delete_policy_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PoliciesClient( @@ -2366,7 +2356,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2381,13 +2371,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = PoliciesClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PoliciesClient( @@ -2399,7 +2388,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = PoliciesClient(transport=transport) assert client.transport is transport @@ -2408,13 +2397,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.PoliciesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.PoliciesGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2430,7 +2419,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2443,7 +2432,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = PoliciesClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2451,7 +2440,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2463,7 +2452,7 @@ def test_policies_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.PoliciesTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2475,7 +2464,7 @@ def test_policies_base_transport(): ) as Transport: Transport.return_value = None transport = transports.PoliciesTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2517,7 +2506,7 @@ def test_policies_base_transport_with_credentials_file(): "google.cloud.iam_v2beta.services.policies.transports.PoliciesTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.PoliciesTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2536,7 +2525,7 @@ def test_policies_base_transport_with_adc(): "google.cloud.iam_v2beta.services.policies.transports.PoliciesTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.PoliciesTransport() adc.assert_called_once() @@ -2544,7 +2533,7 @@ def test_policies_base_transport_with_adc(): def test_policies_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) PoliciesClient() adc.assert_called_once_with( scopes=None, @@ -2564,7 +2553,7 @@ def test_policies_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2610,7 +2599,7 @@ def test_policies_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2635,7 +2624,7 @@ def test_policies_transport_create_channel(transport_class, grpc_helpers): [transports.PoliciesGrpcTransport, transports.PoliciesGrpcAsyncIOTransport], ) def test_policies_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2681,7 +2670,7 @@ def test_policies_grpc_transport_client_cert_source_for_mtls(transport_class): ) def test_policies_host_no_port(transport_name): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="iam.googleapis.com"), transport=transport_name, ) @@ -2697,7 +2686,7 @@ def test_policies_host_no_port(transport_name): ) def test_policies_host_with_port(transport_name): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="iam.googleapis.com:8000" ), @@ -2751,7 +2740,7 @@ def test_policies_transport_channel_mtls_with_client_cert_source(transport_class mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2826,7 +2815,7 @@ def test_policies_transport_channel_mtls_with_adc(transport_class): def test_policies_grpc_lro_client(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -2843,7 +2832,7 @@ def test_policies_grpc_lro_client(): def test_policies_grpc_lro_async_client(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -2968,7 +2957,7 @@ def test_client_with_default_client_info(): transports.PoliciesTransport, "_prep_wrapped_messages" ) as prep: client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2978,7 +2967,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = PoliciesClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2987,7 +2976,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -3000,7 +2989,7 @@ async def test_transport_close_async(): def test_get_operation(transport: str = "grpc"): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3025,7 +3014,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3051,7 +3040,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3080,7 +3069,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3109,7 +3098,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -3127,7 +3116,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = PoliciesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -3150,7 +3139,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -3166,7 +3155,7 @@ def test_client_ctx(): ] for transport in transports: client = PoliciesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-iap/google/cloud/iap/gapic_version.py b/packages/google-cloud-iap/google/cloud/iap/gapic_version.py index 45be25c513a7..360a0d13ebdd 100644 --- a/packages/google-cloud-iap/google/cloud/iap/gapic_version.py +++ b/packages/google-cloud-iap/google/cloud/iap/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.13.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/gapic_version.py b/packages/google-cloud-iap/google/cloud/iap_v1/gapic_version.py index 45be25c513a7..360a0d13ebdd 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/gapic_version.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.13.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py index 6f944b3710f4..d1df584d898b 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py @@ -412,6 +412,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -430,6 +431,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -506,19 +508,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = ( - IdentityAwareProxyAdminServiceClient._DEFAULT_UNIVERSE - ) - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = IdentityAwareProxyAdminServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py index e2391091df49..57f31657212a 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py @@ -370,6 +370,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -388,6 +389,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -464,19 +466,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = ( - IdentityAwareProxyOAuthServiceClient._DEFAULT_UNIVERSE - ) - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = IdentityAwareProxyOAuthServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-iap/samples/generated_samples/snippet_metadata_google.cloud.iap.v1.json b/packages/google-cloud-iap/samples/generated_samples/snippet_metadata_google.cloud.iap.v1.json index 9b2915474d25..3170bc627f80 100644 --- a/packages/google-cloud-iap/samples/generated_samples/snippet_metadata_google.cloud.iap.v1.json +++ b/packages/google-cloud-iap/samples/generated_samples/snippet_metadata_google.cloud.iap.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-iap", - "version": "1.13.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-iap/setup.py b/packages/google-cloud-iap/setup.py index a2e3b5627bf0..955eae612961 100644 --- a/packages/google-cloud-iap/setup.py +++ b/packages/google-cloud-iap/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", diff --git a/packages/google-cloud-iap/testing/constraints-3.7.txt b/packages/google-cloud-iap/testing/constraints-3.7.txt index 44ffd04543a8..712d45b4c5ea 100644 --- a/packages/google-cloud-iap/testing/constraints-3.7.txt +++ b/packages/google-cloud-iap/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 grpc-google-iam-v1==0.12.4 diff --git a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py index 82c8f1852048..0fd089e21998 100644 --- a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py +++ b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py @@ -84,18 +84,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -362,7 +350,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -389,42 +377,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -437,7 +432,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_identity_aware_proxy_admin_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -491,7 +486,7 @@ def test_identity_aware_proxy_admin_service_client_service_account_always_use_jw def test_identity_aware_proxy_admin_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -564,9 +559,7 @@ def test_identity_aware_proxy_admin_service_client_client_options( with mock.patch.object( IdentityAwareProxyAdminServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -995,20 +988,20 @@ def test_identity_aware_proxy_admin_service_client_client_api_endpoint(client_cl ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -1020,13 +1013,11 @@ def test_identity_aware_proxy_admin_service_client_client_api_endpoint(client_cl if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -1042,8 +1033,7 @@ def test_identity_aware_proxy_admin_service_client_client_api_endpoint(client_cl delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1209,8 +1199,8 @@ def test_identity_aware_proxy_admin_service_client_create_channel_credentials_fi ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1239,7 +1229,7 @@ def test_identity_aware_proxy_admin_service_client_create_channel_credentials_fi ) def test_set_iam_policy(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1271,7 +1261,7 @@ def test_set_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1288,7 +1278,7 @@ async def test_set_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1325,7 +1315,7 @@ async def test_set_iam_policy_async_from_dict(): def test_set_iam_policy_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1355,7 +1345,7 @@ def test_set_iam_policy_field_headers(): @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1384,7 +1374,7 @@ async def test_set_iam_policy_field_headers_async(): def test_set_iam_policy_from_dict_foreign(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -1409,7 +1399,7 @@ def test_set_iam_policy_from_dict_foreign(): ) def test_get_iam_policy(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1441,7 +1431,7 @@ def test_get_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1458,7 +1448,7 @@ async def test_get_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1495,7 +1485,7 @@ async def test_get_iam_policy_async_from_dict(): def test_get_iam_policy_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1525,7 +1515,7 @@ def test_get_iam_policy_field_headers(): @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1554,7 +1544,7 @@ async def test_get_iam_policy_field_headers_async(): def test_get_iam_policy_from_dict_foreign(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -1578,7 +1568,7 @@ def test_get_iam_policy_from_dict_foreign(): ) def test_test_iam_permissions(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1610,7 +1600,7 @@ def test_test_iam_permissions_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1630,7 +1620,7 @@ async def test_test_iam_permissions_async( request_type=iam_policy_pb2.TestIamPermissionsRequest, ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1667,7 +1657,7 @@ async def test_test_iam_permissions_async_from_dict(): def test_test_iam_permissions_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1699,7 +1689,7 @@ def test_test_iam_permissions_field_headers(): @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1732,7 +1722,7 @@ async def test_test_iam_permissions_field_headers_async(): def test_test_iam_permissions_from_dict_foreign(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1758,7 +1748,7 @@ def test_test_iam_permissions_from_dict_foreign(): ) def test_get_iap_settings(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1788,7 +1778,7 @@ def test_get_iap_settings_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1805,7 +1795,7 @@ async def test_get_iap_settings_async( transport: str = "grpc_asyncio", request_type=service.GetIapSettingsRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1840,7 +1830,7 @@ async def test_get_iap_settings_async_from_dict(): def test_get_iap_settings_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1870,7 +1860,7 @@ def test_get_iap_settings_field_headers(): @pytest.mark.asyncio async def test_get_iap_settings_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1906,7 +1896,7 @@ async def test_get_iap_settings_field_headers_async(): ) def test_update_iap_settings(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1938,7 +1928,7 @@ def test_update_iap_settings_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1957,7 +1947,7 @@ async def test_update_iap_settings_async( transport: str = "grpc_asyncio", request_type=service.UpdateIapSettingsRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1994,7 +1984,7 @@ async def test_update_iap_settings_async_from_dict(): def test_update_iap_settings_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2026,7 +2016,7 @@ def test_update_iap_settings_field_headers(): @pytest.mark.asyncio async def test_update_iap_settings_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2064,7 +2054,7 @@ async def test_update_iap_settings_field_headers_async(): ) def test_list_tunnel_dest_groups(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2096,7 +2086,7 @@ def test_list_tunnel_dest_groups_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2115,7 +2105,7 @@ async def test_list_tunnel_dest_groups_async( transport: str = "grpc_asyncio", request_type=service.ListTunnelDestGroupsRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2152,7 +2142,7 @@ async def test_list_tunnel_dest_groups_async_from_dict(): def test_list_tunnel_dest_groups_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2184,7 +2174,7 @@ def test_list_tunnel_dest_groups_field_headers(): @pytest.mark.asyncio async def test_list_tunnel_dest_groups_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2217,7 +2207,7 @@ async def test_list_tunnel_dest_groups_field_headers_async(): def test_list_tunnel_dest_groups_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2243,7 +2233,7 @@ def test_list_tunnel_dest_groups_flattened(): def test_list_tunnel_dest_groups_flattened_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2258,7 +2248,7 @@ def test_list_tunnel_dest_groups_flattened_error(): @pytest.mark.asyncio async def test_list_tunnel_dest_groups_flattened_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2289,7 +2279,7 @@ async def test_list_tunnel_dest_groups_flattened_async(): @pytest.mark.asyncio async def test_list_tunnel_dest_groups_flattened_error_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2303,7 +2293,7 @@ async def test_list_tunnel_dest_groups_flattened_error_async(): def test_list_tunnel_dest_groups_pager(transport_name: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2355,7 +2345,7 @@ def test_list_tunnel_dest_groups_pager(transport_name: str = "grpc"): def test_list_tunnel_dest_groups_pages(transport_name: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2399,7 +2389,7 @@ def test_list_tunnel_dest_groups_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tunnel_dest_groups_async_pager(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2451,7 +2441,7 @@ async def test_list_tunnel_dest_groups_async_pager(): @pytest.mark.asyncio async def test_list_tunnel_dest_groups_async_pages(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2508,7 +2498,7 @@ async def test_list_tunnel_dest_groups_async_pages(): ) def test_create_tunnel_dest_group(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2544,7 +2534,7 @@ def test_create_tunnel_dest_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2563,7 +2553,7 @@ async def test_create_tunnel_dest_group_async( transport: str = "grpc_asyncio", request_type=service.CreateTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2604,7 +2594,7 @@ async def test_create_tunnel_dest_group_async_from_dict(): def test_create_tunnel_dest_group_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2636,7 +2626,7 @@ def test_create_tunnel_dest_group_field_headers(): @pytest.mark.asyncio async def test_create_tunnel_dest_group_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2669,7 +2659,7 @@ async def test_create_tunnel_dest_group_field_headers_async(): def test_create_tunnel_dest_group_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2703,7 +2693,7 @@ def test_create_tunnel_dest_group_flattened(): def test_create_tunnel_dest_group_flattened_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2720,7 +2710,7 @@ def test_create_tunnel_dest_group_flattened_error(): @pytest.mark.asyncio async def test_create_tunnel_dest_group_flattened_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2759,7 +2749,7 @@ async def test_create_tunnel_dest_group_flattened_async(): @pytest.mark.asyncio async def test_create_tunnel_dest_group_flattened_error_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2782,7 +2772,7 @@ async def test_create_tunnel_dest_group_flattened_error_async(): ) def test_get_tunnel_dest_group(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2818,7 +2808,7 @@ def test_get_tunnel_dest_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2837,7 +2827,7 @@ async def test_get_tunnel_dest_group_async( transport: str = "grpc_asyncio", request_type=service.GetTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2878,7 +2868,7 @@ async def test_get_tunnel_dest_group_async_from_dict(): def test_get_tunnel_dest_group_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2910,7 +2900,7 @@ def test_get_tunnel_dest_group_field_headers(): @pytest.mark.asyncio async def test_get_tunnel_dest_group_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2943,7 +2933,7 @@ async def test_get_tunnel_dest_group_field_headers_async(): def test_get_tunnel_dest_group_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2969,7 +2959,7 @@ def test_get_tunnel_dest_group_flattened(): def test_get_tunnel_dest_group_flattened_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2984,7 +2974,7 @@ def test_get_tunnel_dest_group_flattened_error(): @pytest.mark.asyncio async def test_get_tunnel_dest_group_flattened_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3015,7 +3005,7 @@ async def test_get_tunnel_dest_group_flattened_async(): @pytest.mark.asyncio async def test_get_tunnel_dest_group_flattened_error_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3036,7 +3026,7 @@ async def test_get_tunnel_dest_group_flattened_error_async(): ) def test_delete_tunnel_dest_group(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3065,7 +3055,7 @@ def test_delete_tunnel_dest_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3084,7 +3074,7 @@ async def test_delete_tunnel_dest_group_async( transport: str = "grpc_asyncio", request_type=service.DeleteTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3116,7 +3106,7 @@ async def test_delete_tunnel_dest_group_async_from_dict(): def test_delete_tunnel_dest_group_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3148,7 +3138,7 @@ def test_delete_tunnel_dest_group_field_headers(): @pytest.mark.asyncio async def test_delete_tunnel_dest_group_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3179,7 +3169,7 @@ async def test_delete_tunnel_dest_group_field_headers_async(): def test_delete_tunnel_dest_group_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3205,7 +3195,7 @@ def test_delete_tunnel_dest_group_flattened(): def test_delete_tunnel_dest_group_flattened_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3220,7 +3210,7 @@ def test_delete_tunnel_dest_group_flattened_error(): @pytest.mark.asyncio async def test_delete_tunnel_dest_group_flattened_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3249,7 +3239,7 @@ async def test_delete_tunnel_dest_group_flattened_async(): @pytest.mark.asyncio async def test_delete_tunnel_dest_group_flattened_error_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3270,7 +3260,7 @@ async def test_delete_tunnel_dest_group_flattened_error_async(): ) def test_update_tunnel_dest_group(request_type, transport: str = "grpc"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3306,7 +3296,7 @@ def test_update_tunnel_dest_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3325,7 +3315,7 @@ async def test_update_tunnel_dest_group_async( transport: str = "grpc_asyncio", request_type=service.UpdateTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3366,7 +3356,7 @@ async def test_update_tunnel_dest_group_async_from_dict(): def test_update_tunnel_dest_group_field_headers(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3398,7 +3388,7 @@ def test_update_tunnel_dest_group_field_headers(): @pytest.mark.asyncio async def test_update_tunnel_dest_group_field_headers_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3431,7 +3421,7 @@ async def test_update_tunnel_dest_group_field_headers_async(): def test_update_tunnel_dest_group_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3461,7 +3451,7 @@ def test_update_tunnel_dest_group_flattened(): def test_update_tunnel_dest_group_flattened_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3477,7 +3467,7 @@ def test_update_tunnel_dest_group_flattened_error(): @pytest.mark.asyncio async def test_update_tunnel_dest_group_flattened_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3512,7 +3502,7 @@ async def test_update_tunnel_dest_group_flattened_async(): @pytest.mark.asyncio async def test_update_tunnel_dest_group_flattened_error_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3534,7 +3524,7 @@ async def test_update_tunnel_dest_group_flattened_error_async(): ) def test_set_iam_policy_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3585,7 +3575,7 @@ def test_set_iam_policy_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).set_iam_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3594,7 +3584,7 @@ def test_set_iam_policy_rest_required_fields( jsonified_request["resource"] = "resource_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).set_iam_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3603,7 +3593,7 @@ def test_set_iam_policy_rest_required_fields( assert jsonified_request["resource"] == "resource_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3644,7 +3634,7 @@ def test_set_iam_policy_rest_required_fields( def test_set_iam_policy_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.set_iam_policy._get_unset_required_fields({}) @@ -3662,7 +3652,7 @@ def test_set_iam_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_set_iam_policy_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -3716,7 +3706,7 @@ def test_set_iam_policy_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3738,7 +3728,7 @@ def test_set_iam_policy_rest_bad_request( def test_set_iam_policy_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3751,7 +3741,7 @@ def test_set_iam_policy_rest_error(): ) def test_get_iam_policy_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3802,7 +3792,7 @@ def test_get_iam_policy_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_iam_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3811,7 +3801,7 @@ def test_get_iam_policy_rest_required_fields( jsonified_request["resource"] = "resource_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_iam_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3820,7 +3810,7 @@ def test_get_iam_policy_rest_required_fields( assert jsonified_request["resource"] == "resource_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3861,7 +3851,7 @@ def test_get_iam_policy_rest_required_fields( def test_get_iam_policy_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_iam_policy._get_unset_required_fields({}) @@ -3871,7 +3861,7 @@ def test_get_iam_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_iam_policy_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -3925,7 +3915,7 @@ def test_get_iam_policy_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3947,7 +3937,7 @@ def test_get_iam_policy_rest_bad_request( def test_get_iam_policy_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3960,7 +3950,7 @@ def test_get_iam_policy_rest_error(): ) def test_test_iam_permissions_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4010,7 +4000,7 @@ def test_test_iam_permissions_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).test_iam_permissions._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4020,7 +4010,7 @@ def test_test_iam_permissions_rest_required_fields( jsonified_request["permissions"] = "permissions_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).test_iam_permissions._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4031,7 +4021,7 @@ def test_test_iam_permissions_rest_required_fields( assert jsonified_request["permissions"] == "permissions_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4072,7 +4062,7 @@ def test_test_iam_permissions_rest_required_fields( def test_test_iam_permissions_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.test_iam_permissions._get_unset_required_fields({}) @@ -4090,7 +4080,7 @@ def test_test_iam_permissions_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_test_iam_permissions_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -4148,7 +4138,7 @@ def test_test_iam_permissions_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.TestIamPermissionsRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4170,7 +4160,7 @@ def test_test_iam_permissions_rest_bad_request( def test_test_iam_permissions_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4183,7 +4173,7 @@ def test_test_iam_permissions_rest_error(): ) def test_get_iap_settings_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4234,7 +4224,7 @@ def test_get_iap_settings_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_iap_settings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4243,7 +4233,7 @@ def test_get_iap_settings_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_iap_settings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4252,7 +4242,7 @@ def test_get_iap_settings_rest_required_fields( assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4294,7 +4284,7 @@ def test_get_iap_settings_rest_required_fields( def test_get_iap_settings_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_iap_settings._get_unset_required_fields({}) @@ -4304,7 +4294,7 @@ def test_get_iap_settings_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_iap_settings_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -4359,7 +4349,7 @@ def test_get_iap_settings_rest_bad_request( transport: str = "rest", request_type=service.GetIapSettingsRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4381,7 +4371,7 @@ def test_get_iap_settings_rest_bad_request( def test_get_iap_settings_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4394,7 +4384,7 @@ def test_get_iap_settings_rest_error(): ) def test_update_iap_settings_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4551,14 +4541,14 @@ def test_update_iap_settings_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_iap_settings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_iap_settings._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -4567,7 +4557,7 @@ def test_update_iap_settings_rest_required_fields( # verify required fields with non-default values are left alone client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4610,7 +4600,7 @@ def test_update_iap_settings_rest_required_fields( def test_update_iap_settings_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_iap_settings._get_unset_required_fields({}) @@ -4620,7 +4610,7 @@ def test_update_iap_settings_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_iap_settings_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -4678,7 +4668,7 @@ def test_update_iap_settings_rest_bad_request( transport: str = "rest", request_type=service.UpdateIapSettingsRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4700,7 +4690,7 @@ def test_update_iap_settings_rest_bad_request( def test_update_iap_settings_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4713,7 +4703,7 @@ def test_update_iap_settings_rest_error(): ) def test_list_tunnel_dest_groups_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4764,7 +4754,7 @@ def test_list_tunnel_dest_groups_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_tunnel_dest_groups._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4773,7 +4763,7 @@ def test_list_tunnel_dest_groups_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_tunnel_dest_groups._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -4789,7 +4779,7 @@ def test_list_tunnel_dest_groups_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4831,7 +4821,7 @@ def test_list_tunnel_dest_groups_rest_required_fields( def test_list_tunnel_dest_groups_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_tunnel_dest_groups._get_unset_required_fields({}) @@ -4849,7 +4839,7 @@ def test_list_tunnel_dest_groups_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_tunnel_dest_groups_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -4909,7 +4899,7 @@ def test_list_tunnel_dest_groups_rest_bad_request( transport: str = "rest", request_type=service.ListTunnelDestGroupsRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4931,7 +4921,7 @@ def test_list_tunnel_dest_groups_rest_bad_request( def test_list_tunnel_dest_groups_rest_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4973,7 +4963,7 @@ def test_list_tunnel_dest_groups_rest_flattened(): def test_list_tunnel_dest_groups_rest_flattened_error(transport: str = "rest"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4988,7 +4978,7 @@ def test_list_tunnel_dest_groups_rest_flattened_error(transport: str = "rest"): def test_list_tunnel_dest_groups_rest_pager(transport: str = "rest"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5058,7 +5048,7 @@ def test_list_tunnel_dest_groups_rest_pager(transport: str = "rest"): ) def test_create_tunnel_dest_group_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5187,7 +5177,7 @@ def test_create_tunnel_dest_group_rest_required_fields( assert "tunnelDestGroupId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_tunnel_dest_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5201,7 +5191,7 @@ def test_create_tunnel_dest_group_rest_required_fields( jsonified_request["tunnelDestGroupId"] = "tunnel_dest_group_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_tunnel_dest_group._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("tunnel_dest_group_id",)) @@ -5214,7 +5204,7 @@ def test_create_tunnel_dest_group_rest_required_fields( assert jsonified_request["tunnelDestGroupId"] == "tunnel_dest_group_id_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5263,7 +5253,7 @@ def test_create_tunnel_dest_group_rest_required_fields( def test_create_tunnel_dest_group_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_tunnel_dest_group._get_unset_required_fields({}) @@ -5282,7 +5272,7 @@ def test_create_tunnel_dest_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_tunnel_dest_group_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -5342,7 +5332,7 @@ def test_create_tunnel_dest_group_rest_bad_request( transport: str = "rest", request_type=service.CreateTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5364,7 +5354,7 @@ def test_create_tunnel_dest_group_rest_bad_request( def test_create_tunnel_dest_group_rest_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5408,7 +5398,7 @@ def test_create_tunnel_dest_group_rest_flattened(): def test_create_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5425,7 +5415,7 @@ def test_create_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): def test_create_tunnel_dest_group_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5438,7 +5428,7 @@ def test_create_tunnel_dest_group_rest_error(): ) def test_get_tunnel_dest_group_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5495,7 +5485,7 @@ def test_get_tunnel_dest_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_tunnel_dest_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5504,7 +5494,7 @@ def test_get_tunnel_dest_group_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_tunnel_dest_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5513,7 +5503,7 @@ def test_get_tunnel_dest_group_rest_required_fields( assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5555,7 +5545,7 @@ def test_get_tunnel_dest_group_rest_required_fields( def test_get_tunnel_dest_group_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_tunnel_dest_group._get_unset_required_fields({}) @@ -5565,7 +5555,7 @@ def test_get_tunnel_dest_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_tunnel_dest_group_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -5625,7 +5615,7 @@ def test_get_tunnel_dest_group_rest_bad_request( transport: str = "rest", request_type=service.GetTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5649,7 +5639,7 @@ def test_get_tunnel_dest_group_rest_bad_request( def test_get_tunnel_dest_group_rest_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5693,7 +5683,7 @@ def test_get_tunnel_dest_group_rest_flattened(): def test_get_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5708,7 +5698,7 @@ def test_get_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): def test_get_tunnel_dest_group_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5721,7 +5711,7 @@ def test_get_tunnel_dest_group_rest_error(): ) def test_delete_tunnel_dest_group_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5769,7 +5759,7 @@ def test_delete_tunnel_dest_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_tunnel_dest_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5778,7 +5768,7 @@ def test_delete_tunnel_dest_group_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_tunnel_dest_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5787,7 +5777,7 @@ def test_delete_tunnel_dest_group_rest_required_fields( assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5826,7 +5816,7 @@ def test_delete_tunnel_dest_group_rest_required_fields( def test_delete_tunnel_dest_group_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_tunnel_dest_group._get_unset_required_fields({}) @@ -5836,7 +5826,7 @@ def test_delete_tunnel_dest_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_tunnel_dest_group_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -5887,7 +5877,7 @@ def test_delete_tunnel_dest_group_rest_bad_request( transport: str = "rest", request_type=service.DeleteTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5911,7 +5901,7 @@ def test_delete_tunnel_dest_group_rest_bad_request( def test_delete_tunnel_dest_group_rest_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5953,7 +5943,7 @@ def test_delete_tunnel_dest_group_rest_flattened(): def test_delete_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5968,7 +5958,7 @@ def test_delete_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): def test_delete_tunnel_dest_group_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5981,7 +5971,7 @@ def test_delete_tunnel_dest_group_rest_error(): ) def test_update_tunnel_dest_group_rest(request_type): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6111,14 +6101,14 @@ def test_update_tunnel_dest_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_tunnel_dest_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_tunnel_dest_group._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -6127,7 +6117,7 @@ def test_update_tunnel_dest_group_rest_required_fields( # verify required fields with non-default values are left alone client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6170,7 +6160,7 @@ def test_update_tunnel_dest_group_rest_required_fields( def test_update_tunnel_dest_group_rest_unset_required_fields(): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_tunnel_dest_group._get_unset_required_fields({}) @@ -6180,7 +6170,7 @@ def test_update_tunnel_dest_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_tunnel_dest_group_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyAdminServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyAdminServiceRestInterceptor(), @@ -6240,7 +6230,7 @@ def test_update_tunnel_dest_group_rest_bad_request( transport: str = "rest", request_type=service.UpdateTunnelDestGroupRequest ): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6266,7 +6256,7 @@ def test_update_tunnel_dest_group_rest_bad_request( def test_update_tunnel_dest_group_rest_flattened(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6313,7 +6303,7 @@ def test_update_tunnel_dest_group_rest_flattened(): def test_update_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6329,24 +6319,24 @@ def test_update_tunnel_dest_group_rest_flattened_error(transport: str = "rest"): def test_update_tunnel_dest_group_rest_error(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.IdentityAwareProxyAdminServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.IdentityAwareProxyAdminServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IdentityAwareProxyAdminServiceClient( @@ -6356,7 +6346,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.IdentityAwareProxyAdminServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -6371,13 +6361,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = IdentityAwareProxyAdminServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.IdentityAwareProxyAdminServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IdentityAwareProxyAdminServiceClient( @@ -6389,7 +6378,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.IdentityAwareProxyAdminServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = IdentityAwareProxyAdminServiceClient(transport=transport) assert client.transport is transport @@ -6398,13 +6387,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.IdentityAwareProxyAdminServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.IdentityAwareProxyAdminServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -6421,7 +6410,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -6437,7 +6426,7 @@ def test_transport_kind(transport_name): transport = IdentityAwareProxyAdminServiceClient.get_transport_class( transport_name )( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -6445,7 +6434,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -6457,7 +6446,7 @@ def test_identity_aware_proxy_admin_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.IdentityAwareProxyAdminServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -6469,7 +6458,7 @@ def test_identity_aware_proxy_admin_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.IdentityAwareProxyAdminServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -6510,7 +6499,7 @@ def test_identity_aware_proxy_admin_service_base_transport_with_credentials_file "google.cloud.iap_v1.services.identity_aware_proxy_admin_service.transports.IdentityAwareProxyAdminServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IdentityAwareProxyAdminServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -6529,7 +6518,7 @@ def test_identity_aware_proxy_admin_service_base_transport_with_adc(): "google.cloud.iap_v1.services.identity_aware_proxy_admin_service.transports.IdentityAwareProxyAdminServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IdentityAwareProxyAdminServiceTransport() adc.assert_called_once() @@ -6537,7 +6526,7 @@ def test_identity_aware_proxy_admin_service_base_transport_with_adc(): def test_identity_aware_proxy_admin_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) IdentityAwareProxyAdminServiceClient() adc.assert_called_once_with( scopes=None, @@ -6557,7 +6546,7 @@ def test_identity_aware_proxy_admin_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -6611,7 +6600,7 @@ def test_identity_aware_proxy_admin_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -6641,7 +6630,7 @@ def test_identity_aware_proxy_admin_service_transport_create_channel( def test_identity_aware_proxy_admin_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -6679,7 +6668,7 @@ def test_identity_aware_proxy_admin_service_grpc_transport_client_cert_source_fo def test_identity_aware_proxy_admin_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -6699,7 +6688,7 @@ def test_identity_aware_proxy_admin_service_http_transport_client_cert_source_fo ) def test_identity_aware_proxy_admin_service_host_no_port(transport_name): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="iap.googleapis.com"), transport=transport_name, ) @@ -6720,7 +6709,7 @@ def test_identity_aware_proxy_admin_service_host_no_port(transport_name): ) def test_identity_aware_proxy_admin_service_host_with_port(transport_name): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="iap.googleapis.com:8000" ), @@ -6742,8 +6731,8 @@ def test_identity_aware_proxy_admin_service_host_with_port(transport_name): def test_identity_aware_proxy_admin_service_client_transport_session_collision( transport_name, ): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = IdentityAwareProxyAdminServiceClient( credentials=creds1, transport=transport_name, @@ -6834,7 +6823,7 @@ def test_identity_aware_proxy_admin_service_transport_channel_mtls_with_client_c mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -7081,7 +7070,7 @@ def test_client_with_default_client_info(): transports.IdentityAwareProxyAdminServiceTransport, "_prep_wrapped_messages" ) as prep: client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7091,7 +7080,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = IdentityAwareProxyAdminServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7100,7 +7089,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = IdentityAwareProxyAdminServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -7119,7 +7108,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -7136,7 +7125,7 @@ def test_client_ctx(): ] for transport in transports: client = IdentityAwareProxyAdminServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py index 3431831f1ca9..7c15ecb14b21 100644 --- a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py +++ b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py @@ -77,18 +77,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -355,7 +343,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -382,42 +370,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -430,7 +425,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_identity_aware_proxy_o_auth_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -484,7 +479,7 @@ def test_identity_aware_proxy_o_auth_service_client_service_account_always_use_j def test_identity_aware_proxy_o_auth_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -557,9 +552,7 @@ def test_identity_aware_proxy_o_auth_service_client_client_options( with mock.patch.object( IdentityAwareProxyOAuthServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -988,20 +981,20 @@ def test_identity_aware_proxy_o_auth_service_client_client_api_endpoint(client_c ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -1013,13 +1006,11 @@ def test_identity_aware_proxy_o_auth_service_client_client_api_endpoint(client_c if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -1035,8 +1026,7 @@ def test_identity_aware_proxy_o_auth_service_client_client_api_endpoint(client_c delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1202,8 +1192,8 @@ def test_identity_aware_proxy_o_auth_service_client_create_channel_credentials_f ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1232,7 +1222,7 @@ def test_identity_aware_proxy_o_auth_service_client_create_channel_credentials_f ) def test_list_brands(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1259,7 +1249,7 @@ def test_list_brands_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1276,7 +1266,7 @@ async def test_list_brands_async( transport: str = "grpc_asyncio", request_type=service.ListBrandsRequest ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1308,7 +1298,7 @@ async def test_list_brands_async_from_dict(): def test_list_brands_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1338,7 +1328,7 @@ def test_list_brands_field_headers(): @pytest.mark.asyncio async def test_list_brands_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1376,7 +1366,7 @@ async def test_list_brands_field_headers_async(): ) def test_create_brand(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1412,7 +1402,7 @@ def test_create_brand_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1429,7 +1419,7 @@ async def test_create_brand_async( transport: str = "grpc_asyncio", request_type=service.CreateBrandRequest ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1470,7 +1460,7 @@ async def test_create_brand_async_from_dict(): def test_create_brand_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1500,7 +1490,7 @@ def test_create_brand_field_headers(): @pytest.mark.asyncio async def test_create_brand_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1536,7 +1526,7 @@ async def test_create_brand_field_headers_async(): ) def test_get_brand(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1572,7 +1562,7 @@ def test_get_brand_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1589,7 +1579,7 @@ async def test_get_brand_async( transport: str = "grpc_asyncio", request_type=service.GetBrandRequest ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1630,7 +1620,7 @@ async def test_get_brand_async_from_dict(): def test_get_brand_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1660,7 +1650,7 @@ def test_get_brand_field_headers(): @pytest.mark.asyncio async def test_get_brand_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1696,7 +1686,7 @@ async def test_get_brand_field_headers_async(): ) def test_create_identity_aware_proxy_client(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1732,7 +1722,7 @@ def test_create_identity_aware_proxy_client_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1752,7 +1742,7 @@ async def test_create_identity_aware_proxy_client_async( request_type=service.CreateIdentityAwareProxyClientRequest, ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1793,7 +1783,7 @@ async def test_create_identity_aware_proxy_client_async_from_dict(): def test_create_identity_aware_proxy_client_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1825,7 +1815,7 @@ def test_create_identity_aware_proxy_client_field_headers(): @pytest.mark.asyncio async def test_create_identity_aware_proxy_client_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1865,7 +1855,7 @@ async def test_create_identity_aware_proxy_client_field_headers_async(): ) def test_list_identity_aware_proxy_clients(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1897,7 +1887,7 @@ def test_list_identity_aware_proxy_clients_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1917,7 +1907,7 @@ async def test_list_identity_aware_proxy_clients_async( request_type=service.ListIdentityAwareProxyClientsRequest, ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1954,7 +1944,7 @@ async def test_list_identity_aware_proxy_clients_async_from_dict(): def test_list_identity_aware_proxy_clients_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1986,7 +1976,7 @@ def test_list_identity_aware_proxy_clients_field_headers(): @pytest.mark.asyncio async def test_list_identity_aware_proxy_clients_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2019,7 +2009,7 @@ async def test_list_identity_aware_proxy_clients_field_headers_async(): def test_list_identity_aware_proxy_clients_pager(transport_name: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2071,7 +2061,7 @@ def test_list_identity_aware_proxy_clients_pager(transport_name: str = "grpc"): def test_list_identity_aware_proxy_clients_pages(transport_name: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2115,7 +2105,7 @@ def test_list_identity_aware_proxy_clients_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_identity_aware_proxy_clients_async_pager(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2167,7 +2157,7 @@ async def test_list_identity_aware_proxy_clients_async_pager(): @pytest.mark.asyncio async def test_list_identity_aware_proxy_clients_async_pages(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2224,7 +2214,7 @@ async def test_list_identity_aware_proxy_clients_async_pages(): ) def test_get_identity_aware_proxy_client(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2260,7 +2250,7 @@ def test_get_identity_aware_proxy_client_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2280,7 +2270,7 @@ async def test_get_identity_aware_proxy_client_async( request_type=service.GetIdentityAwareProxyClientRequest, ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2321,7 +2311,7 @@ async def test_get_identity_aware_proxy_client_async_from_dict(): def test_get_identity_aware_proxy_client_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2353,7 +2343,7 @@ def test_get_identity_aware_proxy_client_field_headers(): @pytest.mark.asyncio async def test_get_identity_aware_proxy_client_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2395,7 +2385,7 @@ def test_reset_identity_aware_proxy_client_secret( request_type, transport: str = "grpc" ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2431,7 +2421,7 @@ def test_reset_identity_aware_proxy_client_secret_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2451,7 +2441,7 @@ async def test_reset_identity_aware_proxy_client_secret_async( request_type=service.ResetIdentityAwareProxyClientSecretRequest, ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2492,7 +2482,7 @@ async def test_reset_identity_aware_proxy_client_secret_async_from_dict(): def test_reset_identity_aware_proxy_client_secret_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2524,7 +2514,7 @@ def test_reset_identity_aware_proxy_client_secret_field_headers(): @pytest.mark.asyncio async def test_reset_identity_aware_proxy_client_secret_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2564,7 +2554,7 @@ async def test_reset_identity_aware_proxy_client_secret_field_headers_async(): ) def test_delete_identity_aware_proxy_client(request_type, transport: str = "grpc"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2593,7 +2583,7 @@ def test_delete_identity_aware_proxy_client_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2613,7 +2603,7 @@ async def test_delete_identity_aware_proxy_client_async( request_type=service.DeleteIdentityAwareProxyClientRequest, ): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2645,7 +2635,7 @@ async def test_delete_identity_aware_proxy_client_async_from_dict(): def test_delete_identity_aware_proxy_client_field_headers(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2677,7 +2667,7 @@ def test_delete_identity_aware_proxy_client_field_headers(): @pytest.mark.asyncio async def test_delete_identity_aware_proxy_client_field_headers_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2715,7 +2705,7 @@ async def test_delete_identity_aware_proxy_client_field_headers_async(): ) def test_list_brands_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2761,7 +2751,7 @@ def test_list_brands_rest_required_fields(request_type=service.ListBrandsRequest # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_brands._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2770,7 +2760,7 @@ def test_list_brands_rest_required_fields(request_type=service.ListBrandsRequest jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_brands._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2779,7 +2769,7 @@ def test_list_brands_rest_required_fields(request_type=service.ListBrandsRequest assert jsonified_request["parent"] == "parent_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2821,7 +2811,7 @@ def test_list_brands_rest_required_fields(request_type=service.ListBrandsRequest def test_list_brands_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_brands._get_unset_required_fields({}) @@ -2831,7 +2821,7 @@ def test_list_brands_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_brands_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -2887,7 +2877,7 @@ def test_list_brands_rest_bad_request( transport: str = "rest", request_type=service.ListBrandsRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2909,7 +2899,7 @@ def test_list_brands_rest_bad_request( def test_list_brands_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2922,7 +2912,7 @@ def test_list_brands_rest_error(): ) def test_create_brand_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3050,7 +3040,7 @@ def test_create_brand_rest_required_fields(request_type=service.CreateBrandReque # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_brand._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3059,7 +3049,7 @@ def test_create_brand_rest_required_fields(request_type=service.CreateBrandReque jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_brand._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3068,7 +3058,7 @@ def test_create_brand_rest_required_fields(request_type=service.CreateBrandReque assert jsonified_request["parent"] == "parent_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3111,7 +3101,7 @@ def test_create_brand_rest_required_fields(request_type=service.CreateBrandReque def test_create_brand_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_brand._get_unset_required_fields({}) @@ -3129,7 +3119,7 @@ def test_create_brand_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_brand_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -3183,7 +3173,7 @@ def test_create_brand_rest_bad_request( transport: str = "rest", request_type=service.CreateBrandRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3205,7 +3195,7 @@ def test_create_brand_rest_bad_request( def test_create_brand_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3218,7 +3208,7 @@ def test_create_brand_rest_error(): ) def test_get_brand_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3273,7 +3263,7 @@ def test_get_brand_rest_required_fields(request_type=service.GetBrandRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_brand._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3282,7 +3272,7 @@ def test_get_brand_rest_required_fields(request_type=service.GetBrandRequest): jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_brand._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3291,7 +3281,7 @@ def test_get_brand_rest_required_fields(request_type=service.GetBrandRequest): assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3333,7 +3323,7 @@ def test_get_brand_rest_required_fields(request_type=service.GetBrandRequest): def test_get_brand_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_brand._get_unset_required_fields({}) @@ -3343,7 +3333,7 @@ def test_get_brand_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_brand_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -3397,7 +3387,7 @@ def test_get_brand_rest_bad_request( transport: str = "rest", request_type=service.GetBrandRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3419,7 +3409,7 @@ def test_get_brand_rest_bad_request( def test_get_brand_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3432,7 +3422,7 @@ def test_get_brand_rest_error(): ) def test_create_identity_aware_proxy_client_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3565,7 +3555,7 @@ def test_create_identity_aware_proxy_client_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_identity_aware_proxy_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3574,7 +3564,7 @@ def test_create_identity_aware_proxy_client_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_identity_aware_proxy_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3583,7 +3573,7 @@ def test_create_identity_aware_proxy_client_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3626,7 +3616,7 @@ def test_create_identity_aware_proxy_client_rest_required_fields( def test_create_identity_aware_proxy_client_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -3646,7 +3636,7 @@ def test_create_identity_aware_proxy_client_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_identity_aware_proxy_client_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -3706,7 +3696,7 @@ def test_create_identity_aware_proxy_client_rest_bad_request( transport: str = "rest", request_type=service.CreateIdentityAwareProxyClientRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3728,7 +3718,7 @@ def test_create_identity_aware_proxy_client_rest_bad_request( def test_create_identity_aware_proxy_client_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3741,7 +3731,7 @@ def test_create_identity_aware_proxy_client_rest_error(): ) def test_list_identity_aware_proxy_clients_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3792,7 +3782,7 @@ def test_list_identity_aware_proxy_clients_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_identity_aware_proxy_clients._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3801,7 +3791,7 @@ def test_list_identity_aware_proxy_clients_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_identity_aware_proxy_clients._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -3817,7 +3807,7 @@ def test_list_identity_aware_proxy_clients_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3861,7 +3851,7 @@ def test_list_identity_aware_proxy_clients_rest_required_fields( def test_list_identity_aware_proxy_clients_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -3881,7 +3871,7 @@ def test_list_identity_aware_proxy_clients_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_identity_aware_proxy_clients_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -3943,7 +3933,7 @@ def test_list_identity_aware_proxy_clients_rest_bad_request( transport: str = "rest", request_type=service.ListIdentityAwareProxyClientsRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3965,7 +3955,7 @@ def test_list_identity_aware_proxy_clients_rest_bad_request( def test_list_identity_aware_proxy_clients_rest_pager(transport: str = "rest"): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4037,7 +4027,7 @@ def test_list_identity_aware_proxy_clients_rest_pager(transport: str = "rest"): ) def test_get_identity_aware_proxy_client_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4094,7 +4084,7 @@ def test_get_identity_aware_proxy_client_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_identity_aware_proxy_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4103,7 +4093,7 @@ def test_get_identity_aware_proxy_client_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_identity_aware_proxy_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4112,7 +4102,7 @@ def test_get_identity_aware_proxy_client_rest_required_fields( assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4154,7 +4144,7 @@ def test_get_identity_aware_proxy_client_rest_required_fields( def test_get_identity_aware_proxy_client_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_identity_aware_proxy_client._get_unset_required_fields( @@ -4166,7 +4156,7 @@ def test_get_identity_aware_proxy_client_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_identity_aware_proxy_client_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -4226,7 +4216,7 @@ def test_get_identity_aware_proxy_client_rest_bad_request( transport: str = "rest", request_type=service.GetIdentityAwareProxyClientRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4250,7 +4240,7 @@ def test_get_identity_aware_proxy_client_rest_bad_request( def test_get_identity_aware_proxy_client_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4263,7 +4253,7 @@ def test_get_identity_aware_proxy_client_rest_error(): ) def test_reset_identity_aware_proxy_client_secret_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4320,7 +4310,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reset_identity_aware_proxy_client_secret._get_unset_required_fields( jsonified_request ) @@ -4331,7 +4321,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reset_identity_aware_proxy_client_secret._get_unset_required_fields( jsonified_request ) @@ -4342,7 +4332,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_required_fields( assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4385,7 +4375,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_required_fields( def test_reset_identity_aware_proxy_client_secret_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -4399,7 +4389,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_reset_identity_aware_proxy_client_secret_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -4460,7 +4450,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_bad_request( request_type=service.ResetIdentityAwareProxyClientSecretRequest, ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4484,7 +4474,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_bad_request( def test_reset_identity_aware_proxy_client_secret_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4497,7 +4487,7 @@ def test_reset_identity_aware_proxy_client_secret_rest_error(): ) def test_delete_identity_aware_proxy_client_rest(request_type): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4545,7 +4535,7 @@ def test_delete_identity_aware_proxy_client_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_identity_aware_proxy_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4554,7 +4544,7 @@ def test_delete_identity_aware_proxy_client_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_identity_aware_proxy_client._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4563,7 +4553,7 @@ def test_delete_identity_aware_proxy_client_rest_required_fields( assert jsonified_request["name"] == "name_value" client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4602,7 +4592,7 @@ def test_delete_identity_aware_proxy_client_rest_required_fields( def test_delete_identity_aware_proxy_client_rest_unset_required_fields(): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -4614,7 +4604,7 @@ def test_delete_identity_aware_proxy_client_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_identity_aware_proxy_client_rest_interceptors(null_interceptor): transport = transports.IdentityAwareProxyOAuthServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IdentityAwareProxyOAuthServiceRestInterceptor(), @@ -4665,7 +4655,7 @@ def test_delete_identity_aware_proxy_client_rest_bad_request( transport: str = "rest", request_type=service.DeleteIdentityAwareProxyClientRequest ): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4689,24 +4679,24 @@ def test_delete_identity_aware_proxy_client_rest_bad_request( def test_delete_identity_aware_proxy_client_rest_error(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.IdentityAwareProxyOAuthServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.IdentityAwareProxyOAuthServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IdentityAwareProxyOAuthServiceClient( @@ -4716,7 +4706,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.IdentityAwareProxyOAuthServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -4731,13 +4721,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = IdentityAwareProxyOAuthServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.IdentityAwareProxyOAuthServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IdentityAwareProxyOAuthServiceClient( @@ -4749,7 +4738,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.IdentityAwareProxyOAuthServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = IdentityAwareProxyOAuthServiceClient(transport=transport) assert client.transport is transport @@ -4758,13 +4747,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.IdentityAwareProxyOAuthServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.IdentityAwareProxyOAuthServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4781,7 +4770,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4797,7 +4786,7 @@ def test_transport_kind(transport_name): transport = IdentityAwareProxyOAuthServiceClient.get_transport_class( transport_name )( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4805,7 +4794,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4817,7 +4806,7 @@ def test_identity_aware_proxy_o_auth_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.IdentityAwareProxyOAuthServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4829,7 +4818,7 @@ def test_identity_aware_proxy_o_auth_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.IdentityAwareProxyOAuthServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4868,7 +4857,7 @@ def test_identity_aware_proxy_o_auth_service_base_transport_with_credentials_fil "google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service.transports.IdentityAwareProxyOAuthServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IdentityAwareProxyOAuthServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4887,7 +4876,7 @@ def test_identity_aware_proxy_o_auth_service_base_transport_with_adc(): "google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service.transports.IdentityAwareProxyOAuthServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IdentityAwareProxyOAuthServiceTransport() adc.assert_called_once() @@ -4895,7 +4884,7 @@ def test_identity_aware_proxy_o_auth_service_base_transport_with_adc(): def test_identity_aware_proxy_o_auth_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) IdentityAwareProxyOAuthServiceClient() adc.assert_called_once_with( scopes=None, @@ -4915,7 +4904,7 @@ def test_identity_aware_proxy_o_auth_service_transport_auth_adc(transport_class) # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4969,7 +4958,7 @@ def test_identity_aware_proxy_o_auth_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4999,7 +4988,7 @@ def test_identity_aware_proxy_o_auth_service_transport_create_channel( def test_identity_aware_proxy_o_auth_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -5037,7 +5026,7 @@ def test_identity_aware_proxy_o_auth_service_grpc_transport_client_cert_source_f def test_identity_aware_proxy_o_auth_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -5057,7 +5046,7 @@ def test_identity_aware_proxy_o_auth_service_http_transport_client_cert_source_f ) def test_identity_aware_proxy_o_auth_service_host_no_port(transport_name): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="iap.googleapis.com"), transport=transport_name, ) @@ -5078,7 +5067,7 @@ def test_identity_aware_proxy_o_auth_service_host_no_port(transport_name): ) def test_identity_aware_proxy_o_auth_service_host_with_port(transport_name): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="iap.googleapis.com:8000" ), @@ -5100,8 +5089,8 @@ def test_identity_aware_proxy_o_auth_service_host_with_port(transport_name): def test_identity_aware_proxy_o_auth_service_client_transport_session_collision( transport_name, ): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = IdentityAwareProxyOAuthServiceClient( credentials=creds1, transport=transport_name, @@ -5186,7 +5175,7 @@ def test_identity_aware_proxy_o_auth_service_transport_channel_mtls_with_client_ mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -5380,7 +5369,7 @@ def test_client_with_default_client_info(): transports.IdentityAwareProxyOAuthServiceTransport, "_prep_wrapped_messages" ) as prep: client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5390,7 +5379,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = IdentityAwareProxyOAuthServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5399,7 +5388,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = IdentityAwareProxyOAuthServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -5418,7 +5407,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -5435,7 +5424,7 @@ def test_client_ctx(): ] for transport in transports: client = IdentityAwareProxyOAuthServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-ids/google/cloud/ids/gapic_version.py b/packages/google-cloud-ids/google/cloud/ids/gapic_version.py index 181f5fd08a41..360a0d13ebdd 100644 --- a/packages/google-cloud-ids/google/cloud/ids/gapic_version.py +++ b/packages/google-cloud-ids/google/cloud/ids/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.7.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-ids/google/cloud/ids_v1/gapic_version.py b/packages/google-cloud-ids/google/cloud/ids_v1/gapic_version.py index 181f5fd08a41..360a0d13ebdd 100644 --- a/packages/google-cloud-ids/google/cloud/ids_v1/gapic_version.py +++ b/packages/google-cloud-ids/google/cloud/ids_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.7.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-ids/google/cloud/ids_v1/services/ids/client.py b/packages/google-cloud-ids/google/cloud/ids_v1/services/ids/client.py index 915906edb0bd..bfef77571356 100644 --- a/packages/google-cloud-ids/google/cloud/ids_v1/services/ids/client.py +++ b/packages/google-cloud-ids/google/cloud/ids_v1/services/ids/client.py @@ -385,6 +385,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -403,6 +404,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -477,17 +479,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = IDSClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = IDSClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-ids/samples/generated_samples/snippet_metadata_google.cloud.ids.v1.json b/packages/google-cloud-ids/samples/generated_samples/snippet_metadata_google.cloud.ids.v1.json index a0a3e9d567c8..49e7eb64c25f 100644 --- a/packages/google-cloud-ids/samples/generated_samples/snippet_metadata_google.cloud.ids.v1.json +++ b/packages/google-cloud-ids/samples/generated_samples/snippet_metadata_google.cloud.ids.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-ids", - "version": "1.7.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-ids/setup.py b/packages/google-cloud-ids/setup.py index 798ea0cc2645..4ef4c57c7ddf 100644 --- a/packages/google-cloud-ids/setup.py +++ b/packages/google-cloud-ids/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-ids/testing/constraints-3.7.txt b/packages/google-cloud-ids/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-ids/testing/constraints-3.7.txt +++ b/packages/google-cloud-ids/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-ids/tests/unit/gapic/ids_v1/test_ids.py b/packages/google-cloud-ids/tests/unit/gapic/ids_v1/test_ids.py index 383f07a7a369..f4df94e03eb5 100644 --- a/packages/google-cloud-ids/tests/unit/gapic/ids_v1/test_ids.py +++ b/packages/google-cloud-ids/tests/unit/gapic/ids_v1/test_ids.py @@ -89,18 +89,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -280,7 +268,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -307,42 +295,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -353,7 +348,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_ids_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -403,7 +398,7 @@ def test_ids_client_service_account_always_use_jwt(transport_class, transport_na ], ) def test_ids_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -458,9 +453,7 @@ def test_ids_client_get_transport_class(): def test_ids_client_client_options(client_class, transport_class, transport_name): # Check that if channel is provided we won't create a new one. with mock.patch.object(IDSClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -835,20 +828,20 @@ def test_ids_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -860,13 +853,11 @@ def test_ids_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -882,8 +873,7 @@ def test_ids_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1020,8 +1010,8 @@ def test_ids_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1050,7 +1040,7 @@ def test_ids_client_create_channel_credentials_file( ) def test_list_endpoints(request_type, transport: str = "grpc"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1082,7 +1072,7 @@ def test_list_endpoints_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1099,7 +1089,7 @@ async def test_list_endpoints_async( transport: str = "grpc_asyncio", request_type=ids.ListEndpointsRequest ): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1136,7 +1126,7 @@ async def test_list_endpoints_async_from_dict(): def test_list_endpoints_field_headers(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1166,7 +1156,7 @@ def test_list_endpoints_field_headers(): @pytest.mark.asyncio async def test_list_endpoints_field_headers_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1197,7 +1187,7 @@ async def test_list_endpoints_field_headers_async(): def test_list_endpoints_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1221,7 +1211,7 @@ def test_list_endpoints_flattened(): def test_list_endpoints_flattened_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1236,7 +1226,7 @@ def test_list_endpoints_flattened_error(): @pytest.mark.asyncio async def test_list_endpoints_flattened_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1265,7 +1255,7 @@ async def test_list_endpoints_flattened_async(): @pytest.mark.asyncio async def test_list_endpoints_flattened_error_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1279,7 +1269,7 @@ async def test_list_endpoints_flattened_error_async(): def test_list_endpoints_pager(transport_name: str = "grpc"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1329,7 +1319,7 @@ def test_list_endpoints_pager(transport_name: str = "grpc"): def test_list_endpoints_pages(transport_name: str = "grpc"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1371,7 +1361,7 @@ def test_list_endpoints_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_endpoints_async_pager(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1421,7 +1411,7 @@ async def test_list_endpoints_async_pager(): @pytest.mark.asyncio async def test_list_endpoints_async_pages(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1476,7 +1466,7 @@ async def test_list_endpoints_async_pages(): ) def test_get_endpoint(request_type, transport: str = "grpc"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1520,7 +1510,7 @@ def test_get_endpoint_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1537,7 +1527,7 @@ async def test_get_endpoint_async( transport: str = "grpc_asyncio", request_type=ids.GetEndpointRequest ): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1586,7 +1576,7 @@ async def test_get_endpoint_async_from_dict(): def test_get_endpoint_field_headers(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1616,7 +1606,7 @@ def test_get_endpoint_field_headers(): @pytest.mark.asyncio async def test_get_endpoint_field_headers_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1645,7 +1635,7 @@ async def test_get_endpoint_field_headers_async(): def test_get_endpoint_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1669,7 +1659,7 @@ def test_get_endpoint_flattened(): def test_get_endpoint_flattened_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1684,7 +1674,7 @@ def test_get_endpoint_flattened_error(): @pytest.mark.asyncio async def test_get_endpoint_flattened_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1711,7 +1701,7 @@ async def test_get_endpoint_flattened_async(): @pytest.mark.asyncio async def test_get_endpoint_flattened_error_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1732,7 +1722,7 @@ async def test_get_endpoint_flattened_error_async(): ) def test_create_endpoint(request_type, transport: str = "grpc"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1759,7 +1749,7 @@ def test_create_endpoint_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1776,7 +1766,7 @@ async def test_create_endpoint_async( transport: str = "grpc_asyncio", request_type=ids.CreateEndpointRequest ): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1808,7 +1798,7 @@ async def test_create_endpoint_async_from_dict(): def test_create_endpoint_field_headers(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1838,7 +1828,7 @@ def test_create_endpoint_field_headers(): @pytest.mark.asyncio async def test_create_endpoint_field_headers_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1869,7 +1859,7 @@ async def test_create_endpoint_field_headers_async(): def test_create_endpoint_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1901,7 +1891,7 @@ def test_create_endpoint_flattened(): def test_create_endpoint_flattened_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1918,7 +1908,7 @@ def test_create_endpoint_flattened_error(): @pytest.mark.asyncio async def test_create_endpoint_flattened_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1955,7 +1945,7 @@ async def test_create_endpoint_flattened_async(): @pytest.mark.asyncio async def test_create_endpoint_flattened_error_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1978,7 +1968,7 @@ async def test_create_endpoint_flattened_error_async(): ) def test_delete_endpoint(request_type, transport: str = "grpc"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2005,7 +1995,7 @@ def test_delete_endpoint_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2022,7 +2012,7 @@ async def test_delete_endpoint_async( transport: str = "grpc_asyncio", request_type=ids.DeleteEndpointRequest ): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2054,7 +2044,7 @@ async def test_delete_endpoint_async_from_dict(): def test_delete_endpoint_field_headers(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2084,7 +2074,7 @@ def test_delete_endpoint_field_headers(): @pytest.mark.asyncio async def test_delete_endpoint_field_headers_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2115,7 +2105,7 @@ async def test_delete_endpoint_field_headers_async(): def test_delete_endpoint_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2139,7 +2129,7 @@ def test_delete_endpoint_flattened(): def test_delete_endpoint_flattened_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2154,7 +2144,7 @@ def test_delete_endpoint_flattened_error(): @pytest.mark.asyncio async def test_delete_endpoint_flattened_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2183,7 +2173,7 @@ async def test_delete_endpoint_flattened_async(): @pytest.mark.asyncio async def test_delete_endpoint_flattened_error_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2204,7 +2194,7 @@ async def test_delete_endpoint_flattened_error_async(): ) def test_list_endpoints_rest(request_type): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2255,7 +2245,7 @@ def test_list_endpoints_rest_required_fields(request_type=ids.ListEndpointsReque # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_endpoints._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2264,7 +2254,7 @@ def test_list_endpoints_rest_required_fields(request_type=ids.ListEndpointsReque jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_endpoints._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -2282,7 +2272,7 @@ def test_list_endpoints_rest_required_fields(request_type=ids.ListEndpointsReque assert jsonified_request["parent"] == "parent_value" client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2324,7 +2314,7 @@ def test_list_endpoints_rest_required_fields(request_type=ids.ListEndpointsReque def test_list_endpoints_rest_unset_required_fields(): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_endpoints._get_unset_required_fields({}) @@ -2344,7 +2334,7 @@ def test_list_endpoints_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_endpoints_rest_interceptors(null_interceptor): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IDSRestInterceptor(), ) client = IDSClient(transport=transport) @@ -2398,7 +2388,7 @@ def test_list_endpoints_rest_bad_request( transport: str = "rest", request_type=ids.ListEndpointsRequest ): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2420,7 +2410,7 @@ def test_list_endpoints_rest_bad_request( def test_list_endpoints_rest_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2461,7 +2451,7 @@ def test_list_endpoints_rest_flattened(): def test_list_endpoints_rest_flattened_error(transport: str = "rest"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2476,7 +2466,7 @@ def test_list_endpoints_rest_flattened_error(transport: str = "rest"): def test_list_endpoints_rest_pager(transport: str = "rest"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2544,7 +2534,7 @@ def test_list_endpoints_rest_pager(transport: str = "rest"): ) def test_get_endpoint_rest(request_type): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2607,7 +2597,7 @@ def test_get_endpoint_rest_required_fields(request_type=ids.GetEndpointRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_endpoint._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2616,7 +2606,7 @@ def test_get_endpoint_rest_required_fields(request_type=ids.GetEndpointRequest): jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_endpoint._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2625,7 +2615,7 @@ def test_get_endpoint_rest_required_fields(request_type=ids.GetEndpointRequest): assert jsonified_request["name"] == "name_value" client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2667,7 +2657,7 @@ def test_get_endpoint_rest_required_fields(request_type=ids.GetEndpointRequest): def test_get_endpoint_rest_unset_required_fields(): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_endpoint._get_unset_required_fields({}) @@ -2677,7 +2667,7 @@ def test_get_endpoint_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_endpoint_rest_interceptors(null_interceptor): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IDSRestInterceptor(), ) client = IDSClient(transport=transport) @@ -2729,7 +2719,7 @@ def test_get_endpoint_rest_bad_request( transport: str = "rest", request_type=ids.GetEndpointRequest ): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2751,7 +2741,7 @@ def test_get_endpoint_rest_bad_request( def test_get_endpoint_rest_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2794,7 +2784,7 @@ def test_get_endpoint_rest_flattened(): def test_get_endpoint_rest_flattened_error(transport: str = "rest"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2809,7 +2799,7 @@ def test_get_endpoint_rest_flattened_error(transport: str = "rest"): def test_get_endpoint_rest_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2822,7 +2812,7 @@ def test_get_endpoint_rest_error(): ) def test_create_endpoint_rest(request_type): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2948,7 +2938,7 @@ def test_create_endpoint_rest_required_fields(request_type=ids.CreateEndpointReq assert "endpointId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_endpoint._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2960,7 +2950,7 @@ def test_create_endpoint_rest_required_fields(request_type=ids.CreateEndpointReq jsonified_request["endpointId"] = "endpoint_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_endpoint._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -2978,7 +2968,7 @@ def test_create_endpoint_rest_required_fields(request_type=ids.CreateEndpointReq assert jsonified_request["endpointId"] == "endpoint_id_value" client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3024,7 +3014,7 @@ def test_create_endpoint_rest_required_fields(request_type=ids.CreateEndpointReq def test_create_endpoint_rest_unset_required_fields(): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_endpoint._get_unset_required_fields({}) @@ -3048,7 +3038,7 @@ def test_create_endpoint_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_endpoint_rest_interceptors(null_interceptor): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IDSRestInterceptor(), ) client = IDSClient(transport=transport) @@ -3104,7 +3094,7 @@ def test_create_endpoint_rest_bad_request( transport: str = "rest", request_type=ids.CreateEndpointRequest ): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3126,7 +3116,7 @@ def test_create_endpoint_rest_bad_request( def test_create_endpoint_rest_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3167,7 +3157,7 @@ def test_create_endpoint_rest_flattened(): def test_create_endpoint_rest_flattened_error(transport: str = "rest"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3184,7 +3174,7 @@ def test_create_endpoint_rest_flattened_error(transport: str = "rest"): def test_create_endpoint_rest_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3197,7 +3187,7 @@ def test_create_endpoint_rest_error(): ) def test_delete_endpoint_rest(request_type): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3241,7 +3231,7 @@ def test_delete_endpoint_rest_required_fields(request_type=ids.DeleteEndpointReq # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_endpoint._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3250,7 +3240,7 @@ def test_delete_endpoint_rest_required_fields(request_type=ids.DeleteEndpointReq jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_endpoint._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -3261,7 +3251,7 @@ def test_delete_endpoint_rest_required_fields(request_type=ids.DeleteEndpointReq assert jsonified_request["name"] == "name_value" client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3300,7 +3290,7 @@ def test_delete_endpoint_rest_required_fields(request_type=ids.DeleteEndpointReq def test_delete_endpoint_rest_unset_required_fields(): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_endpoint._get_unset_required_fields({}) @@ -3310,7 +3300,7 @@ def test_delete_endpoint_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_endpoint_rest_interceptors(null_interceptor): transport = transports.IDSRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.IDSRestInterceptor(), ) client = IDSClient(transport=transport) @@ -3366,7 +3356,7 @@ def test_delete_endpoint_rest_bad_request( transport: str = "rest", request_type=ids.DeleteEndpointRequest ): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3388,7 +3378,7 @@ def test_delete_endpoint_rest_bad_request( def test_delete_endpoint_rest_flattened(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3429,7 +3419,7 @@ def test_delete_endpoint_rest_flattened(): def test_delete_endpoint_rest_flattened_error(transport: str = "rest"): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3444,24 +3434,24 @@ def test_delete_endpoint_rest_flattened_error(transport: str = "rest"): def test_delete_endpoint_rest_error(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.IDSGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.IDSGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IDSClient( @@ -3471,7 +3461,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.IDSGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3486,13 +3476,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = IDSClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.IDSGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = IDSClient( @@ -3504,7 +3493,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.IDSGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = IDSClient(transport=transport) assert client.transport is transport @@ -3513,13 +3502,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.IDSGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.IDSGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3536,7 +3525,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3550,7 +3539,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = IDSClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3558,7 +3547,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3570,7 +3559,7 @@ def test_ids_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.IDSTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3582,7 +3571,7 @@ def test_ids_base_transport(): ) as Transport: Transport.return_value = None transport = transports.IDSTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3622,7 +3611,7 @@ def test_ids_base_transport_with_credentials_file(): "google.cloud.ids_v1.services.ids.transports.IDSTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IDSTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3641,7 +3630,7 @@ def test_ids_base_transport_with_adc(): "google.cloud.ids_v1.services.ids.transports.IDSTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.IDSTransport() adc.assert_called_once() @@ -3649,7 +3638,7 @@ def test_ids_base_transport_with_adc(): def test_ids_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) IDSClient() adc.assert_called_once_with( scopes=None, @@ -3669,7 +3658,7 @@ def test_ids_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -3716,7 +3705,7 @@ def test_ids_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -3740,7 +3729,7 @@ def test_ids_transport_create_channel(transport_class, grpc_helpers): "transport_class", [transports.IDSGrpcTransport, transports.IDSGrpcAsyncIOTransport] ) def test_ids_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -3778,7 +3767,7 @@ def test_ids_grpc_transport_client_cert_source_for_mtls(transport_class): def test_ids_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -3790,7 +3779,7 @@ def test_ids_http_transport_client_cert_source_for_mtls(): def test_ids_rest_lro_client(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -3815,7 +3804,7 @@ def test_ids_rest_lro_client(): ) def test_ids_host_no_port(transport_name): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions(api_endpoint="ids.googleapis.com"), transport=transport_name, ) @@ -3836,7 +3825,7 @@ def test_ids_host_no_port(transport_name): ) def test_ids_host_with_port(transport_name): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="ids.googleapis.com:8000" ), @@ -3856,8 +3845,8 @@ def test_ids_host_with_port(transport_name): ], ) def test_ids_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = IDSClient( credentials=creds1, transport=transport_name, @@ -3924,7 +3913,7 @@ def test_ids_transport_channel_mtls_with_client_cert_source(transport_class): mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -3998,7 +3987,7 @@ def test_ids_transport_channel_mtls_with_adc(transport_class): def test_ids_grpc_lro_client(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -4015,7 +4004,7 @@ def test_ids_grpc_lro_client(): def test_ids_grpc_lro_async_client(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -4164,7 +4153,7 @@ def test_client_with_default_client_info(): with mock.patch.object(transports.IDSTransport, "_prep_wrapped_messages") as prep: client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4172,7 +4161,7 @@ def test_client_with_default_client_info(): with mock.patch.object(transports.IDSTransport, "_prep_wrapped_messages") as prep: transport_class = IDSClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4181,7 +4170,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = IDSAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4200,7 +4189,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4217,7 +4206,7 @@ def test_client_ctx(): ] for transport in transports: client = IDSClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory/gapic_version.py b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory/gapic_version.py index 71423fb2cbb9..360a0d13ebdd 100644 --- a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory/gapic_version.py +++ b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.2.3" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/gapic_version.py b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/gapic_version.py index 71423fb2cbb9..360a0d13ebdd 100644 --- a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/gapic_version.py +++ b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.2.3" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_dashboard_service/client.py b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_dashboard_service/client.py index bd1e91f2d5e5..142dbba9bfe1 100644 --- a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_dashboard_service/client.py +++ b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_dashboard_service/client.py @@ -414,6 +414,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -432,6 +433,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -506,17 +508,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = KeyDashboardServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = KeyDashboardServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_tracking_service/client.py b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_tracking_service/client.py index bc8d1238c216..44460949b4f4 100644 --- a/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_tracking_service/client.py +++ b/packages/google-cloud-kms-inventory/google/cloud/kms_inventory_v1/services/key_tracking_service/client.py @@ -423,6 +423,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -441,6 +442,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -515,17 +517,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = KeyTrackingServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = KeyTrackingServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-kms-inventory/samples/generated_samples/snippet_metadata_google.cloud.kms.inventory.v1.json b/packages/google-cloud-kms-inventory/samples/generated_samples/snippet_metadata_google.cloud.kms.inventory.v1.json index af88cd48bb82..b884eb2a257b 100644 --- a/packages/google-cloud-kms-inventory/samples/generated_samples/snippet_metadata_google.cloud.kms.inventory.v1.json +++ b/packages/google-cloud-kms-inventory/samples/generated_samples/snippet_metadata_google.cloud.kms.inventory.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-kms-inventory", - "version": "0.2.3" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-kms-inventory/setup.py b/packages/google-cloud-kms-inventory/setup.py index 3637c4537ced..3de0970b2696 100644 --- a/packages/google-cloud-kms-inventory/setup.py +++ b/packages/google-cloud-kms-inventory/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", "google-cloud-kms >= 2.3.0, <3.0.0dev", diff --git a/packages/google-cloud-kms-inventory/testing/constraints-3.7.txt b/packages/google-cloud-kms-inventory/testing/constraints-3.7.txt index 65db4ddbde6c..5754948d1673 100644 --- a/packages/google-cloud-kms-inventory/testing/constraints-3.7.txt +++ b/packages/google-cloud-kms-inventory/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 google-cloud-kms==2.3.0 diff --git a/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_dashboard_service.py b/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_dashboard_service.py index e8a585529888..0a3838030f94 100644 --- a/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_dashboard_service.py +++ b/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_dashboard_service.py @@ -78,18 +78,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -339,7 +327,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -366,42 +354,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -414,7 +409,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_key_dashboard_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -468,7 +463,7 @@ def test_key_dashboard_service_client_service_account_always_use_jwt( def test_key_dashboard_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -539,9 +534,7 @@ def test_key_dashboard_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(KeyDashboardServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -960,20 +953,20 @@ def test_key_dashboard_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -985,13 +978,11 @@ def test_key_dashboard_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -1007,8 +998,7 @@ def test_key_dashboard_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1174,8 +1164,8 @@ def test_key_dashboard_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1204,7 +1194,7 @@ def test_key_dashboard_service_client_create_channel_credentials_file( ) def test_list_crypto_keys(request_type, transport: str = "grpc"): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1234,7 +1224,7 @@ def test_list_crypto_keys_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1252,7 +1242,7 @@ async def test_list_crypto_keys_async( request_type=key_dashboard_service.ListCryptoKeysRequest, ): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1287,7 +1277,7 @@ async def test_list_crypto_keys_async_from_dict(): def test_list_crypto_keys_field_headers(): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1317,7 +1307,7 @@ def test_list_crypto_keys_field_headers(): @pytest.mark.asyncio async def test_list_crypto_keys_field_headers_async(): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1348,7 +1338,7 @@ async def test_list_crypto_keys_field_headers_async(): def test_list_crypto_keys_flattened(): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1372,7 +1362,7 @@ def test_list_crypto_keys_flattened(): def test_list_crypto_keys_flattened_error(): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1387,7 +1377,7 @@ def test_list_crypto_keys_flattened_error(): @pytest.mark.asyncio async def test_list_crypto_keys_flattened_async(): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1416,7 +1406,7 @@ async def test_list_crypto_keys_flattened_async(): @pytest.mark.asyncio async def test_list_crypto_keys_flattened_error_async(): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1430,7 +1420,7 @@ async def test_list_crypto_keys_flattened_error_async(): def test_list_crypto_keys_pager(transport_name: str = "grpc"): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1480,7 +1470,7 @@ def test_list_crypto_keys_pager(transport_name: str = "grpc"): def test_list_crypto_keys_pages(transport_name: str = "grpc"): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1522,7 +1512,7 @@ def test_list_crypto_keys_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_crypto_keys_async_pager(): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1572,7 +1562,7 @@ async def test_list_crypto_keys_async_pager(): @pytest.mark.asyncio async def test_list_crypto_keys_async_pages(): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1627,7 +1617,7 @@ async def test_list_crypto_keys_async_pages(): ) def test_list_crypto_keys_rest(request_type): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -1678,7 +1668,7 @@ def test_list_crypto_keys_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_crypto_keys._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -1687,7 +1677,7 @@ def test_list_crypto_keys_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_crypto_keys._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -1703,7 +1693,7 @@ def test_list_crypto_keys_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -1745,7 +1735,7 @@ def test_list_crypto_keys_rest_required_fields( def test_list_crypto_keys_rest_unset_required_fields(): transport = transports.KeyDashboardServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_crypto_keys._get_unset_required_fields({}) @@ -1763,7 +1753,7 @@ def test_list_crypto_keys_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_crypto_keys_rest_interceptors(null_interceptor): transport = transports.KeyDashboardServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyDashboardServiceRestInterceptor(), @@ -1823,7 +1813,7 @@ def test_list_crypto_keys_rest_bad_request( transport: str = "rest", request_type=key_dashboard_service.ListCryptoKeysRequest ): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1845,7 +1835,7 @@ def test_list_crypto_keys_rest_bad_request( def test_list_crypto_keys_rest_flattened(): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -1885,7 +1875,7 @@ def test_list_crypto_keys_rest_flattened(): def test_list_crypto_keys_rest_flattened_error(transport: str = "rest"): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1900,7 +1890,7 @@ def test_list_crypto_keys_rest_flattened_error(transport: str = "rest"): def test_list_crypto_keys_rest_pager(transport: str = "rest"): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1964,17 +1954,17 @@ def test_list_crypto_keys_rest_pager(transport: str = "rest"): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.KeyDashboardServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.KeyDashboardServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyDashboardServiceClient( @@ -1984,7 +1974,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.KeyDashboardServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -1999,13 +1989,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = KeyDashboardServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.KeyDashboardServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyDashboardServiceClient( @@ -2017,7 +2006,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.KeyDashboardServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = KeyDashboardServiceClient(transport=transport) assert client.transport is transport @@ -2026,13 +2015,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.KeyDashboardServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.KeyDashboardServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2049,7 +2038,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2063,7 +2052,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = KeyDashboardServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2071,7 +2060,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2083,7 +2072,7 @@ def test_key_dashboard_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.KeyDashboardServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2095,7 +2084,7 @@ def test_key_dashboard_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.KeyDashboardServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2125,7 +2114,7 @@ def test_key_dashboard_service_base_transport_with_credentials_file(): "google.cloud.kms_inventory_v1.services.key_dashboard_service.transports.KeyDashboardServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.KeyDashboardServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2144,7 +2133,7 @@ def test_key_dashboard_service_base_transport_with_adc(): "google.cloud.kms_inventory_v1.services.key_dashboard_service.transports.KeyDashboardServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.KeyDashboardServiceTransport() adc.assert_called_once() @@ -2152,7 +2141,7 @@ def test_key_dashboard_service_base_transport_with_adc(): def test_key_dashboard_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) KeyDashboardServiceClient() adc.assert_called_once_with( scopes=None, @@ -2172,7 +2161,7 @@ def test_key_dashboard_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2219,7 +2208,7 @@ def test_key_dashboard_service_transport_create_channel(transport_class, grpc_he ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2249,7 +2238,7 @@ def test_key_dashboard_service_transport_create_channel(transport_class, grpc_he def test_key_dashboard_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2287,7 +2276,7 @@ def test_key_dashboard_service_grpc_transport_client_cert_source_for_mtls( def test_key_dashboard_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -2307,7 +2296,7 @@ def test_key_dashboard_service_http_transport_client_cert_source_for_mtls(): ) def test_key_dashboard_service_host_no_port(transport_name): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="kmsinventory.googleapis.com" ), @@ -2330,7 +2319,7 @@ def test_key_dashboard_service_host_no_port(transport_name): ) def test_key_dashboard_service_host_with_port(transport_name): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="kmsinventory.googleapis.com:8000" ), @@ -2350,8 +2339,8 @@ def test_key_dashboard_service_host_with_port(transport_name): ], ) def test_key_dashboard_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = KeyDashboardServiceClient( credentials=creds1, transport=transport_name, @@ -2415,7 +2404,7 @@ def test_key_dashboard_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2666,7 +2655,7 @@ def test_client_with_default_client_info(): transports.KeyDashboardServiceTransport, "_prep_wrapped_messages" ) as prep: client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2676,7 +2665,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = KeyDashboardServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2685,7 +2674,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = KeyDashboardServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -2704,7 +2693,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -2721,7 +2710,7 @@ def test_client_ctx(): ] for transport in transports: client = KeyDashboardServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_tracking_service.py b/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_tracking_service.py index e22cecb7c667..20f12c4b01f9 100644 --- a/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_tracking_service.py +++ b/packages/google-cloud-kms-inventory/tests/unit/gapic/kms_inventory_v1/test_key_tracking_service.py @@ -77,18 +77,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -328,7 +316,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -355,42 +343,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -403,7 +398,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_key_tracking_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -457,7 +452,7 @@ def test_key_tracking_service_client_service_account_always_use_jwt( def test_key_tracking_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -520,9 +515,7 @@ def test_key_tracking_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(KeyTrackingServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -941,20 +934,20 @@ def test_key_tracking_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -966,13 +959,11 @@ def test_key_tracking_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -988,8 +979,7 @@ def test_key_tracking_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1147,8 +1137,8 @@ def test_key_tracking_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1177,7 +1167,7 @@ def test_key_tracking_service_client_create_channel_credentials_file( ) def test_get_protected_resources_summary(request_type, transport: str = "grpc"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1213,7 +1203,7 @@ def test_get_protected_resources_summary_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1233,7 +1223,7 @@ async def test_get_protected_resources_summary_async( request_type=key_tracking_service.GetProtectedResourcesSummaryRequest, ): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1274,7 +1264,7 @@ async def test_get_protected_resources_summary_async_from_dict(): def test_get_protected_resources_summary_field_headers(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1306,7 +1296,7 @@ def test_get_protected_resources_summary_field_headers(): @pytest.mark.asyncio async def test_get_protected_resources_summary_field_headers_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1339,7 +1329,7 @@ async def test_get_protected_resources_summary_field_headers_async(): def test_get_protected_resources_summary_flattened(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1365,7 +1355,7 @@ def test_get_protected_resources_summary_flattened(): def test_get_protected_resources_summary_flattened_error(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1380,7 +1370,7 @@ def test_get_protected_resources_summary_flattened_error(): @pytest.mark.asyncio async def test_get_protected_resources_summary_flattened_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1411,7 +1401,7 @@ async def test_get_protected_resources_summary_flattened_async(): @pytest.mark.asyncio async def test_get_protected_resources_summary_flattened_error_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1432,7 +1422,7 @@ async def test_get_protected_resources_summary_flattened_error_async(): ) def test_search_protected_resources(request_type, transport: str = "grpc"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1464,7 +1454,7 @@ def test_search_protected_resources_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1484,7 +1474,7 @@ async def test_search_protected_resources_async( request_type=key_tracking_service.SearchProtectedResourcesRequest, ): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1521,7 +1511,7 @@ async def test_search_protected_resources_async_from_dict(): def test_search_protected_resources_field_headers(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1553,7 +1543,7 @@ def test_search_protected_resources_field_headers(): @pytest.mark.asyncio async def test_search_protected_resources_field_headers_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1586,7 +1576,7 @@ async def test_search_protected_resources_field_headers_async(): def test_search_protected_resources_flattened(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1616,7 +1606,7 @@ def test_search_protected_resources_flattened(): def test_search_protected_resources_flattened_error(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1632,7 +1622,7 @@ def test_search_protected_resources_flattened_error(): @pytest.mark.asyncio async def test_search_protected_resources_flattened_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1667,7 +1657,7 @@ async def test_search_protected_resources_flattened_async(): @pytest.mark.asyncio async def test_search_protected_resources_flattened_error_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1682,7 +1672,7 @@ async def test_search_protected_resources_flattened_error_async(): def test_search_protected_resources_pager(transport_name: str = "grpc"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1736,7 +1726,7 @@ def test_search_protected_resources_pager(transport_name: str = "grpc"): def test_search_protected_resources_pages(transport_name: str = "grpc"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1780,7 +1770,7 @@ def test_search_protected_resources_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_search_protected_resources_async_pager(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1834,7 +1824,7 @@ async def test_search_protected_resources_async_pager(): @pytest.mark.asyncio async def test_search_protected_resources_async_pages(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1891,7 +1881,7 @@ async def test_search_protected_resources_async_pages(): ) def test_get_protected_resources_summary_rest(request_type): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -1948,7 +1938,7 @@ def test_get_protected_resources_summary_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_protected_resources_summary._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -1957,7 +1947,7 @@ def test_get_protected_resources_summary_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_protected_resources_summary._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -1966,7 +1956,7 @@ def test_get_protected_resources_summary_rest_required_fields( assert jsonified_request["name"] == "name_value" client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2010,7 +2000,7 @@ def test_get_protected_resources_summary_rest_required_fields( def test_get_protected_resources_summary_rest_unset_required_fields(): transport = transports.KeyTrackingServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_protected_resources_summary._get_unset_required_fields( @@ -2022,7 +2012,7 @@ def test_get_protected_resources_summary_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_protected_resources_summary_rest_interceptors(null_interceptor): transport = transports.KeyTrackingServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyTrackingServiceRestInterceptor(), @@ -2085,7 +2075,7 @@ def test_get_protected_resources_summary_rest_bad_request( request_type=key_tracking_service.GetProtectedResourcesSummaryRequest, ): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2109,7 +2099,7 @@ def test_get_protected_resources_summary_rest_bad_request( def test_get_protected_resources_summary_rest_flattened(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2153,7 +2143,7 @@ def test_get_protected_resources_summary_rest_flattened(): def test_get_protected_resources_summary_rest_flattened_error(transport: str = "rest"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2168,7 +2158,7 @@ def test_get_protected_resources_summary_rest_flattened_error(transport: str = " def test_get_protected_resources_summary_rest_error(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2181,7 +2171,7 @@ def test_get_protected_resources_summary_rest_error(): ) def test_search_protected_resources_rest(request_type): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2236,7 +2226,7 @@ def test_search_protected_resources_rest_required_fields( assert "cryptoKey" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).search_protected_resources._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2248,7 +2238,7 @@ def test_search_protected_resources_rest_required_fields( jsonified_request["cryptoKey"] = "crypto_key_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).search_protected_resources._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -2268,7 +2258,7 @@ def test_search_protected_resources_rest_required_fields( assert jsonified_request["cryptoKey"] == "crypto_key_value" client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2318,7 +2308,7 @@ def test_search_protected_resources_rest_required_fields( def test_search_protected_resources_rest_unset_required_fields(): transport = transports.KeyTrackingServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.search_protected_resources._get_unset_required_fields({}) @@ -2343,7 +2333,7 @@ def test_search_protected_resources_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_search_protected_resources_rest_interceptors(null_interceptor): transport = transports.KeyTrackingServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyTrackingServiceRestInterceptor(), @@ -2404,7 +2394,7 @@ def test_search_protected_resources_rest_bad_request( request_type=key_tracking_service.SearchProtectedResourcesRequest, ): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2426,7 +2416,7 @@ def test_search_protected_resources_rest_bad_request( def test_search_protected_resources_rest_flattened(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2471,7 +2461,7 @@ def test_search_protected_resources_rest_flattened(): def test_search_protected_resources_rest_flattened_error(transport: str = "rest"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2487,7 +2477,7 @@ def test_search_protected_resources_rest_flattened_error(transport: str = "rest" def test_search_protected_resources_rest_pager(transport: str = "rest"): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2554,17 +2544,17 @@ def test_search_protected_resources_rest_pager(transport: str = "rest"): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.KeyTrackingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.KeyTrackingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyTrackingServiceClient( @@ -2574,7 +2564,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.KeyTrackingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2589,13 +2579,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = KeyTrackingServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.KeyTrackingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyTrackingServiceClient( @@ -2607,7 +2596,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.KeyTrackingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = KeyTrackingServiceClient(transport=transport) assert client.transport is transport @@ -2616,13 +2605,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.KeyTrackingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.KeyTrackingServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2639,7 +2628,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2653,7 +2642,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = KeyTrackingServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2661,7 +2650,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2673,7 +2662,7 @@ def test_key_tracking_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.KeyTrackingServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2685,7 +2674,7 @@ def test_key_tracking_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.KeyTrackingServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2718,7 +2707,7 @@ def test_key_tracking_service_base_transport_with_credentials_file(): "google.cloud.kms_inventory_v1.services.key_tracking_service.transports.KeyTrackingServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.KeyTrackingServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2737,7 +2726,7 @@ def test_key_tracking_service_base_transport_with_adc(): "google.cloud.kms_inventory_v1.services.key_tracking_service.transports.KeyTrackingServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.KeyTrackingServiceTransport() adc.assert_called_once() @@ -2745,7 +2734,7 @@ def test_key_tracking_service_base_transport_with_adc(): def test_key_tracking_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) KeyTrackingServiceClient() adc.assert_called_once_with( scopes=None, @@ -2765,7 +2754,7 @@ def test_key_tracking_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2812,7 +2801,7 @@ def test_key_tracking_service_transport_create_channel(transport_class, grpc_hel ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2842,7 +2831,7 @@ def test_key_tracking_service_transport_create_channel(transport_class, grpc_hel def test_key_tracking_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2880,7 +2869,7 @@ def test_key_tracking_service_grpc_transport_client_cert_source_for_mtls( def test_key_tracking_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -2900,7 +2889,7 @@ def test_key_tracking_service_http_transport_client_cert_source_for_mtls(): ) def test_key_tracking_service_host_no_port(transport_name): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="kmsinventory.googleapis.com" ), @@ -2923,7 +2912,7 @@ def test_key_tracking_service_host_no_port(transport_name): ) def test_key_tracking_service_host_with_port(transport_name): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="kmsinventory.googleapis.com:8000" ), @@ -2943,8 +2932,8 @@ def test_key_tracking_service_host_with_port(transport_name): ], ) def test_key_tracking_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = KeyTrackingServiceClient( credentials=creds1, transport=transport_name, @@ -3011,7 +3000,7 @@ def test_key_tracking_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -3277,7 +3266,7 @@ def test_client_with_default_client_info(): transports.KeyTrackingServiceTransport, "_prep_wrapped_messages" ) as prep: client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3287,7 +3276,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = KeyTrackingServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3296,7 +3285,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = KeyTrackingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -3315,7 +3304,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -3332,7 +3321,7 @@ def test_client_ctx(): ] for transport in transports: client = KeyTrackingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-kms/google/cloud/kms/gapic_version.py b/packages/google-cloud-kms/google/cloud/kms/gapic_version.py index 91772ebd624b..360a0d13ebdd 100644 --- a/packages/google-cloud-kms/google/cloud/kms/gapic_version.py +++ b/packages/google-cloud-kms/google/cloud/kms/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.21.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-kms/google/cloud/kms_v1/gapic_version.py b/packages/google-cloud-kms/google/cloud/kms_v1/gapic_version.py index 91772ebd624b..360a0d13ebdd 100644 --- a/packages/google-cloud-kms/google/cloud/kms_v1/gapic_version.py +++ b/packages/google-cloud-kms/google/cloud/kms_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.21.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-kms/google/cloud/kms_v1/services/ekm_service/client.py b/packages/google-cloud-kms/google/cloud/kms_v1/services/ekm_service/client.py index 969be9e2e291..5fe0b450e21e 100644 --- a/packages/google-cloud-kms/google/cloud/kms_v1/services/ekm_service/client.py +++ b/packages/google-cloud-kms/google/cloud/kms_v1/services/ekm_service/client.py @@ -436,6 +436,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -454,6 +455,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -528,17 +530,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = EkmServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = EkmServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-kms/google/cloud/kms_v1/services/key_management_service/client.py b/packages/google-cloud-kms/google/cloud/kms_v1/services/key_management_service/client.py index 8a42e698a18e..0095edf19a80 100644 --- a/packages/google-cloud-kms/google/cloud/kms_v1/services/key_management_service/client.py +++ b/packages/google-cloud-kms/google/cloud/kms_v1/services/key_management_service/client.py @@ -503,6 +503,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -521,6 +522,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -595,17 +597,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = KeyManagementServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = KeyManagementServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-kms/samples/generated_samples/snippet_metadata_google.cloud.kms.v1.json b/packages/google-cloud-kms/samples/generated_samples/snippet_metadata_google.cloud.kms.v1.json index b3d26af68480..b7cab18c6200 100644 --- a/packages/google-cloud-kms/samples/generated_samples/snippet_metadata_google.cloud.kms.v1.json +++ b/packages/google-cloud-kms/samples/generated_samples/snippet_metadata_google.cloud.kms.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-kms", - "version": "2.21.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-kms/setup.py b/packages/google-cloud-kms/setup.py index 874c679e3f99..97f4aff0398b 100644 --- a/packages/google-cloud-kms/setup.py +++ b/packages/google-cloud-kms/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", diff --git a/packages/google-cloud-kms/testing/constraints-3.7.txt b/packages/google-cloud-kms/testing/constraints-3.7.txt index 44ffd04543a8..712d45b4c5ea 100644 --- a/packages/google-cloud-kms/testing/constraints-3.7.txt +++ b/packages/google-cloud-kms/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 grpc-google-iam-v1==0.12.4 diff --git a/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_ekm_service.py b/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_ekm_service.py index 5ff01cadc15d..4df5fc7228c7 100644 --- a/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_ekm_service.py +++ b/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_ekm_service.py @@ -84,18 +84,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -299,7 +287,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -326,42 +314,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -372,7 +367,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_ekm_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -424,7 +419,7 @@ def test_ekm_service_client_service_account_always_use_jwt( ], ) def test_ekm_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -487,9 +482,7 @@ def test_ekm_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(EkmServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -882,20 +875,20 @@ def test_ekm_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -907,13 +900,11 @@ def test_ekm_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -929,8 +920,7 @@ def test_ekm_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1071,8 +1061,8 @@ def test_ekm_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1104,7 +1094,7 @@ def test_ekm_service_client_create_channel_credentials_file( ) def test_list_ekm_connections(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1138,7 +1128,7 @@ def test_list_ekm_connections_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1157,7 +1147,7 @@ async def test_list_ekm_connections_async( transport: str = "grpc_asyncio", request_type=ekm_service.ListEkmConnectionsRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1196,7 +1186,7 @@ async def test_list_ekm_connections_async_from_dict(): def test_list_ekm_connections_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1228,7 +1218,7 @@ def test_list_ekm_connections_field_headers(): @pytest.mark.asyncio async def test_list_ekm_connections_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1261,7 +1251,7 @@ async def test_list_ekm_connections_field_headers_async(): def test_list_ekm_connections_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1287,7 +1277,7 @@ def test_list_ekm_connections_flattened(): def test_list_ekm_connections_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1302,7 +1292,7 @@ def test_list_ekm_connections_flattened_error(): @pytest.mark.asyncio async def test_list_ekm_connections_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1333,7 +1323,7 @@ async def test_list_ekm_connections_flattened_async(): @pytest.mark.asyncio async def test_list_ekm_connections_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1347,7 +1337,7 @@ async def test_list_ekm_connections_flattened_error_async(): def test_list_ekm_connections_pager(transport_name: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1399,7 +1389,7 @@ def test_list_ekm_connections_pager(transport_name: str = "grpc"): def test_list_ekm_connections_pages(transport_name: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1443,7 +1433,7 @@ def test_list_ekm_connections_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_ekm_connections_async_pager(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1495,7 +1485,7 @@ async def test_list_ekm_connections_async_pager(): @pytest.mark.asyncio async def test_list_ekm_connections_async_pages(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1552,7 +1542,7 @@ async def test_list_ekm_connections_async_pages(): ) def test_get_ekm_connection(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1593,7 +1583,7 @@ def test_get_ekm_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1612,7 +1602,7 @@ async def test_get_ekm_connection_async( transport: str = "grpc_asyncio", request_type=ekm_service.GetEkmConnectionRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1658,7 +1648,7 @@ async def test_get_ekm_connection_async_from_dict(): def test_get_ekm_connection_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1690,7 +1680,7 @@ def test_get_ekm_connection_field_headers(): @pytest.mark.asyncio async def test_get_ekm_connection_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1723,7 +1713,7 @@ async def test_get_ekm_connection_field_headers_async(): def test_get_ekm_connection_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1749,7 +1739,7 @@ def test_get_ekm_connection_flattened(): def test_get_ekm_connection_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1764,7 +1754,7 @@ def test_get_ekm_connection_flattened_error(): @pytest.mark.asyncio async def test_get_ekm_connection_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1795,7 +1785,7 @@ async def test_get_ekm_connection_flattened_async(): @pytest.mark.asyncio async def test_get_ekm_connection_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1816,7 +1806,7 @@ async def test_get_ekm_connection_flattened_error_async(): ) def test_create_ekm_connection(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1857,7 +1847,7 @@ def test_create_ekm_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1876,7 +1866,7 @@ async def test_create_ekm_connection_async( transport: str = "grpc_asyncio", request_type=ekm_service.CreateEkmConnectionRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1922,7 +1912,7 @@ async def test_create_ekm_connection_async_from_dict(): def test_create_ekm_connection_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1954,7 +1944,7 @@ def test_create_ekm_connection_field_headers(): @pytest.mark.asyncio async def test_create_ekm_connection_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1987,7 +1977,7 @@ async def test_create_ekm_connection_field_headers_async(): def test_create_ekm_connection_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2021,7 +2011,7 @@ def test_create_ekm_connection_flattened(): def test_create_ekm_connection_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2038,7 +2028,7 @@ def test_create_ekm_connection_flattened_error(): @pytest.mark.asyncio async def test_create_ekm_connection_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2077,7 +2067,7 @@ async def test_create_ekm_connection_flattened_async(): @pytest.mark.asyncio async def test_create_ekm_connection_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2100,7 +2090,7 @@ async def test_create_ekm_connection_flattened_error_async(): ) def test_update_ekm_connection(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2141,7 +2131,7 @@ def test_update_ekm_connection_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2160,7 +2150,7 @@ async def test_update_ekm_connection_async( transport: str = "grpc_asyncio", request_type=ekm_service.UpdateEkmConnectionRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2206,7 +2196,7 @@ async def test_update_ekm_connection_async_from_dict(): def test_update_ekm_connection_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2238,7 +2228,7 @@ def test_update_ekm_connection_field_headers(): @pytest.mark.asyncio async def test_update_ekm_connection_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2271,7 +2261,7 @@ async def test_update_ekm_connection_field_headers_async(): def test_update_ekm_connection_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2301,7 +2291,7 @@ def test_update_ekm_connection_flattened(): def test_update_ekm_connection_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2317,7 +2307,7 @@ def test_update_ekm_connection_flattened_error(): @pytest.mark.asyncio async def test_update_ekm_connection_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2352,7 +2342,7 @@ async def test_update_ekm_connection_flattened_async(): @pytest.mark.asyncio async def test_update_ekm_connection_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2374,7 +2364,7 @@ async def test_update_ekm_connection_flattened_error_async(): ) def test_get_ekm_config(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2406,7 +2396,7 @@ def test_get_ekm_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2423,7 +2413,7 @@ async def test_get_ekm_config_async( transport: str = "grpc_asyncio", request_type=ekm_service.GetEkmConfigRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2460,7 +2450,7 @@ async def test_get_ekm_config_async_from_dict(): def test_get_ekm_config_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2490,7 +2480,7 @@ def test_get_ekm_config_field_headers(): @pytest.mark.asyncio async def test_get_ekm_config_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2521,7 +2511,7 @@ async def test_get_ekm_config_field_headers_async(): def test_get_ekm_config_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2545,7 +2535,7 @@ def test_get_ekm_config_flattened(): def test_get_ekm_config_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2560,7 +2550,7 @@ def test_get_ekm_config_flattened_error(): @pytest.mark.asyncio async def test_get_ekm_config_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2589,7 +2579,7 @@ async def test_get_ekm_config_flattened_async(): @pytest.mark.asyncio async def test_get_ekm_config_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2610,7 +2600,7 @@ async def test_get_ekm_config_flattened_error_async(): ) def test_update_ekm_config(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2644,7 +2634,7 @@ def test_update_ekm_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2663,7 +2653,7 @@ async def test_update_ekm_config_async( transport: str = "grpc_asyncio", request_type=ekm_service.UpdateEkmConfigRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2702,7 +2692,7 @@ async def test_update_ekm_config_async_from_dict(): def test_update_ekm_config_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2734,7 +2724,7 @@ def test_update_ekm_config_field_headers(): @pytest.mark.asyncio async def test_update_ekm_config_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2767,7 +2757,7 @@ async def test_update_ekm_config_field_headers_async(): def test_update_ekm_config_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2797,7 +2787,7 @@ def test_update_ekm_config_flattened(): def test_update_ekm_config_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2813,7 +2803,7 @@ def test_update_ekm_config_flattened_error(): @pytest.mark.asyncio async def test_update_ekm_config_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2848,7 +2838,7 @@ async def test_update_ekm_config_flattened_async(): @pytest.mark.asyncio async def test_update_ekm_config_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2870,7 +2860,7 @@ async def test_update_ekm_config_flattened_error_async(): ) def test_verify_connectivity(request_type, transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2899,7 +2889,7 @@ def test_verify_connectivity_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2918,7 +2908,7 @@ async def test_verify_connectivity_async( transport: str = "grpc_asyncio", request_type=ekm_service.VerifyConnectivityRequest ): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2952,7 +2942,7 @@ async def test_verify_connectivity_async_from_dict(): def test_verify_connectivity_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2984,7 +2974,7 @@ def test_verify_connectivity_field_headers(): @pytest.mark.asyncio async def test_verify_connectivity_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3017,7 +3007,7 @@ async def test_verify_connectivity_field_headers_async(): def test_verify_connectivity_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3043,7 +3033,7 @@ def test_verify_connectivity_flattened(): def test_verify_connectivity_flattened_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3058,7 +3048,7 @@ def test_verify_connectivity_flattened_error(): @pytest.mark.asyncio async def test_verify_connectivity_flattened_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3089,7 +3079,7 @@ async def test_verify_connectivity_flattened_async(): @pytest.mark.asyncio async def test_verify_connectivity_flattened_error_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3110,7 +3100,7 @@ async def test_verify_connectivity_flattened_error_async(): ) def test_list_ekm_connections_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3163,7 +3153,7 @@ def test_list_ekm_connections_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_ekm_connections._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3172,7 +3162,7 @@ def test_list_ekm_connections_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_ekm_connections._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -3190,7 +3180,7 @@ def test_list_ekm_connections_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3232,7 +3222,7 @@ def test_list_ekm_connections_rest_required_fields( def test_list_ekm_connections_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_ekm_connections._get_unset_required_fields({}) @@ -3252,7 +3242,7 @@ def test_list_ekm_connections_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_ekm_connections_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -3310,7 +3300,7 @@ def test_list_ekm_connections_rest_bad_request( transport: str = "rest", request_type=ekm_service.ListEkmConnectionsRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3332,7 +3322,7 @@ def test_list_ekm_connections_rest_bad_request( def test_list_ekm_connections_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3374,7 +3364,7 @@ def test_list_ekm_connections_rest_flattened(): def test_list_ekm_connections_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3389,7 +3379,7 @@ def test_list_ekm_connections_rest_flattened_error(transport: str = "rest"): def test_list_ekm_connections_rest_pager(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3459,7 +3449,7 @@ def test_list_ekm_connections_rest_pager(transport: str = "rest"): ) def test_get_ekm_connection_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3519,7 +3509,7 @@ def test_get_ekm_connection_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_ekm_connection._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3528,7 +3518,7 @@ def test_get_ekm_connection_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_ekm_connection._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3537,7 +3527,7 @@ def test_get_ekm_connection_rest_required_fields( assert jsonified_request["name"] == "name_value" client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3579,7 +3569,7 @@ def test_get_ekm_connection_rest_required_fields( def test_get_ekm_connection_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_ekm_connection._get_unset_required_fields({}) @@ -3589,7 +3579,7 @@ def test_get_ekm_connection_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_ekm_connection_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -3647,7 +3637,7 @@ def test_get_ekm_connection_rest_bad_request( transport: str = "rest", request_type=ekm_service.GetEkmConnectionRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3669,7 +3659,7 @@ def test_get_ekm_connection_rest_bad_request( def test_get_ekm_connection_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3713,7 +3703,7 @@ def test_get_ekm_connection_rest_flattened(): def test_get_ekm_connection_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3728,7 +3718,7 @@ def test_get_ekm_connection_rest_flattened_error(transport: str = "rest"): def test_get_ekm_connection_rest_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3741,7 +3731,7 @@ def test_get_ekm_connection_rest_error(): ) def test_create_ekm_connection_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3900,7 +3890,7 @@ def test_create_ekm_connection_rest_required_fields( assert "ekmConnectionId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_ekm_connection._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3912,7 +3902,7 @@ def test_create_ekm_connection_rest_required_fields( jsonified_request["ekmConnectionId"] = "ekm_connection_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_ekm_connection._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("ekm_connection_id",)) @@ -3925,7 +3915,7 @@ def test_create_ekm_connection_rest_required_fields( assert jsonified_request["ekmConnectionId"] == "ekm_connection_id_value" client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3974,7 +3964,7 @@ def test_create_ekm_connection_rest_required_fields( def test_create_ekm_connection_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_ekm_connection._get_unset_required_fields({}) @@ -3993,7 +3983,7 @@ def test_create_ekm_connection_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_ekm_connection_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -4051,7 +4041,7 @@ def test_create_ekm_connection_rest_bad_request( transport: str = "rest", request_type=ekm_service.CreateEkmConnectionRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4073,7 +4063,7 @@ def test_create_ekm_connection_rest_bad_request( def test_create_ekm_connection_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4117,7 +4107,7 @@ def test_create_ekm_connection_rest_flattened(): def test_create_ekm_connection_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4134,7 +4124,7 @@ def test_create_ekm_connection_rest_flattened_error(transport: str = "rest"): def test_create_ekm_connection_rest_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4147,7 +4137,7 @@ def test_create_ekm_connection_rest_error(): ) def test_update_ekm_connection_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4307,14 +4297,14 @@ def test_update_ekm_connection_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_ekm_connection._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_ekm_connection._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -4323,7 +4313,7 @@ def test_update_ekm_connection_rest_required_fields( # verify required fields with non-default values are left alone client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4366,7 +4356,7 @@ def test_update_ekm_connection_rest_required_fields( def test_update_ekm_connection_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_ekm_connection._get_unset_required_fields({}) @@ -4384,7 +4374,7 @@ def test_update_ekm_connection_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_ekm_connection_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -4442,7 +4432,7 @@ def test_update_ekm_connection_rest_bad_request( transport: str = "rest", request_type=ekm_service.UpdateEkmConnectionRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4468,7 +4458,7 @@ def test_update_ekm_connection_rest_bad_request( def test_update_ekm_connection_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4515,7 +4505,7 @@ def test_update_ekm_connection_rest_flattened(): def test_update_ekm_connection_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4531,7 +4521,7 @@ def test_update_ekm_connection_rest_flattened_error(transport: str = "rest"): def test_update_ekm_connection_rest_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4544,7 +4534,7 @@ def test_update_ekm_connection_rest_error(): ) def test_get_ekm_config_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4597,7 +4587,7 @@ def test_get_ekm_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_ekm_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4606,7 +4596,7 @@ def test_get_ekm_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_ekm_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4615,7 +4605,7 @@ def test_get_ekm_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4657,7 +4647,7 @@ def test_get_ekm_config_rest_required_fields( def test_get_ekm_config_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_ekm_config._get_unset_required_fields({}) @@ -4667,7 +4657,7 @@ def test_get_ekm_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_ekm_config_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -4725,7 +4715,7 @@ def test_get_ekm_config_rest_bad_request( transport: str = "rest", request_type=ekm_service.GetEkmConfigRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4747,7 +4737,7 @@ def test_get_ekm_config_rest_bad_request( def test_get_ekm_config_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4788,7 +4778,7 @@ def test_get_ekm_config_rest_flattened(): def test_get_ekm_config_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4803,7 +4793,7 @@ def test_get_ekm_config_rest_flattened_error(transport: str = "rest"): def test_get_ekm_config_rest_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4816,7 +4806,7 @@ def test_get_ekm_config_rest_error(): ) def test_update_ekm_config_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4941,14 +4931,14 @@ def test_update_ekm_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_ekm_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_ekm_config._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -4957,7 +4947,7 @@ def test_update_ekm_config_rest_required_fields( # verify required fields with non-default values are left alone client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5000,7 +4990,7 @@ def test_update_ekm_config_rest_required_fields( def test_update_ekm_config_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_ekm_config._get_unset_required_fields({}) @@ -5018,7 +5008,7 @@ def test_update_ekm_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_ekm_config_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -5076,7 +5066,7 @@ def test_update_ekm_config_rest_bad_request( transport: str = "rest", request_type=ekm_service.UpdateEkmConfigRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5100,7 +5090,7 @@ def test_update_ekm_config_rest_bad_request( def test_update_ekm_config_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5145,7 +5135,7 @@ def test_update_ekm_config_rest_flattened(): def test_update_ekm_config_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5161,7 +5151,7 @@ def test_update_ekm_config_rest_flattened_error(transport: str = "rest"): def test_update_ekm_config_rest_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5174,7 +5164,7 @@ def test_update_ekm_config_rest_error(): ) def test_verify_connectivity_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5222,7 +5212,7 @@ def test_verify_connectivity_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).verify_connectivity._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5231,7 +5221,7 @@ def test_verify_connectivity_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).verify_connectivity._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5240,7 +5230,7 @@ def test_verify_connectivity_rest_required_fields( assert jsonified_request["name"] == "name_value" client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5282,7 +5272,7 @@ def test_verify_connectivity_rest_required_fields( def test_verify_connectivity_rest_unset_required_fields(): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.verify_connectivity._get_unset_required_fields({}) @@ -5292,7 +5282,7 @@ def test_verify_connectivity_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_verify_connectivity_rest_interceptors(null_interceptor): transport = transports.EkmServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.EkmServiceRestInterceptor(), @@ -5350,7 +5340,7 @@ def test_verify_connectivity_rest_bad_request( transport: str = "rest", request_type=ekm_service.VerifyConnectivityRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5372,7 +5362,7 @@ def test_verify_connectivity_rest_bad_request( def test_verify_connectivity_rest_flattened(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5416,7 +5406,7 @@ def test_verify_connectivity_rest_flattened(): def test_verify_connectivity_rest_flattened_error(transport: str = "rest"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5431,24 +5421,24 @@ def test_verify_connectivity_rest_flattened_error(transport: str = "rest"): def test_verify_connectivity_rest_error(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.EkmServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.EkmServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = EkmServiceClient( @@ -5458,7 +5448,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.EkmServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -5473,13 +5463,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = EkmServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.EkmServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = EkmServiceClient( @@ -5491,7 +5480,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.EkmServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = EkmServiceClient(transport=transport) assert client.transport is transport @@ -5500,13 +5489,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.EkmServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.EkmServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -5523,7 +5512,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -5537,7 +5526,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = EkmServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -5545,7 +5534,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -5557,7 +5546,7 @@ def test_ekm_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.EkmServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -5569,7 +5558,7 @@ def test_ekm_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.EkmServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -5612,7 +5601,7 @@ def test_ekm_service_base_transport_with_credentials_file(): "google.cloud.kms_v1.services.ekm_service.transports.EkmServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.EkmServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -5634,7 +5623,7 @@ def test_ekm_service_base_transport_with_adc(): "google.cloud.kms_v1.services.ekm_service.transports.EkmServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.EkmServiceTransport() adc.assert_called_once() @@ -5642,7 +5631,7 @@ def test_ekm_service_base_transport_with_adc(): def test_ekm_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) EkmServiceClient() adc.assert_called_once_with( scopes=None, @@ -5665,7 +5654,7 @@ def test_ekm_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -5715,7 +5704,7 @@ def test_ekm_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -5743,7 +5732,7 @@ def test_ekm_service_transport_create_channel(transport_class, grpc_helpers): [transports.EkmServiceGrpcTransport, transports.EkmServiceGrpcAsyncIOTransport], ) def test_ekm_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -5781,7 +5770,7 @@ def test_ekm_service_grpc_transport_client_cert_source_for_mtls(transport_class) def test_ekm_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -5801,7 +5790,7 @@ def test_ekm_service_http_transport_client_cert_source_for_mtls(): ) def test_ekm_service_host_no_port(transport_name): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudkms.googleapis.com" ), @@ -5824,7 +5813,7 @@ def test_ekm_service_host_no_port(transport_name): ) def test_ekm_service_host_with_port(transport_name): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudkms.googleapis.com:8000" ), @@ -5844,8 +5833,8 @@ def test_ekm_service_host_with_port(transport_name): ], ) def test_ekm_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = EkmServiceClient( credentials=creds1, transport=transport_name, @@ -5922,7 +5911,7 @@ def test_ekm_service_transport_channel_mtls_with_client_cert_source(transport_cl mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -6183,7 +6172,7 @@ def test_client_with_default_client_info(): transports.EkmServiceTransport, "_prep_wrapped_messages" ) as prep: client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6193,7 +6182,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = EkmServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6202,7 +6191,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -6217,7 +6206,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6247,7 +6236,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -6275,7 +6264,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6303,7 +6292,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -6331,7 +6320,7 @@ def test_get_iam_policy_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6361,7 +6350,7 @@ def test_get_iam_policy_rest_bad_request( ) def test_get_iam_policy_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"resource": "projects/sample1/locations/sample2/keyRings/sample3"} @@ -6389,7 +6378,7 @@ def test_set_iam_policy_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6419,7 +6408,7 @@ def test_set_iam_policy_rest_bad_request( ) def test_set_iam_policy_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"resource": "projects/sample1/locations/sample2/keyRings/sample3"} @@ -6447,7 +6436,7 @@ def test_test_iam_permissions_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.TestIamPermissionsRequest ): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6477,7 +6466,7 @@ def test_test_iam_permissions_rest_bad_request( ) def test_test_iam_permissions_rest(request_type): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"resource": "projects/sample1/locations/sample2/keyRings/sample3"} @@ -6503,7 +6492,7 @@ def test_test_iam_permissions_rest(request_type): def test_list_locations(transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6528,7 +6517,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6554,7 +6543,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6583,7 +6572,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6612,7 +6601,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -6630,7 +6619,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -6648,7 +6637,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6673,7 +6662,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6698,7 +6687,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): - client = EkmServiceClient(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = EkmServiceClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6725,9 +6714,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): - client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + client = EkmServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -6755,7 +6742,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -6773,7 +6760,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -6791,7 +6778,7 @@ async def test_get_location_from_dict_async(): def test_set_iam_policy(transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6824,7 +6811,7 @@ def test_set_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6859,7 +6846,7 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6889,7 +6876,7 @@ def test_set_iam_policy_field_headers(): @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6918,7 +6905,7 @@ async def test_set_iam_policy_field_headers_async(): def test_set_iam_policy_from_dict(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -6937,7 +6924,7 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_from_dict_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -6955,7 +6942,7 @@ async def test_set_iam_policy_from_dict_async(): def test_get_iam_policy(transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6990,7 +6977,7 @@ def test_get_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7026,7 +7013,7 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7056,7 +7043,7 @@ def test_get_iam_policy_field_headers(): @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7085,7 +7072,7 @@ async def test_get_iam_policy_field_headers_async(): def test_get_iam_policy_from_dict(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -7104,7 +7091,7 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_from_dict_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -7122,7 +7109,7 @@ async def test_get_iam_policy_from_dict_async(): def test_test_iam_permissions(transport: str = "grpc"): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7156,7 +7143,7 @@ def test_test_iam_permissions(transport: str = "grpc"): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7191,7 +7178,7 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7223,7 +7210,7 @@ def test_test_iam_permissions_field_headers(): @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7256,7 +7243,7 @@ async def test_test_iam_permissions_field_headers_async(): def test_test_iam_permissions_from_dict(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7277,7 +7264,7 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_from_dict_async(): client = EkmServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -7305,7 +7292,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -7322,7 +7309,7 @@ def test_client_ctx(): ] for transport in transports: client = EkmServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_key_management_service.py b/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_key_management_service.py index 225beafead32..7f144921f4c5 100644 --- a/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_key_management_service.py +++ b/packages/google-cloud-kms/tests/unit/gapic/kms_v1/test_key_management_service.py @@ -86,18 +86,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -347,7 +335,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -374,42 +362,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -422,7 +417,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_key_management_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -476,7 +471,7 @@ def test_key_management_service_client_service_account_always_use_jwt( def test_key_management_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -547,9 +542,7 @@ def test_key_management_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(KeyManagementServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -968,20 +961,20 @@ def test_key_management_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -993,13 +986,11 @@ def test_key_management_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -1015,8 +1006,7 @@ def test_key_management_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1182,8 +1172,8 @@ def test_key_management_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1215,7 +1205,7 @@ def test_key_management_service_client_create_channel_credentials_file( ) def test_list_key_rings(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1247,7 +1237,7 @@ def test_list_key_rings_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1264,7 +1254,7 @@ async def test_list_key_rings_async( transport: str = "grpc_asyncio", request_type=service.ListKeyRingsRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1301,7 +1291,7 @@ async def test_list_key_rings_async_from_dict(): def test_list_key_rings_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1331,7 +1321,7 @@ def test_list_key_rings_field_headers(): @pytest.mark.asyncio async def test_list_key_rings_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1362,7 +1352,7 @@ async def test_list_key_rings_field_headers_async(): def test_list_key_rings_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1386,7 +1376,7 @@ def test_list_key_rings_flattened(): def test_list_key_rings_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1401,7 +1391,7 @@ def test_list_key_rings_flattened_error(): @pytest.mark.asyncio async def test_list_key_rings_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1430,7 +1420,7 @@ async def test_list_key_rings_flattened_async(): @pytest.mark.asyncio async def test_list_key_rings_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1444,7 +1434,7 @@ async def test_list_key_rings_flattened_error_async(): def test_list_key_rings_pager(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1494,7 +1484,7 @@ def test_list_key_rings_pager(transport_name: str = "grpc"): def test_list_key_rings_pages(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1536,7 +1526,7 @@ def test_list_key_rings_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_key_rings_async_pager(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1586,7 +1576,7 @@ async def test_list_key_rings_async_pager(): @pytest.mark.asyncio async def test_list_key_rings_async_pages(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1641,7 +1631,7 @@ async def test_list_key_rings_async_pages(): ) def test_list_crypto_keys(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1673,7 +1663,7 @@ def test_list_crypto_keys_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1690,7 +1680,7 @@ async def test_list_crypto_keys_async( transport: str = "grpc_asyncio", request_type=service.ListCryptoKeysRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1727,7 +1717,7 @@ async def test_list_crypto_keys_async_from_dict(): def test_list_crypto_keys_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1757,7 +1747,7 @@ def test_list_crypto_keys_field_headers(): @pytest.mark.asyncio async def test_list_crypto_keys_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1788,7 +1778,7 @@ async def test_list_crypto_keys_field_headers_async(): def test_list_crypto_keys_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1812,7 +1802,7 @@ def test_list_crypto_keys_flattened(): def test_list_crypto_keys_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1827,7 +1817,7 @@ def test_list_crypto_keys_flattened_error(): @pytest.mark.asyncio async def test_list_crypto_keys_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1856,7 +1846,7 @@ async def test_list_crypto_keys_flattened_async(): @pytest.mark.asyncio async def test_list_crypto_keys_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1870,7 +1860,7 @@ async def test_list_crypto_keys_flattened_error_async(): def test_list_crypto_keys_pager(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1920,7 +1910,7 @@ def test_list_crypto_keys_pager(transport_name: str = "grpc"): def test_list_crypto_keys_pages(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1962,7 +1952,7 @@ def test_list_crypto_keys_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_crypto_keys_async_pager(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2012,7 +2002,7 @@ async def test_list_crypto_keys_async_pager(): @pytest.mark.asyncio async def test_list_crypto_keys_async_pages(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2067,7 +2057,7 @@ async def test_list_crypto_keys_async_pages(): ) def test_list_crypto_key_versions(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2101,7 +2091,7 @@ def test_list_crypto_key_versions_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2120,7 +2110,7 @@ async def test_list_crypto_key_versions_async( transport: str = "grpc_asyncio", request_type=service.ListCryptoKeyVersionsRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2159,7 +2149,7 @@ async def test_list_crypto_key_versions_async_from_dict(): def test_list_crypto_key_versions_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2191,7 +2181,7 @@ def test_list_crypto_key_versions_field_headers(): @pytest.mark.asyncio async def test_list_crypto_key_versions_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2224,7 +2214,7 @@ async def test_list_crypto_key_versions_field_headers_async(): def test_list_crypto_key_versions_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2250,7 +2240,7 @@ def test_list_crypto_key_versions_flattened(): def test_list_crypto_key_versions_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2265,7 +2255,7 @@ def test_list_crypto_key_versions_flattened_error(): @pytest.mark.asyncio async def test_list_crypto_key_versions_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2296,7 +2286,7 @@ async def test_list_crypto_key_versions_flattened_async(): @pytest.mark.asyncio async def test_list_crypto_key_versions_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2310,7 +2300,7 @@ async def test_list_crypto_key_versions_flattened_error_async(): def test_list_crypto_key_versions_pager(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2362,7 +2352,7 @@ def test_list_crypto_key_versions_pager(transport_name: str = "grpc"): def test_list_crypto_key_versions_pages(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2406,7 +2396,7 @@ def test_list_crypto_key_versions_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_crypto_key_versions_async_pager(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2458,7 +2448,7 @@ async def test_list_crypto_key_versions_async_pager(): @pytest.mark.asyncio async def test_list_crypto_key_versions_async_pages(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2515,7 +2505,7 @@ async def test_list_crypto_key_versions_async_pages(): ) def test_list_import_jobs(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2547,7 +2537,7 @@ def test_list_import_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2564,7 +2554,7 @@ async def test_list_import_jobs_async( transport: str = "grpc_asyncio", request_type=service.ListImportJobsRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2601,7 +2591,7 @@ async def test_list_import_jobs_async_from_dict(): def test_list_import_jobs_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2631,7 +2621,7 @@ def test_list_import_jobs_field_headers(): @pytest.mark.asyncio async def test_list_import_jobs_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2662,7 +2652,7 @@ async def test_list_import_jobs_field_headers_async(): def test_list_import_jobs_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2686,7 +2676,7 @@ def test_list_import_jobs_flattened(): def test_list_import_jobs_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2701,7 +2691,7 @@ def test_list_import_jobs_flattened_error(): @pytest.mark.asyncio async def test_list_import_jobs_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2730,7 +2720,7 @@ async def test_list_import_jobs_flattened_async(): @pytest.mark.asyncio async def test_list_import_jobs_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2744,7 +2734,7 @@ async def test_list_import_jobs_flattened_error_async(): def test_list_import_jobs_pager(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2794,7 +2784,7 @@ def test_list_import_jobs_pager(transport_name: str = "grpc"): def test_list_import_jobs_pages(transport_name: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2836,7 +2826,7 @@ def test_list_import_jobs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_import_jobs_async_pager(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2886,7 +2876,7 @@ async def test_list_import_jobs_async_pager(): @pytest.mark.asyncio async def test_list_import_jobs_async_pages(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2941,7 +2931,7 @@ async def test_list_import_jobs_async_pages(): ) def test_get_key_ring(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2971,7 +2961,7 @@ def test_get_key_ring_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2988,7 +2978,7 @@ async def test_get_key_ring_async( transport: str = "grpc_asyncio", request_type=service.GetKeyRingRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3023,7 +3013,7 @@ async def test_get_key_ring_async_from_dict(): def test_get_key_ring_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3053,7 +3043,7 @@ def test_get_key_ring_field_headers(): @pytest.mark.asyncio async def test_get_key_ring_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3082,7 +3072,7 @@ async def test_get_key_ring_field_headers_async(): def test_get_key_ring_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3106,7 +3096,7 @@ def test_get_key_ring_flattened(): def test_get_key_ring_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3121,7 +3111,7 @@ def test_get_key_ring_flattened_error(): @pytest.mark.asyncio async def test_get_key_ring_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3148,7 +3138,7 @@ async def test_get_key_ring_flattened_async(): @pytest.mark.asyncio async def test_get_key_ring_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3169,7 +3159,7 @@ async def test_get_key_ring_flattened_error_async(): ) def test_get_crypto_key(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3205,7 +3195,7 @@ def test_get_crypto_key_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3222,7 +3212,7 @@ async def test_get_crypto_key_async( transport: str = "grpc_asyncio", request_type=service.GetCryptoKeyRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3263,7 +3253,7 @@ async def test_get_crypto_key_async_from_dict(): def test_get_crypto_key_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3293,7 +3283,7 @@ def test_get_crypto_key_field_headers(): @pytest.mark.asyncio async def test_get_crypto_key_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3322,7 +3312,7 @@ async def test_get_crypto_key_field_headers_async(): def test_get_crypto_key_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3346,7 +3336,7 @@ def test_get_crypto_key_flattened(): def test_get_crypto_key_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3361,7 +3351,7 @@ def test_get_crypto_key_flattened_error(): @pytest.mark.asyncio async def test_get_crypto_key_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3388,7 +3378,7 @@ async def test_get_crypto_key_flattened_async(): @pytest.mark.asyncio async def test_get_crypto_key_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3409,7 +3399,7 @@ async def test_get_crypto_key_flattened_error_async(): ) def test_get_crypto_key_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3466,7 +3456,7 @@ def test_get_crypto_key_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3485,7 +3475,7 @@ async def test_get_crypto_key_version_async( transport: str = "grpc_asyncio", request_type=service.GetCryptoKeyVersionRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3547,7 +3537,7 @@ async def test_get_crypto_key_version_async_from_dict(): def test_get_crypto_key_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3579,7 +3569,7 @@ def test_get_crypto_key_version_field_headers(): @pytest.mark.asyncio async def test_get_crypto_key_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3612,7 +3602,7 @@ async def test_get_crypto_key_version_field_headers_async(): def test_get_crypto_key_version_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3638,7 +3628,7 @@ def test_get_crypto_key_version_flattened(): def test_get_crypto_key_version_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3653,7 +3643,7 @@ def test_get_crypto_key_version_flattened_error(): @pytest.mark.asyncio async def test_get_crypto_key_version_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3684,7 +3674,7 @@ async def test_get_crypto_key_version_flattened_async(): @pytest.mark.asyncio async def test_get_crypto_key_version_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3705,7 +3695,7 @@ async def test_get_crypto_key_version_flattened_error_async(): ) def test_get_public_key(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3744,7 +3734,7 @@ def test_get_public_key_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3761,7 +3751,7 @@ async def test_get_public_key_async( transport: str = "grpc_asyncio", request_type=service.GetPublicKeyRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3805,7 +3795,7 @@ async def test_get_public_key_async_from_dict(): def test_get_public_key_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3835,7 +3825,7 @@ def test_get_public_key_field_headers(): @pytest.mark.asyncio async def test_get_public_key_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3864,7 +3854,7 @@ async def test_get_public_key_field_headers_async(): def test_get_public_key_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3888,7 +3878,7 @@ def test_get_public_key_flattened(): def test_get_public_key_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3903,7 +3893,7 @@ def test_get_public_key_flattened_error(): @pytest.mark.asyncio async def test_get_public_key_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3930,7 +3920,7 @@ async def test_get_public_key_flattened_async(): @pytest.mark.asyncio async def test_get_public_key_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3951,7 +3941,7 @@ async def test_get_public_key_flattened_error_async(): ) def test_get_import_job(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3990,7 +3980,7 @@ def test_get_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4007,7 +3997,7 @@ async def test_get_import_job_async( transport: str = "grpc_asyncio", request_type=service.GetImportJobRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4051,7 +4041,7 @@ async def test_get_import_job_async_from_dict(): def test_get_import_job_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4081,7 +4071,7 @@ def test_get_import_job_field_headers(): @pytest.mark.asyncio async def test_get_import_job_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4110,7 +4100,7 @@ async def test_get_import_job_field_headers_async(): def test_get_import_job_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4134,7 +4124,7 @@ def test_get_import_job_flattened(): def test_get_import_job_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4149,7 +4139,7 @@ def test_get_import_job_flattened_error(): @pytest.mark.asyncio async def test_get_import_job_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4176,7 +4166,7 @@ async def test_get_import_job_flattened_async(): @pytest.mark.asyncio async def test_get_import_job_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4197,7 +4187,7 @@ async def test_get_import_job_flattened_error_async(): ) def test_create_key_ring(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4227,7 +4217,7 @@ def test_create_key_ring_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4244,7 +4234,7 @@ async def test_create_key_ring_async( transport: str = "grpc_asyncio", request_type=service.CreateKeyRingRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4279,7 +4269,7 @@ async def test_create_key_ring_async_from_dict(): def test_create_key_ring_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4309,7 +4299,7 @@ def test_create_key_ring_field_headers(): @pytest.mark.asyncio async def test_create_key_ring_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4338,7 +4328,7 @@ async def test_create_key_ring_field_headers_async(): def test_create_key_ring_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4370,7 +4360,7 @@ def test_create_key_ring_flattened(): def test_create_key_ring_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4387,7 +4377,7 @@ def test_create_key_ring_flattened_error(): @pytest.mark.asyncio async def test_create_key_ring_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4422,7 +4412,7 @@ async def test_create_key_ring_flattened_async(): @pytest.mark.asyncio async def test_create_key_ring_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4445,7 +4435,7 @@ async def test_create_key_ring_flattened_error_async(): ) def test_create_crypto_key(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4483,7 +4473,7 @@ def test_create_crypto_key_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4502,7 +4492,7 @@ async def test_create_crypto_key_async( transport: str = "grpc_asyncio", request_type=service.CreateCryptoKeyRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4545,7 +4535,7 @@ async def test_create_crypto_key_async_from_dict(): def test_create_crypto_key_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4577,7 +4567,7 @@ def test_create_crypto_key_field_headers(): @pytest.mark.asyncio async def test_create_crypto_key_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4608,7 +4598,7 @@ async def test_create_crypto_key_field_headers_async(): def test_create_crypto_key_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4642,7 +4632,7 @@ def test_create_crypto_key_flattened(): def test_create_crypto_key_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4659,7 +4649,7 @@ def test_create_crypto_key_flattened_error(): @pytest.mark.asyncio async def test_create_crypto_key_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4696,7 +4686,7 @@ async def test_create_crypto_key_flattened_async(): @pytest.mark.asyncio async def test_create_crypto_key_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4719,7 +4709,7 @@ async def test_create_crypto_key_flattened_error_async(): ) def test_create_crypto_key_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4776,7 +4766,7 @@ def test_create_crypto_key_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4795,7 +4785,7 @@ async def test_create_crypto_key_version_async( transport: str = "grpc_asyncio", request_type=service.CreateCryptoKeyVersionRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4857,7 +4847,7 @@ async def test_create_crypto_key_version_async_from_dict(): def test_create_crypto_key_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4889,7 +4879,7 @@ def test_create_crypto_key_version_field_headers(): @pytest.mark.asyncio async def test_create_crypto_key_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4922,7 +4912,7 @@ async def test_create_crypto_key_version_field_headers_async(): def test_create_crypto_key_version_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4952,7 +4942,7 @@ def test_create_crypto_key_version_flattened(): def test_create_crypto_key_version_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4968,7 +4958,7 @@ def test_create_crypto_key_version_flattened_error(): @pytest.mark.asyncio async def test_create_crypto_key_version_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5003,7 +4993,7 @@ async def test_create_crypto_key_version_flattened_async(): @pytest.mark.asyncio async def test_create_crypto_key_version_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5025,7 +5015,7 @@ async def test_create_crypto_key_version_flattened_error_async(): ) def test_import_crypto_key_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5082,7 +5072,7 @@ def test_import_crypto_key_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5101,7 +5091,7 @@ async def test_import_crypto_key_version_async( transport: str = "grpc_asyncio", request_type=service.ImportCryptoKeyVersionRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5163,7 +5153,7 @@ async def test_import_crypto_key_version_async_from_dict(): def test_import_crypto_key_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5195,7 +5185,7 @@ def test_import_crypto_key_version_field_headers(): @pytest.mark.asyncio async def test_import_crypto_key_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5235,7 +5225,7 @@ async def test_import_crypto_key_version_field_headers_async(): ) def test_create_import_job(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5276,7 +5266,7 @@ def test_create_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5295,7 +5285,7 @@ async def test_create_import_job_async( transport: str = "grpc_asyncio", request_type=service.CreateImportJobRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5341,7 +5331,7 @@ async def test_create_import_job_async_from_dict(): def test_create_import_job_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5373,7 +5363,7 @@ def test_create_import_job_field_headers(): @pytest.mark.asyncio async def test_create_import_job_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5404,7 +5394,7 @@ async def test_create_import_job_field_headers_async(): def test_create_import_job_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5438,7 +5428,7 @@ def test_create_import_job_flattened(): def test_create_import_job_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5455,7 +5445,7 @@ def test_create_import_job_flattened_error(): @pytest.mark.asyncio async def test_create_import_job_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5492,7 +5482,7 @@ async def test_create_import_job_flattened_async(): @pytest.mark.asyncio async def test_create_import_job_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5515,7 +5505,7 @@ async def test_create_import_job_flattened_error_async(): ) def test_update_crypto_key(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5553,7 +5543,7 @@ def test_update_crypto_key_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5572,7 +5562,7 @@ async def test_update_crypto_key_async( transport: str = "grpc_asyncio", request_type=service.UpdateCryptoKeyRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5615,7 +5605,7 @@ async def test_update_crypto_key_async_from_dict(): def test_update_crypto_key_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5647,7 +5637,7 @@ def test_update_crypto_key_field_headers(): @pytest.mark.asyncio async def test_update_crypto_key_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5678,7 +5668,7 @@ async def test_update_crypto_key_field_headers_async(): def test_update_crypto_key_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5708,7 +5698,7 @@ def test_update_crypto_key_flattened(): def test_update_crypto_key_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5724,7 +5714,7 @@ def test_update_crypto_key_flattened_error(): @pytest.mark.asyncio async def test_update_crypto_key_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5757,7 +5747,7 @@ async def test_update_crypto_key_flattened_async(): @pytest.mark.asyncio async def test_update_crypto_key_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5779,7 +5769,7 @@ async def test_update_crypto_key_flattened_error_async(): ) def test_update_crypto_key_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5836,7 +5826,7 @@ def test_update_crypto_key_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5855,7 +5845,7 @@ async def test_update_crypto_key_version_async( transport: str = "grpc_asyncio", request_type=service.UpdateCryptoKeyVersionRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5917,7 +5907,7 @@ async def test_update_crypto_key_version_async_from_dict(): def test_update_crypto_key_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5949,7 +5939,7 @@ def test_update_crypto_key_version_field_headers(): @pytest.mark.asyncio async def test_update_crypto_key_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5982,7 +5972,7 @@ async def test_update_crypto_key_version_field_headers_async(): def test_update_crypto_key_version_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6012,7 +6002,7 @@ def test_update_crypto_key_version_flattened(): def test_update_crypto_key_version_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6028,7 +6018,7 @@ def test_update_crypto_key_version_flattened_error(): @pytest.mark.asyncio async def test_update_crypto_key_version_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6063,7 +6053,7 @@ async def test_update_crypto_key_version_flattened_async(): @pytest.mark.asyncio async def test_update_crypto_key_version_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6085,7 +6075,7 @@ async def test_update_crypto_key_version_flattened_error_async(): ) def test_update_crypto_key_primary_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6123,7 +6113,7 @@ def test_update_crypto_key_primary_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6143,7 +6133,7 @@ async def test_update_crypto_key_primary_version_async( request_type=service.UpdateCryptoKeyPrimaryVersionRequest, ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6186,7 +6176,7 @@ async def test_update_crypto_key_primary_version_async_from_dict(): def test_update_crypto_key_primary_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6218,7 +6208,7 @@ def test_update_crypto_key_primary_version_field_headers(): @pytest.mark.asyncio async def test_update_crypto_key_primary_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6249,7 +6239,7 @@ async def test_update_crypto_key_primary_version_field_headers_async(): def test_update_crypto_key_primary_version_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6279,7 +6269,7 @@ def test_update_crypto_key_primary_version_flattened(): def test_update_crypto_key_primary_version_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6295,7 +6285,7 @@ def test_update_crypto_key_primary_version_flattened_error(): @pytest.mark.asyncio async def test_update_crypto_key_primary_version_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6328,7 +6318,7 @@ async def test_update_crypto_key_primary_version_flattened_async(): @pytest.mark.asyncio async def test_update_crypto_key_primary_version_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6350,7 +6340,7 @@ async def test_update_crypto_key_primary_version_flattened_error_async(): ) def test_destroy_crypto_key_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6407,7 +6397,7 @@ def test_destroy_crypto_key_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6426,7 +6416,7 @@ async def test_destroy_crypto_key_version_async( transport: str = "grpc_asyncio", request_type=service.DestroyCryptoKeyVersionRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6488,7 +6478,7 @@ async def test_destroy_crypto_key_version_async_from_dict(): def test_destroy_crypto_key_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6520,7 +6510,7 @@ def test_destroy_crypto_key_version_field_headers(): @pytest.mark.asyncio async def test_destroy_crypto_key_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6553,7 +6543,7 @@ async def test_destroy_crypto_key_version_field_headers_async(): def test_destroy_crypto_key_version_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6579,7 +6569,7 @@ def test_destroy_crypto_key_version_flattened(): def test_destroy_crypto_key_version_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6594,7 +6584,7 @@ def test_destroy_crypto_key_version_flattened_error(): @pytest.mark.asyncio async def test_destroy_crypto_key_version_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6625,7 +6615,7 @@ async def test_destroy_crypto_key_version_flattened_async(): @pytest.mark.asyncio async def test_destroy_crypto_key_version_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6646,7 +6636,7 @@ async def test_destroy_crypto_key_version_flattened_error_async(): ) def test_restore_crypto_key_version(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6703,7 +6693,7 @@ def test_restore_crypto_key_version_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6722,7 +6712,7 @@ async def test_restore_crypto_key_version_async( transport: str = "grpc_asyncio", request_type=service.RestoreCryptoKeyVersionRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6784,7 +6774,7 @@ async def test_restore_crypto_key_version_async_from_dict(): def test_restore_crypto_key_version_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6816,7 +6806,7 @@ def test_restore_crypto_key_version_field_headers(): @pytest.mark.asyncio async def test_restore_crypto_key_version_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6849,7 +6839,7 @@ async def test_restore_crypto_key_version_field_headers_async(): def test_restore_crypto_key_version_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6875,7 +6865,7 @@ def test_restore_crypto_key_version_flattened(): def test_restore_crypto_key_version_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6890,7 +6880,7 @@ def test_restore_crypto_key_version_flattened_error(): @pytest.mark.asyncio async def test_restore_crypto_key_version_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6921,7 +6911,7 @@ async def test_restore_crypto_key_version_flattened_async(): @pytest.mark.asyncio async def test_restore_crypto_key_version_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6942,7 +6932,7 @@ async def test_restore_crypto_key_version_flattened_error_async(): ) def test_encrypt(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6980,7 +6970,7 @@ def test_encrypt_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6997,7 +6987,7 @@ async def test_encrypt_async( transport: str = "grpc_asyncio", request_type=service.EncryptRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7040,7 +7030,7 @@ async def test_encrypt_async_from_dict(): def test_encrypt_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7070,7 +7060,7 @@ def test_encrypt_field_headers(): @pytest.mark.asyncio async def test_encrypt_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7101,7 +7091,7 @@ async def test_encrypt_field_headers_async(): def test_encrypt_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7129,7 +7119,7 @@ def test_encrypt_flattened(): def test_encrypt_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7145,7 +7135,7 @@ def test_encrypt_flattened_error(): @pytest.mark.asyncio async def test_encrypt_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7178,7 +7168,7 @@ async def test_encrypt_flattened_async(): @pytest.mark.asyncio async def test_encrypt_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7200,7 +7190,7 @@ async def test_encrypt_flattened_error_async(): ) def test_decrypt(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7234,7 +7224,7 @@ def test_decrypt_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7251,7 +7241,7 @@ async def test_decrypt_async( transport: str = "grpc_asyncio", request_type=service.DecryptRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7290,7 +7280,7 @@ async def test_decrypt_async_from_dict(): def test_decrypt_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7320,7 +7310,7 @@ def test_decrypt_field_headers(): @pytest.mark.asyncio async def test_decrypt_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7351,7 +7341,7 @@ async def test_decrypt_field_headers_async(): def test_decrypt_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7379,7 +7369,7 @@ def test_decrypt_flattened(): def test_decrypt_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7395,7 +7385,7 @@ def test_decrypt_flattened_error(): @pytest.mark.asyncio async def test_decrypt_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7428,7 +7418,7 @@ async def test_decrypt_flattened_async(): @pytest.mark.asyncio async def test_decrypt_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7450,7 +7440,7 @@ async def test_decrypt_flattened_error_async(): ) def test_raw_encrypt(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7494,7 +7484,7 @@ def test_raw_encrypt_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7511,7 +7501,7 @@ async def test_raw_encrypt_async( transport: str = "grpc_asyncio", request_type=service.RawEncryptRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7560,7 +7550,7 @@ async def test_raw_encrypt_async_from_dict(): def test_raw_encrypt_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7590,7 +7580,7 @@ def test_raw_encrypt_field_headers(): @pytest.mark.asyncio async def test_raw_encrypt_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7628,7 +7618,7 @@ async def test_raw_encrypt_field_headers_async(): ) def test_raw_decrypt(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7666,7 +7656,7 @@ def test_raw_decrypt_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7683,7 +7673,7 @@ async def test_raw_decrypt_async( transport: str = "grpc_asyncio", request_type=service.RawDecryptRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7726,7 +7716,7 @@ async def test_raw_decrypt_async_from_dict(): def test_raw_decrypt_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7756,7 +7746,7 @@ def test_raw_decrypt_field_headers(): @pytest.mark.asyncio async def test_raw_decrypt_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7794,7 +7784,7 @@ async def test_raw_decrypt_field_headers_async(): ) def test_asymmetric_sign(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7832,7 +7822,7 @@ def test_asymmetric_sign_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7849,7 +7839,7 @@ async def test_asymmetric_sign_async( transport: str = "grpc_asyncio", request_type=service.AsymmetricSignRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7892,7 +7882,7 @@ async def test_asymmetric_sign_async_from_dict(): def test_asymmetric_sign_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7922,7 +7912,7 @@ def test_asymmetric_sign_field_headers(): @pytest.mark.asyncio async def test_asymmetric_sign_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7953,7 +7943,7 @@ async def test_asymmetric_sign_field_headers_async(): def test_asymmetric_sign_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7981,7 +7971,7 @@ def test_asymmetric_sign_flattened(): def test_asymmetric_sign_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7997,7 +7987,7 @@ def test_asymmetric_sign_flattened_error(): @pytest.mark.asyncio async def test_asymmetric_sign_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8030,7 +8020,7 @@ async def test_asymmetric_sign_flattened_async(): @pytest.mark.asyncio async def test_asymmetric_sign_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8052,7 +8042,7 @@ async def test_asymmetric_sign_flattened_error_async(): ) def test_asymmetric_decrypt(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8088,7 +8078,7 @@ def test_asymmetric_decrypt_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8107,7 +8097,7 @@ async def test_asymmetric_decrypt_async( transport: str = "grpc_asyncio", request_type=service.AsymmetricDecryptRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8148,7 +8138,7 @@ async def test_asymmetric_decrypt_async_from_dict(): def test_asymmetric_decrypt_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8180,7 +8170,7 @@ def test_asymmetric_decrypt_field_headers(): @pytest.mark.asyncio async def test_asymmetric_decrypt_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8213,7 +8203,7 @@ async def test_asymmetric_decrypt_field_headers_async(): def test_asymmetric_decrypt_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8243,7 +8233,7 @@ def test_asymmetric_decrypt_flattened(): def test_asymmetric_decrypt_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8259,7 +8249,7 @@ def test_asymmetric_decrypt_flattened_error(): @pytest.mark.asyncio async def test_asymmetric_decrypt_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8294,7 +8284,7 @@ async def test_asymmetric_decrypt_flattened_async(): @pytest.mark.asyncio async def test_asymmetric_decrypt_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8316,7 +8306,7 @@ async def test_asymmetric_decrypt_flattened_error_async(): ) def test_mac_sign(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8352,7 +8342,7 @@ def test_mac_sign_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8369,7 +8359,7 @@ async def test_mac_sign_async( transport: str = "grpc_asyncio", request_type=service.MacSignRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8410,7 +8400,7 @@ async def test_mac_sign_async_from_dict(): def test_mac_sign_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8440,7 +8430,7 @@ def test_mac_sign_field_headers(): @pytest.mark.asyncio async def test_mac_sign_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8471,7 +8461,7 @@ async def test_mac_sign_field_headers_async(): def test_mac_sign_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8499,7 +8489,7 @@ def test_mac_sign_flattened(): def test_mac_sign_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8515,7 +8505,7 @@ def test_mac_sign_flattened_error(): @pytest.mark.asyncio async def test_mac_sign_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8548,7 +8538,7 @@ async def test_mac_sign_flattened_async(): @pytest.mark.asyncio async def test_mac_sign_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8570,7 +8560,7 @@ async def test_mac_sign_flattened_error_async(): ) def test_mac_verify(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8610,7 +8600,7 @@ def test_mac_verify_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8627,7 +8617,7 @@ async def test_mac_verify_async( transport: str = "grpc_asyncio", request_type=service.MacVerifyRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8672,7 +8662,7 @@ async def test_mac_verify_async_from_dict(): def test_mac_verify_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8702,7 +8692,7 @@ def test_mac_verify_field_headers(): @pytest.mark.asyncio async def test_mac_verify_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8733,7 +8723,7 @@ async def test_mac_verify_field_headers_async(): def test_mac_verify_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8765,7 +8755,7 @@ def test_mac_verify_flattened(): def test_mac_verify_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8782,7 +8772,7 @@ def test_mac_verify_flattened_error(): @pytest.mark.asyncio async def test_mac_verify_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8819,7 +8809,7 @@ async def test_mac_verify_flattened_async(): @pytest.mark.asyncio async def test_mac_verify_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8842,7 +8832,7 @@ async def test_mac_verify_flattened_error_async(): ) def test_generate_random_bytes(request_type, transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8874,7 +8864,7 @@ def test_generate_random_bytes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8893,7 +8883,7 @@ async def test_generate_random_bytes_async( transport: str = "grpc_asyncio", request_type=service.GenerateRandomBytesRequest ): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8930,7 +8920,7 @@ async def test_generate_random_bytes_async_from_dict(): def test_generate_random_bytes_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8962,7 +8952,7 @@ def test_generate_random_bytes_field_headers(): @pytest.mark.asyncio async def test_generate_random_bytes_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8995,7 +8985,7 @@ async def test_generate_random_bytes_field_headers_async(): def test_generate_random_bytes_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9029,7 +9019,7 @@ def test_generate_random_bytes_flattened(): def test_generate_random_bytes_flattened_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9046,7 +9036,7 @@ def test_generate_random_bytes_flattened_error(): @pytest.mark.asyncio async def test_generate_random_bytes_flattened_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9085,7 +9075,7 @@ async def test_generate_random_bytes_flattened_async(): @pytest.mark.asyncio async def test_generate_random_bytes_flattened_error_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9108,7 +9098,7 @@ async def test_generate_random_bytes_flattened_error_async(): ) def test_list_key_rings_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9159,7 +9149,7 @@ def test_list_key_rings_rest_required_fields(request_type=service.ListKeyRingsRe # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_key_rings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9168,7 +9158,7 @@ def test_list_key_rings_rest_required_fields(request_type=service.ListKeyRingsRe jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_key_rings._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -9186,7 +9176,7 @@ def test_list_key_rings_rest_required_fields(request_type=service.ListKeyRingsRe assert jsonified_request["parent"] == "parent_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9228,7 +9218,7 @@ def test_list_key_rings_rest_required_fields(request_type=service.ListKeyRingsRe def test_list_key_rings_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_key_rings._get_unset_required_fields({}) @@ -9248,7 +9238,7 @@ def test_list_key_rings_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_key_rings_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -9304,7 +9294,7 @@ def test_list_key_rings_rest_bad_request( transport: str = "rest", request_type=service.ListKeyRingsRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9326,7 +9316,7 @@ def test_list_key_rings_rest_bad_request( def test_list_key_rings_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9367,7 +9357,7 @@ def test_list_key_rings_rest_flattened(): def test_list_key_rings_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9382,7 +9372,7 @@ def test_list_key_rings_rest_flattened_error(transport: str = "rest"): def test_list_key_rings_rest_pager(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9450,7 +9440,7 @@ def test_list_key_rings_rest_pager(transport: str = "rest"): ) def test_list_crypto_keys_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9503,7 +9493,7 @@ def test_list_crypto_keys_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_crypto_keys._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9512,7 +9502,7 @@ def test_list_crypto_keys_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_crypto_keys._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -9531,7 +9521,7 @@ def test_list_crypto_keys_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9573,7 +9563,7 @@ def test_list_crypto_keys_rest_required_fields( def test_list_crypto_keys_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_crypto_keys._get_unset_required_fields({}) @@ -9594,7 +9584,7 @@ def test_list_crypto_keys_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_crypto_keys_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -9650,7 +9640,7 @@ def test_list_crypto_keys_rest_bad_request( transport: str = "rest", request_type=service.ListCryptoKeysRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9672,7 +9662,7 @@ def test_list_crypto_keys_rest_bad_request( def test_list_crypto_keys_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9716,7 +9706,7 @@ def test_list_crypto_keys_rest_flattened(): def test_list_crypto_keys_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9731,7 +9721,7 @@ def test_list_crypto_keys_rest_flattened_error(transport: str = "rest"): def test_list_crypto_keys_rest_pager(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9801,7 +9791,7 @@ def test_list_crypto_keys_rest_pager(transport: str = "rest"): ) def test_list_crypto_key_versions_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -9856,7 +9846,7 @@ def test_list_crypto_key_versions_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_crypto_key_versions._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -9865,7 +9855,7 @@ def test_list_crypto_key_versions_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_crypto_key_versions._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -9884,7 +9874,7 @@ def test_list_crypto_key_versions_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -9926,7 +9916,7 @@ def test_list_crypto_key_versions_rest_required_fields( def test_list_crypto_key_versions_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_crypto_key_versions._get_unset_required_fields({}) @@ -9947,7 +9937,7 @@ def test_list_crypto_key_versions_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_crypto_key_versions_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -10005,7 +9995,7 @@ def test_list_crypto_key_versions_rest_bad_request( transport: str = "rest", request_type=service.ListCryptoKeyVersionsRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10029,7 +10019,7 @@ def test_list_crypto_key_versions_rest_bad_request( def test_list_crypto_key_versions_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10073,7 +10063,7 @@ def test_list_crypto_key_versions_rest_flattened(): def test_list_crypto_key_versions_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10088,7 +10078,7 @@ def test_list_crypto_key_versions_rest_flattened_error(transport: str = "rest"): def test_list_crypto_key_versions_rest_pager(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10160,7 +10150,7 @@ def test_list_crypto_key_versions_rest_pager(transport: str = "rest"): ) def test_list_import_jobs_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10213,7 +10203,7 @@ def test_list_import_jobs_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_import_jobs._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10222,7 +10212,7 @@ def test_list_import_jobs_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_import_jobs._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -10240,7 +10230,7 @@ def test_list_import_jobs_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10282,7 +10272,7 @@ def test_list_import_jobs_rest_required_fields( def test_list_import_jobs_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_import_jobs._get_unset_required_fields({}) @@ -10302,7 +10292,7 @@ def test_list_import_jobs_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_import_jobs_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -10358,7 +10348,7 @@ def test_list_import_jobs_rest_bad_request( transport: str = "rest", request_type=service.ListImportJobsRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10380,7 +10370,7 @@ def test_list_import_jobs_rest_bad_request( def test_list_import_jobs_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10424,7 +10414,7 @@ def test_list_import_jobs_rest_flattened(): def test_list_import_jobs_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10439,7 +10429,7 @@ def test_list_import_jobs_rest_flattened_error(transport: str = "rest"): def test_list_import_jobs_rest_pager(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10509,7 +10499,7 @@ def test_list_import_jobs_rest_pager(transport: str = "rest"): ) def test_get_key_ring_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10558,7 +10548,7 @@ def test_get_key_ring_rest_required_fields(request_type=service.GetKeyRingReques # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_key_ring._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10567,7 +10557,7 @@ def test_get_key_ring_rest_required_fields(request_type=service.GetKeyRingReques jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_key_ring._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10576,7 +10566,7 @@ def test_get_key_ring_rest_required_fields(request_type=service.GetKeyRingReques assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10618,7 +10608,7 @@ def test_get_key_ring_rest_required_fields(request_type=service.GetKeyRingReques def test_get_key_ring_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_key_ring._get_unset_required_fields({}) @@ -10628,7 +10618,7 @@ def test_get_key_ring_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_key_ring_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -10682,7 +10672,7 @@ def test_get_key_ring_rest_bad_request( transport: str = "rest", request_type=service.GetKeyRingRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10704,7 +10694,7 @@ def test_get_key_ring_rest_bad_request( def test_get_key_ring_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10745,7 +10735,7 @@ def test_get_key_ring_rest_flattened(): def test_get_key_ring_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10760,7 +10750,7 @@ def test_get_key_ring_rest_flattened_error(transport: str = "rest"): def test_get_key_ring_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -10773,7 +10763,7 @@ def test_get_key_ring_rest_error(): ) def test_get_crypto_key_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -10830,7 +10820,7 @@ def test_get_crypto_key_rest_required_fields(request_type=service.GetCryptoKeyRe # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_crypto_key._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10839,7 +10829,7 @@ def test_get_crypto_key_rest_required_fields(request_type=service.GetCryptoKeyRe jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_crypto_key._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -10848,7 +10838,7 @@ def test_get_crypto_key_rest_required_fields(request_type=service.GetCryptoKeyRe assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -10890,7 +10880,7 @@ def test_get_crypto_key_rest_required_fields(request_type=service.GetCryptoKeyRe def test_get_crypto_key_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_crypto_key._get_unset_required_fields({}) @@ -10900,7 +10890,7 @@ def test_get_crypto_key_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_crypto_key_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -10954,7 +10944,7 @@ def test_get_crypto_key_rest_bad_request( transport: str = "rest", request_type=service.GetCryptoKeyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10978,7 +10968,7 @@ def test_get_crypto_key_rest_bad_request( def test_get_crypto_key_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11022,7 +11012,7 @@ def test_get_crypto_key_rest_flattened(): def test_get_crypto_key_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11037,7 +11027,7 @@ def test_get_crypto_key_rest_flattened_error(transport: str = "rest"): def test_get_crypto_key_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11050,7 +11040,7 @@ def test_get_crypto_key_rest_error(): ) def test_get_crypto_key_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11128,7 +11118,7 @@ def test_get_crypto_key_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11137,7 +11127,7 @@ def test_get_crypto_key_version_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11146,7 +11136,7 @@ def test_get_crypto_key_version_rest_required_fields( assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -11188,7 +11178,7 @@ def test_get_crypto_key_version_rest_required_fields( def test_get_crypto_key_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_crypto_key_version._get_unset_required_fields({}) @@ -11198,7 +11188,7 @@ def test_get_crypto_key_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_crypto_key_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -11256,7 +11246,7 @@ def test_get_crypto_key_version_rest_bad_request( transport: str = "rest", request_type=service.GetCryptoKeyVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11280,7 +11270,7 @@ def test_get_crypto_key_version_rest_bad_request( def test_get_crypto_key_version_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11324,7 +11314,7 @@ def test_get_crypto_key_version_rest_flattened(): def test_get_crypto_key_version_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11339,7 +11329,7 @@ def test_get_crypto_key_version_rest_flattened_error(transport: str = "rest"): def test_get_crypto_key_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11352,7 +11342,7 @@ def test_get_crypto_key_version_rest_error(): ) def test_get_public_key_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11412,7 +11402,7 @@ def test_get_public_key_rest_required_fields(request_type=service.GetPublicKeyRe # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_public_key._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11421,7 +11411,7 @@ def test_get_public_key_rest_required_fields(request_type=service.GetPublicKeyRe jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_public_key._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11430,7 +11420,7 @@ def test_get_public_key_rest_required_fields(request_type=service.GetPublicKeyRe assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -11472,7 +11462,7 @@ def test_get_public_key_rest_required_fields(request_type=service.GetPublicKeyRe def test_get_public_key_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_public_key._get_unset_required_fields({}) @@ -11482,7 +11472,7 @@ def test_get_public_key_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_public_key_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -11536,7 +11526,7 @@ def test_get_public_key_rest_bad_request( transport: str = "rest", request_type=service.GetPublicKeyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11560,7 +11550,7 @@ def test_get_public_key_rest_bad_request( def test_get_public_key_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11604,7 +11594,7 @@ def test_get_public_key_rest_flattened(): def test_get_public_key_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11619,7 +11609,7 @@ def test_get_public_key_rest_flattened_error(transport: str = "rest"): def test_get_public_key_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11632,7 +11622,7 @@ def test_get_public_key_rest_error(): ) def test_get_import_job_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11692,7 +11682,7 @@ def test_get_import_job_rest_required_fields(request_type=service.GetImportJobRe # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11701,7 +11691,7 @@ def test_get_import_job_rest_required_fields(request_type=service.GetImportJobRe jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -11710,7 +11700,7 @@ def test_get_import_job_rest_required_fields(request_type=service.GetImportJobRe assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -11752,7 +11742,7 @@ def test_get_import_job_rest_required_fields(request_type=service.GetImportJobRe def test_get_import_job_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_import_job._get_unset_required_fields({}) @@ -11762,7 +11752,7 @@ def test_get_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_import_job_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -11816,7 +11806,7 @@ def test_get_import_job_rest_bad_request( transport: str = "rest", request_type=service.GetImportJobRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11840,7 +11830,7 @@ def test_get_import_job_rest_bad_request( def test_get_import_job_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -11884,7 +11874,7 @@ def test_get_import_job_rest_flattened(): def test_get_import_job_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11899,7 +11889,7 @@ def test_get_import_job_rest_flattened_error(transport: str = "rest"): def test_get_import_job_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -11912,7 +11902,7 @@ def test_get_import_job_rest_error(): ) def test_create_key_ring_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12036,7 +12026,7 @@ def test_create_key_ring_rest_required_fields( assert "keyRingId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_key_ring._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12048,7 +12038,7 @@ def test_create_key_ring_rest_required_fields( jsonified_request["keyRingId"] = "key_ring_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_key_ring._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("key_ring_id",)) @@ -12061,7 +12051,7 @@ def test_create_key_ring_rest_required_fields( assert jsonified_request["keyRingId"] == "key_ring_id_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -12110,7 +12100,7 @@ def test_create_key_ring_rest_required_fields( def test_create_key_ring_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_key_ring._get_unset_required_fields({}) @@ -12129,7 +12119,7 @@ def test_create_key_ring_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_key_ring_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -12183,7 +12173,7 @@ def test_create_key_ring_rest_bad_request( transport: str = "rest", request_type=service.CreateKeyRingRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12205,7 +12195,7 @@ def test_create_key_ring_rest_bad_request( def test_create_key_ring_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12248,7 +12238,7 @@ def test_create_key_ring_rest_flattened(): def test_create_key_ring_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12265,7 +12255,7 @@ def test_create_key_ring_rest_flattened_error(transport: str = "rest"): def test_create_key_ring_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -12278,7 +12268,7 @@ def test_create_key_ring_rest_error(): ) def test_create_crypto_key_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12451,7 +12441,7 @@ def test_create_crypto_key_rest_required_fields( assert "cryptoKeyId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_crypto_key._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12463,7 +12453,7 @@ def test_create_crypto_key_rest_required_fields( jsonified_request["cryptoKeyId"] = "crypto_key_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_crypto_key._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -12481,7 +12471,7 @@ def test_create_crypto_key_rest_required_fields( assert jsonified_request["cryptoKeyId"] == "crypto_key_id_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -12530,7 +12520,7 @@ def test_create_crypto_key_rest_required_fields( def test_create_crypto_key_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_crypto_key._get_unset_required_fields({}) @@ -12554,7 +12544,7 @@ def test_create_crypto_key_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_crypto_key_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -12608,7 +12598,7 @@ def test_create_crypto_key_rest_bad_request( transport: str = "rest", request_type=service.CreateCryptoKeyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12630,7 +12620,7 @@ def test_create_crypto_key_rest_bad_request( def test_create_crypto_key_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12676,7 +12666,7 @@ def test_create_crypto_key_rest_flattened(): def test_create_crypto_key_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12693,7 +12683,7 @@ def test_create_crypto_key_rest_flattened_error(transport: str = "rest"): def test_create_crypto_key_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -12706,7 +12696,7 @@ def test_create_crypto_key_rest_error(): ) def test_create_crypto_key_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12886,7 +12876,7 @@ def test_create_crypto_key_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12895,7 +12885,7 @@ def test_create_crypto_key_version_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -12904,7 +12894,7 @@ def test_create_crypto_key_version_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -12947,7 +12937,7 @@ def test_create_crypto_key_version_rest_required_fields( def test_create_crypto_key_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_crypto_key_version._get_unset_required_fields({}) @@ -12965,7 +12955,7 @@ def test_create_crypto_key_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_crypto_key_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -13023,7 +13013,7 @@ def test_create_crypto_key_version_rest_bad_request( transport: str = "rest", request_type=service.CreateCryptoKeyVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13047,7 +13037,7 @@ def test_create_crypto_key_version_rest_bad_request( def test_create_crypto_key_version_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13092,7 +13082,7 @@ def test_create_crypto_key_version_rest_flattened(): def test_create_crypto_key_version_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13108,7 +13098,7 @@ def test_create_crypto_key_version_rest_flattened_error(transport: str = "rest") def test_create_crypto_key_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -13121,7 +13111,7 @@ def test_create_crypto_key_version_rest_error(): ) def test_import_crypto_key_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13200,7 +13190,7 @@ def test_import_crypto_key_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).import_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -13210,7 +13200,7 @@ def test_import_crypto_key_version_rest_required_fields( jsonified_request["importJob"] = "import_job_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).import_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -13221,7 +13211,7 @@ def test_import_crypto_key_version_rest_required_fields( assert jsonified_request["importJob"] == "import_job_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -13264,7 +13254,7 @@ def test_import_crypto_key_version_rest_required_fields( def test_import_crypto_key_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.import_crypto_key_version._get_unset_required_fields({}) @@ -13283,7 +13273,7 @@ def test_import_crypto_key_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_import_crypto_key_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -13341,7 +13331,7 @@ def test_import_crypto_key_version_rest_bad_request( transport: str = "rest", request_type=service.ImportCryptoKeyVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13365,7 +13355,7 @@ def test_import_crypto_key_version_rest_bad_request( def test_import_crypto_key_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -13378,7 +13368,7 @@ def test_import_crypto_key_version_rest_error(): ) def test_create_import_job_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13533,7 +13523,7 @@ def test_create_import_job_rest_required_fields( assert "importJobId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -13545,7 +13535,7 @@ def test_create_import_job_rest_required_fields( jsonified_request["importJobId"] = "import_job_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_import_job._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("import_job_id",)) @@ -13558,7 +13548,7 @@ def test_create_import_job_rest_required_fields( assert jsonified_request["importJobId"] == "import_job_id_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -13607,7 +13597,7 @@ def test_create_import_job_rest_required_fields( def test_create_import_job_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_import_job._get_unset_required_fields({}) @@ -13626,7 +13616,7 @@ def test_create_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_import_job_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -13680,7 +13670,7 @@ def test_create_import_job_rest_bad_request( transport: str = "rest", request_type=service.CreateImportJobRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13702,7 +13692,7 @@ def test_create_import_job_rest_bad_request( def test_create_import_job_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13748,7 +13738,7 @@ def test_create_import_job_rest_flattened(): def test_create_import_job_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13765,7 +13755,7 @@ def test_create_import_job_rest_flattened_error(transport: str = "rest"): def test_create_import_job_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -13778,7 +13768,7 @@ def test_create_import_job_rest_error(): ) def test_update_crypto_key_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13952,14 +13942,14 @@ def test_update_crypto_key_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_crypto_key._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_crypto_key._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -13968,7 +13958,7 @@ def test_update_crypto_key_rest_required_fields( # verify required fields with non-default values are left alone client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -14011,7 +14001,7 @@ def test_update_crypto_key_rest_required_fields( def test_update_crypto_key_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_crypto_key._get_unset_required_fields({}) @@ -14029,7 +14019,7 @@ def test_update_crypto_key_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_crypto_key_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -14083,7 +14073,7 @@ def test_update_crypto_key_rest_bad_request( transport: str = "rest", request_type=service.UpdateCryptoKeyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14109,7 +14099,7 @@ def test_update_crypto_key_rest_bad_request( def test_update_crypto_key_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14156,7 +14146,7 @@ def test_update_crypto_key_rest_flattened(): def test_update_crypto_key_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14172,7 +14162,7 @@ def test_update_crypto_key_rest_flattened_error(transport: str = "rest"): def test_update_crypto_key_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -14185,7 +14175,7 @@ def test_update_crypto_key_rest_error(): ) def test_update_crypto_key_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14366,14 +14356,14 @@ def test_update_crypto_key_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_crypto_key_version._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -14382,7 +14372,7 @@ def test_update_crypto_key_version_rest_required_fields( # verify required fields with non-default values are left alone client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -14425,7 +14415,7 @@ def test_update_crypto_key_version_rest_required_fields( def test_update_crypto_key_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_crypto_key_version._get_unset_required_fields({}) @@ -14443,7 +14433,7 @@ def test_update_crypto_key_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_crypto_key_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -14501,7 +14491,7 @@ def test_update_crypto_key_version_rest_bad_request( transport: str = "rest", request_type=service.UpdateCryptoKeyVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14527,7 +14517,7 @@ def test_update_crypto_key_version_rest_bad_request( def test_update_crypto_key_version_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14574,7 +14564,7 @@ def test_update_crypto_key_version_rest_flattened(): def test_update_crypto_key_version_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14590,7 +14580,7 @@ def test_update_crypto_key_version_rest_flattened_error(transport: str = "rest") def test_update_crypto_key_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -14603,7 +14593,7 @@ def test_update_crypto_key_version_rest_error(): ) def test_update_crypto_key_primary_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14663,7 +14653,7 @@ def test_update_crypto_key_primary_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_crypto_key_primary_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -14673,7 +14663,7 @@ def test_update_crypto_key_primary_version_rest_required_fields( jsonified_request["cryptoKeyVersionId"] = "crypto_key_version_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_crypto_key_primary_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -14684,7 +14674,7 @@ def test_update_crypto_key_primary_version_rest_required_fields( assert jsonified_request["cryptoKeyVersionId"] == "crypto_key_version_id_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -14727,7 +14717,7 @@ def test_update_crypto_key_primary_version_rest_required_fields( def test_update_crypto_key_primary_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = ( @@ -14747,7 +14737,7 @@ def test_update_crypto_key_primary_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_crypto_key_primary_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -14805,7 +14795,7 @@ def test_update_crypto_key_primary_version_rest_bad_request( transport: str = "rest", request_type=service.UpdateCryptoKeyPrimaryVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14829,7 +14819,7 @@ def test_update_crypto_key_primary_version_rest_bad_request( def test_update_crypto_key_primary_version_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14876,7 +14866,7 @@ def test_update_crypto_key_primary_version_rest_flattened_error( transport: str = "rest", ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14892,7 +14882,7 @@ def test_update_crypto_key_primary_version_rest_flattened_error( def test_update_crypto_key_primary_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -14905,7 +14895,7 @@ def test_update_crypto_key_primary_version_rest_error(): ) def test_destroy_crypto_key_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14983,7 +14973,7 @@ def test_destroy_crypto_key_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).destroy_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -14992,7 +14982,7 @@ def test_destroy_crypto_key_version_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).destroy_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15001,7 +14991,7 @@ def test_destroy_crypto_key_version_rest_required_fields( assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15044,7 +15034,7 @@ def test_destroy_crypto_key_version_rest_required_fields( def test_destroy_crypto_key_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.destroy_crypto_key_version._get_unset_required_fields({}) @@ -15054,7 +15044,7 @@ def test_destroy_crypto_key_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_destroy_crypto_key_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -15113,7 +15103,7 @@ def test_destroy_crypto_key_version_rest_bad_request( transport: str = "rest", request_type=service.DestroyCryptoKeyVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15137,7 +15127,7 @@ def test_destroy_crypto_key_version_rest_bad_request( def test_destroy_crypto_key_version_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15181,7 +15171,7 @@ def test_destroy_crypto_key_version_rest_flattened(): def test_destroy_crypto_key_version_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15196,7 +15186,7 @@ def test_destroy_crypto_key_version_rest_flattened_error(transport: str = "rest" def test_destroy_crypto_key_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -15209,7 +15199,7 @@ def test_destroy_crypto_key_version_rest_error(): ) def test_restore_crypto_key_version_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15287,7 +15277,7 @@ def test_restore_crypto_key_version_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).restore_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15296,7 +15286,7 @@ def test_restore_crypto_key_version_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).restore_crypto_key_version._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15305,7 +15295,7 @@ def test_restore_crypto_key_version_rest_required_fields( assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15348,7 +15338,7 @@ def test_restore_crypto_key_version_rest_required_fields( def test_restore_crypto_key_version_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.restore_crypto_key_version._get_unset_required_fields({}) @@ -15358,7 +15348,7 @@ def test_restore_crypto_key_version_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_restore_crypto_key_version_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -15417,7 +15407,7 @@ def test_restore_crypto_key_version_rest_bad_request( transport: str = "rest", request_type=service.RestoreCryptoKeyVersionRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15441,7 +15431,7 @@ def test_restore_crypto_key_version_rest_bad_request( def test_restore_crypto_key_version_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15485,7 +15475,7 @@ def test_restore_crypto_key_version_rest_flattened(): def test_restore_crypto_key_version_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15500,7 +15490,7 @@ def test_restore_crypto_key_version_rest_flattened_error(transport: str = "rest" def test_restore_crypto_key_version_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -15513,7 +15503,7 @@ def test_restore_crypto_key_version_rest_error(): ) def test_encrypt_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15573,7 +15563,7 @@ def test_encrypt_rest_required_fields(request_type=service.EncryptRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).encrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15583,7 +15573,7 @@ def test_encrypt_rest_required_fields(request_type=service.EncryptRequest): jsonified_request["plaintext"] = b"plaintext_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).encrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15594,7 +15584,7 @@ def test_encrypt_rest_required_fields(request_type=service.EncryptRequest): assert jsonified_request["plaintext"] == b"plaintext_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15637,7 +15627,7 @@ def test_encrypt_rest_required_fields(request_type=service.EncryptRequest): def test_encrypt_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.encrypt._get_unset_required_fields({}) @@ -15655,7 +15645,7 @@ def test_encrypt_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_encrypt_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -15711,7 +15701,7 @@ def test_encrypt_rest_bad_request( transport: str = "rest", request_type=service.EncryptRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15735,7 +15725,7 @@ def test_encrypt_rest_bad_request( def test_encrypt_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15780,7 +15770,7 @@ def test_encrypt_rest_flattened(): def test_encrypt_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15796,7 +15786,7 @@ def test_encrypt_rest_flattened_error(transport: str = "rest"): def test_encrypt_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -15809,7 +15799,7 @@ def test_encrypt_rest_error(): ) def test_decrypt_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15865,7 +15855,7 @@ def test_decrypt_rest_required_fields(request_type=service.DecryptRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).decrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15875,7 +15865,7 @@ def test_decrypt_rest_required_fields(request_type=service.DecryptRequest): jsonified_request["ciphertext"] = b"ciphertext_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).decrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15886,7 +15876,7 @@ def test_decrypt_rest_required_fields(request_type=service.DecryptRequest): assert jsonified_request["ciphertext"] == b"ciphertext_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15929,7 +15919,7 @@ def test_decrypt_rest_required_fields(request_type=service.DecryptRequest): def test_decrypt_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.decrypt._get_unset_required_fields({}) @@ -15947,7 +15937,7 @@ def test_decrypt_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_decrypt_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -16003,7 +15993,7 @@ def test_decrypt_rest_bad_request( transport: str = "rest", request_type=service.DecryptRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16027,7 +16017,7 @@ def test_decrypt_rest_bad_request( def test_decrypt_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16072,7 +16062,7 @@ def test_decrypt_rest_flattened(): def test_decrypt_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16088,7 +16078,7 @@ def test_decrypt_rest_flattened_error(transport: str = "rest"): def test_decrypt_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16101,7 +16091,7 @@ def test_decrypt_rest_error(): ) def test_raw_encrypt_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16167,7 +16157,7 @@ def test_raw_encrypt_rest_required_fields(request_type=service.RawEncryptRequest # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).raw_encrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16177,7 +16167,7 @@ def test_raw_encrypt_rest_required_fields(request_type=service.RawEncryptRequest jsonified_request["plaintext"] = b"plaintext_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).raw_encrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16188,7 +16178,7 @@ def test_raw_encrypt_rest_required_fields(request_type=service.RawEncryptRequest assert jsonified_request["plaintext"] == b"plaintext_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16231,7 +16221,7 @@ def test_raw_encrypt_rest_required_fields(request_type=service.RawEncryptRequest def test_raw_encrypt_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.raw_encrypt._get_unset_required_fields({}) @@ -16249,7 +16239,7 @@ def test_raw_encrypt_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_raw_encrypt_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -16305,7 +16295,7 @@ def test_raw_encrypt_rest_bad_request( transport: str = "rest", request_type=service.RawEncryptRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16329,7 +16319,7 @@ def test_raw_encrypt_rest_bad_request( def test_raw_encrypt_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16342,7 +16332,7 @@ def test_raw_encrypt_rest_error(): ) def test_raw_decrypt_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16403,7 +16393,7 @@ def test_raw_decrypt_rest_required_fields(request_type=service.RawDecryptRequest # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).raw_decrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16414,7 +16404,7 @@ def test_raw_decrypt_rest_required_fields(request_type=service.RawDecryptRequest jsonified_request["initializationVector"] = b"initialization_vector_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).raw_decrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16427,7 +16417,7 @@ def test_raw_decrypt_rest_required_fields(request_type=service.RawDecryptRequest assert jsonified_request["initializationVector"] == b"initialization_vector_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16470,7 +16460,7 @@ def test_raw_decrypt_rest_required_fields(request_type=service.RawDecryptRequest def test_raw_decrypt_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.raw_decrypt._get_unset_required_fields({}) @@ -16489,7 +16479,7 @@ def test_raw_decrypt_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_raw_decrypt_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -16545,7 +16535,7 @@ def test_raw_decrypt_rest_bad_request( transport: str = "rest", request_type=service.RawDecryptRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16569,7 +16559,7 @@ def test_raw_decrypt_rest_bad_request( def test_raw_decrypt_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16582,7 +16572,7 @@ def test_raw_decrypt_rest_error(): ) def test_asymmetric_sign_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16643,7 +16633,7 @@ def test_asymmetric_sign_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).asymmetric_sign._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16652,7 +16642,7 @@ def test_asymmetric_sign_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).asymmetric_sign._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16661,7 +16651,7 @@ def test_asymmetric_sign_rest_required_fields( assert jsonified_request["name"] == "name_value" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16704,7 +16694,7 @@ def test_asymmetric_sign_rest_required_fields( def test_asymmetric_sign_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.asymmetric_sign._get_unset_required_fields({}) @@ -16714,7 +16704,7 @@ def test_asymmetric_sign_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_asymmetric_sign_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -16770,7 +16760,7 @@ def test_asymmetric_sign_rest_bad_request( transport: str = "rest", request_type=service.AsymmetricSignRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16794,7 +16784,7 @@ def test_asymmetric_sign_rest_bad_request( def test_asymmetric_sign_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16839,7 +16829,7 @@ def test_asymmetric_sign_rest_flattened(): def test_asymmetric_sign_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16855,7 +16845,7 @@ def test_asymmetric_sign_rest_flattened_error(transport: str = "rest"): def test_asymmetric_sign_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16868,7 +16858,7 @@ def test_asymmetric_sign_rest_error(): ) def test_asymmetric_decrypt_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16926,7 +16916,7 @@ def test_asymmetric_decrypt_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).asymmetric_decrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16936,7 +16926,7 @@ def test_asymmetric_decrypt_rest_required_fields( jsonified_request["ciphertext"] = b"ciphertext_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).asymmetric_decrypt._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16947,7 +16937,7 @@ def test_asymmetric_decrypt_rest_required_fields( assert jsonified_request["ciphertext"] == b"ciphertext_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16990,7 +16980,7 @@ def test_asymmetric_decrypt_rest_required_fields( def test_asymmetric_decrypt_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.asymmetric_decrypt._get_unset_required_fields({}) @@ -17008,7 +16998,7 @@ def test_asymmetric_decrypt_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_asymmetric_decrypt_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -17066,7 +17056,7 @@ def test_asymmetric_decrypt_rest_bad_request( transport: str = "rest", request_type=service.AsymmetricDecryptRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17090,7 +17080,7 @@ def test_asymmetric_decrypt_rest_bad_request( def test_asymmetric_decrypt_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17135,7 +17125,7 @@ def test_asymmetric_decrypt_rest_flattened(): def test_asymmetric_decrypt_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17151,7 +17141,7 @@ def test_asymmetric_decrypt_rest_flattened_error(transport: str = "rest"): def test_asymmetric_decrypt_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17164,7 +17154,7 @@ def test_asymmetric_decrypt_rest_error(): ) def test_mac_sign_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17222,7 +17212,7 @@ def test_mac_sign_rest_required_fields(request_type=service.MacSignRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).mac_sign._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17232,7 +17222,7 @@ def test_mac_sign_rest_required_fields(request_type=service.MacSignRequest): jsonified_request["data"] = b"data_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).mac_sign._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17243,7 +17233,7 @@ def test_mac_sign_rest_required_fields(request_type=service.MacSignRequest): assert jsonified_request["data"] == b"data_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17286,7 +17276,7 @@ def test_mac_sign_rest_required_fields(request_type=service.MacSignRequest): def test_mac_sign_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.mac_sign._get_unset_required_fields({}) @@ -17304,7 +17294,7 @@ def test_mac_sign_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_mac_sign_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -17360,7 +17350,7 @@ def test_mac_sign_rest_bad_request( transport: str = "rest", request_type=service.MacSignRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17384,7 +17374,7 @@ def test_mac_sign_rest_bad_request( def test_mac_sign_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17429,7 +17419,7 @@ def test_mac_sign_rest_flattened(): def test_mac_sign_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17445,7 +17435,7 @@ def test_mac_sign_rest_flattened_error(transport: str = "rest"): def test_mac_sign_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17458,7 +17448,7 @@ def test_mac_sign_rest_error(): ) def test_mac_verify_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17521,7 +17511,7 @@ def test_mac_verify_rest_required_fields(request_type=service.MacVerifyRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).mac_verify._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17532,7 +17522,7 @@ def test_mac_verify_rest_required_fields(request_type=service.MacVerifyRequest): jsonified_request["mac"] = b"mac_blob" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).mac_verify._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17545,7 +17535,7 @@ def test_mac_verify_rest_required_fields(request_type=service.MacVerifyRequest): assert jsonified_request["mac"] == b"mac_blob" client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17588,7 +17578,7 @@ def test_mac_verify_rest_required_fields(request_type=service.MacVerifyRequest): def test_mac_verify_rest_unset_required_fields(): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.mac_verify._get_unset_required_fields({}) @@ -17607,7 +17597,7 @@ def test_mac_verify_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_mac_verify_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -17663,7 +17653,7 @@ def test_mac_verify_rest_bad_request( transport: str = "rest", request_type=service.MacVerifyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17687,7 +17677,7 @@ def test_mac_verify_rest_bad_request( def test_mac_verify_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17733,7 +17723,7 @@ def test_mac_verify_rest_flattened(): def test_mac_verify_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17750,7 +17740,7 @@ def test_mac_verify_rest_flattened_error(transport: str = "rest"): def test_mac_verify_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17763,7 +17753,7 @@ def test_mac_verify_rest_error(): ) def test_generate_random_bytes_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17797,7 +17787,7 @@ def test_generate_random_bytes_rest(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_generate_random_bytes_rest_interceptors(null_interceptor): transport = transports.KeyManagementServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.KeyManagementServiceRestInterceptor(), @@ -17855,7 +17845,7 @@ def test_generate_random_bytes_rest_bad_request( transport: str = "rest", request_type=service.GenerateRandomBytesRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17877,7 +17867,7 @@ def test_generate_random_bytes_rest_bad_request( def test_generate_random_bytes_rest_flattened(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17921,7 +17911,7 @@ def test_generate_random_bytes_rest_flattened(): def test_generate_random_bytes_rest_flattened_error(transport: str = "rest"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17938,24 +17928,24 @@ def test_generate_random_bytes_rest_flattened_error(transport: str = "rest"): def test_generate_random_bytes_rest_error(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.KeyManagementServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.KeyManagementServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyManagementServiceClient( @@ -17965,7 +17955,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.KeyManagementServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -17980,13 +17970,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = KeyManagementServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.KeyManagementServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = KeyManagementServiceClient( @@ -17998,7 +17987,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.KeyManagementServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = KeyManagementServiceClient(transport=transport) assert client.transport is transport @@ -18007,13 +17996,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.KeyManagementServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.KeyManagementServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -18030,7 +18019,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -18044,7 +18033,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = KeyManagementServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -18052,7 +18041,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -18064,7 +18053,7 @@ def test_key_management_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.KeyManagementServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -18076,7 +18065,7 @@ def test_key_management_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.KeyManagementServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -18140,7 +18129,7 @@ def test_key_management_service_base_transport_with_credentials_file(): "google.cloud.kms_v1.services.key_management_service.transports.KeyManagementServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.KeyManagementServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -18162,7 +18151,7 @@ def test_key_management_service_base_transport_with_adc(): "google.cloud.kms_v1.services.key_management_service.transports.KeyManagementServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.KeyManagementServiceTransport() adc.assert_called_once() @@ -18170,7 +18159,7 @@ def test_key_management_service_base_transport_with_adc(): def test_key_management_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) KeyManagementServiceClient() adc.assert_called_once_with( scopes=None, @@ -18193,7 +18182,7 @@ def test_key_management_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -18243,7 +18232,7 @@ def test_key_management_service_transport_create_channel(transport_class, grpc_h ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -18276,7 +18265,7 @@ def test_key_management_service_transport_create_channel(transport_class, grpc_h def test_key_management_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -18314,7 +18303,7 @@ def test_key_management_service_grpc_transport_client_cert_source_for_mtls( def test_key_management_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -18334,7 +18323,7 @@ def test_key_management_service_http_transport_client_cert_source_for_mtls(): ) def test_key_management_service_host_no_port(transport_name): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudkms.googleapis.com" ), @@ -18357,7 +18346,7 @@ def test_key_management_service_host_no_port(transport_name): ) def test_key_management_service_host_with_port(transport_name): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudkms.googleapis.com:8000" ), @@ -18377,8 +18366,8 @@ def test_key_management_service_host_with_port(transport_name): ], ) def test_key_management_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = KeyManagementServiceClient( credentials=creds1, transport=transport_name, @@ -18523,7 +18512,7 @@ def test_key_management_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -18865,7 +18854,7 @@ def test_client_with_default_client_info(): transports.KeyManagementServiceTransport, "_prep_wrapped_messages" ) as prep: client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -18875,7 +18864,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = KeyManagementServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -18884,7 +18873,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -18899,7 +18888,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18929,7 +18918,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -18957,7 +18946,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18985,7 +18974,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -19013,7 +19002,7 @@ def test_get_iam_policy_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19043,7 +19032,7 @@ def test_get_iam_policy_rest_bad_request( ) def test_get_iam_policy_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"resource": "projects/sample1/locations/sample2/keyRings/sample3"} @@ -19071,7 +19060,7 @@ def test_set_iam_policy_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19101,7 +19090,7 @@ def test_set_iam_policy_rest_bad_request( ) def test_set_iam_policy_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"resource": "projects/sample1/locations/sample2/keyRings/sample3"} @@ -19129,7 +19118,7 @@ def test_test_iam_permissions_rest_bad_request( transport: str = "rest", request_type=iam_policy_pb2.TestIamPermissionsRequest ): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19159,7 +19148,7 @@ def test_test_iam_permissions_rest_bad_request( ) def test_test_iam_permissions_rest(request_type): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"resource": "projects/sample1/locations/sample2/keyRings/sample3"} @@ -19185,7 +19174,7 @@ def test_test_iam_permissions_rest(request_type): def test_list_locations(transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19210,7 +19199,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19236,7 +19225,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19265,7 +19254,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19294,7 +19283,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -19312,7 +19301,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -19330,7 +19319,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19355,7 +19344,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19381,7 +19370,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19410,7 +19399,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19439,7 +19428,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -19457,7 +19446,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -19475,7 +19464,7 @@ async def test_get_location_from_dict_async(): def test_set_iam_policy(transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19508,7 +19497,7 @@ def test_set_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19543,7 +19532,7 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19573,7 +19562,7 @@ def test_set_iam_policy_field_headers(): @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19602,7 +19591,7 @@ async def test_set_iam_policy_field_headers_async(): def test_set_iam_policy_from_dict(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -19621,7 +19610,7 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_from_dict_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -19639,7 +19628,7 @@ async def test_set_iam_policy_from_dict_async(): def test_get_iam_policy(transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19674,7 +19663,7 @@ def test_get_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19710,7 +19699,7 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19740,7 +19729,7 @@ def test_get_iam_policy_field_headers(): @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19769,7 +19758,7 @@ async def test_get_iam_policy_field_headers_async(): def test_get_iam_policy_from_dict(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -19788,7 +19777,7 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_from_dict_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -19806,7 +19795,7 @@ async def test_get_iam_policy_from_dict_async(): def test_test_iam_permissions(transport: str = "grpc"): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19840,7 +19829,7 @@ def test_test_iam_permissions(transport: str = "grpc"): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19875,7 +19864,7 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19907,7 +19896,7 @@ def test_test_iam_permissions_field_headers(): @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -19940,7 +19929,7 @@ async def test_test_iam_permissions_field_headers_async(): def test_test_iam_permissions_from_dict(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -19961,7 +19950,7 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_from_dict_async(): client = KeyManagementServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -19989,7 +19978,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -20006,7 +19995,7 @@ def test_client_ctx(): ] for transport in transports: client = KeyManagementServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-language/google/cloud/language/gapic_version.py b/packages/google-cloud-language/google/cloud/language/gapic_version.py index 13e6df46e52c..360a0d13ebdd 100644 --- a/packages/google-cloud-language/google/cloud/language/gapic_version.py +++ b/packages/google-cloud-language/google/cloud/language/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.13.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-language/google/cloud/language_v1/gapic_version.py b/packages/google-cloud-language/google/cloud/language_v1/gapic_version.py index 13e6df46e52c..360a0d13ebdd 100644 --- a/packages/google-cloud-language/google/cloud/language_v1/gapic_version.py +++ b/packages/google-cloud-language/google/cloud/language_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.13.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-language/google/cloud/language_v1/services/language_service/client.py b/packages/google-cloud-language/google/cloud/language_v1/services/language_service/client.py index 113a03b5d62b..7452db82da1a 100644 --- a/packages/google-cloud-language/google/cloud/language_v1/services/language_service/client.py +++ b/packages/google-cloud-language/google/cloud/language_v1/services/language_service/client.py @@ -361,6 +361,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -379,6 +380,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -453,17 +455,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = LanguageServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = LanguageServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-language/google/cloud/language_v1beta2/gapic_version.py b/packages/google-cloud-language/google/cloud/language_v1beta2/gapic_version.py index 13e6df46e52c..360a0d13ebdd 100644 --- a/packages/google-cloud-language/google/cloud/language_v1beta2/gapic_version.py +++ b/packages/google-cloud-language/google/cloud/language_v1beta2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.13.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-language/google/cloud/language_v1beta2/services/language_service/client.py b/packages/google-cloud-language/google/cloud/language_v1beta2/services/language_service/client.py index 5e62edfe2d92..4b576fc1c158 100644 --- a/packages/google-cloud-language/google/cloud/language_v1beta2/services/language_service/client.py +++ b/packages/google-cloud-language/google/cloud/language_v1beta2/services/language_service/client.py @@ -361,6 +361,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -379,6 +380,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -453,17 +455,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = LanguageServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = LanguageServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-language/google/cloud/language_v2/gapic_version.py b/packages/google-cloud-language/google/cloud/language_v2/gapic_version.py index 13e6df46e52c..360a0d13ebdd 100644 --- a/packages/google-cloud-language/google/cloud/language_v2/gapic_version.py +++ b/packages/google-cloud-language/google/cloud/language_v2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.13.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-language/google/cloud/language_v2/services/language_service/client.py b/packages/google-cloud-language/google/cloud/language_v2/services/language_service/client.py index 88bb78119c5f..4b6cc44db3fe 100644 --- a/packages/google-cloud-language/google/cloud/language_v2/services/language_service/client.py +++ b/packages/google-cloud-language/google/cloud/language_v2/services/language_service/client.py @@ -361,6 +361,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -379,6 +380,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -453,17 +455,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = LanguageServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = LanguageServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1.json b/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1.json index ee2fbeb6b2fd..4e481f59df7e 100644 --- a/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1.json +++ b/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-language", - "version": "2.13.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1beta2.json b/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1beta2.json index 932cc9ff332d..fb6633f26470 100644 --- a/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1beta2.json +++ b/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v1beta2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-language", - "version": "2.13.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v2.json b/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v2.json index dcd9e00e3725..e25172b52357 100644 --- a/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v2.json +++ b/packages/google-cloud-language/samples/generated_samples/snippet_metadata_google.cloud.language.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-language", - "version": "2.13.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-language/setup.py b/packages/google-cloud-language/setup.py index 6b35614a9de4..6196f27c8d92 100644 --- a/packages/google-cloud-language/setup.py +++ b/packages/google-cloud-language/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-language/testing/constraints-3.7.txt b/packages/google-cloud-language/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-language/testing/constraints-3.7.txt +++ b/packages/google-cloud-language/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-language/tests/unit/gapic/language_v1/test_language_service.py b/packages/google-cloud-language/tests/unit/gapic/language_v1/test_language_service.py index 9bb745551398..12980be50ba5 100644 --- a/packages/google-cloud-language/tests/unit/gapic/language_v1/test_language_service.py +++ b/packages/google-cloud-language/tests/unit/gapic/language_v1/test_language_service.py @@ -76,18 +76,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -314,7 +302,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -341,42 +329,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -389,7 +384,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_language_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -443,7 +438,7 @@ def test_language_service_client_service_account_always_use_jwt( def test_language_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -506,9 +501,7 @@ def test_language_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(LanguageServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -927,20 +920,20 @@ def test_language_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -952,13 +945,11 @@ def test_language_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -974,8 +965,7 @@ def test_language_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1128,8 +1118,8 @@ def test_language_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1161,7 +1151,7 @@ def test_language_service_client_create_channel_credentials_file( ) def test_analyze_sentiment(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1193,7 +1183,7 @@ def test_analyze_sentiment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1213,7 +1203,7 @@ async def test_analyze_sentiment_async( request_type=language_service.AnalyzeSentimentRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1250,7 +1240,7 @@ async def test_analyze_sentiment_async_from_dict(): def test_analyze_sentiment_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1284,7 +1274,7 @@ def test_analyze_sentiment_flattened(): def test_analyze_sentiment_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1302,7 +1292,7 @@ def test_analyze_sentiment_flattened_error(): @pytest.mark.asyncio async def test_analyze_sentiment_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1341,7 +1331,7 @@ async def test_analyze_sentiment_flattened_async(): @pytest.mark.asyncio async def test_analyze_sentiment_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1365,7 +1355,7 @@ async def test_analyze_sentiment_flattened_error_async(): ) def test_analyze_entities(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1395,7 +1385,7 @@ def test_analyze_entities_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1413,7 +1403,7 @@ async def test_analyze_entities_async( request_type=language_service.AnalyzeEntitiesRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1448,7 +1438,7 @@ async def test_analyze_entities_async_from_dict(): def test_analyze_entities_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1480,7 +1470,7 @@ def test_analyze_entities_flattened(): def test_analyze_entities_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1498,7 +1488,7 @@ def test_analyze_entities_flattened_error(): @pytest.mark.asyncio async def test_analyze_entities_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1535,7 +1525,7 @@ async def test_analyze_entities_flattened_async(): @pytest.mark.asyncio async def test_analyze_entities_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1559,7 +1549,7 @@ async def test_analyze_entities_flattened_error_async(): ) def test_analyze_entity_sentiment(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1591,7 +1581,7 @@ def test_analyze_entity_sentiment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1611,7 +1601,7 @@ async def test_analyze_entity_sentiment_async( request_type=language_service.AnalyzeEntitySentimentRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1648,7 +1638,7 @@ async def test_analyze_entity_sentiment_async_from_dict(): def test_analyze_entity_sentiment_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1682,7 +1672,7 @@ def test_analyze_entity_sentiment_flattened(): def test_analyze_entity_sentiment_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1700,7 +1690,7 @@ def test_analyze_entity_sentiment_flattened_error(): @pytest.mark.asyncio async def test_analyze_entity_sentiment_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1739,7 +1729,7 @@ async def test_analyze_entity_sentiment_flattened_async(): @pytest.mark.asyncio async def test_analyze_entity_sentiment_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1763,7 +1753,7 @@ async def test_analyze_entity_sentiment_flattened_error_async(): ) def test_analyze_syntax(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1793,7 +1783,7 @@ def test_analyze_syntax_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1810,7 +1800,7 @@ async def test_analyze_syntax_async( transport: str = "grpc_asyncio", request_type=language_service.AnalyzeSyntaxRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1845,7 +1835,7 @@ async def test_analyze_syntax_async_from_dict(): def test_analyze_syntax_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1877,7 +1867,7 @@ def test_analyze_syntax_flattened(): def test_analyze_syntax_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1895,7 +1885,7 @@ def test_analyze_syntax_flattened_error(): @pytest.mark.asyncio async def test_analyze_syntax_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1932,7 +1922,7 @@ async def test_analyze_syntax_flattened_async(): @pytest.mark.asyncio async def test_analyze_syntax_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1956,7 +1946,7 @@ async def test_analyze_syntax_flattened_error_async(): ) def test_classify_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1983,7 +1973,7 @@ def test_classify_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2000,7 +1990,7 @@ async def test_classify_text_async( transport: str = "grpc_asyncio", request_type=language_service.ClassifyTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2032,7 +2022,7 @@ async def test_classify_text_async_from_dict(): def test_classify_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2060,7 +2050,7 @@ def test_classify_text_flattened(): def test_classify_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2077,7 +2067,7 @@ def test_classify_text_flattened_error(): @pytest.mark.asyncio async def test_classify_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2110,7 +2100,7 @@ async def test_classify_text_flattened_async(): @pytest.mark.asyncio async def test_classify_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2133,7 +2123,7 @@ async def test_classify_text_flattened_error_async(): ) def test_moderate_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2160,7 +2150,7 @@ def test_moderate_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2177,7 +2167,7 @@ async def test_moderate_text_async( transport: str = "grpc_asyncio", request_type=language_service.ModerateTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2209,7 +2199,7 @@ async def test_moderate_text_async_from_dict(): def test_moderate_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2237,7 +2227,7 @@ def test_moderate_text_flattened(): def test_moderate_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2254,7 +2244,7 @@ def test_moderate_text_flattened_error(): @pytest.mark.asyncio async def test_moderate_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2287,7 +2277,7 @@ async def test_moderate_text_flattened_async(): @pytest.mark.asyncio async def test_moderate_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2310,7 +2300,7 @@ async def test_moderate_text_flattened_error_async(): ) def test_annotate_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2340,7 +2330,7 @@ def test_annotate_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2357,7 +2347,7 @@ async def test_annotate_text_async( transport: str = "grpc_asyncio", request_type=language_service.AnnotateTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2392,7 +2382,7 @@ async def test_annotate_text_async_from_dict(): def test_annotate_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2428,7 +2418,7 @@ def test_annotate_text_flattened(): def test_annotate_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2447,7 +2437,7 @@ def test_annotate_text_flattened_error(): @pytest.mark.asyncio async def test_annotate_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2488,7 +2478,7 @@ async def test_annotate_text_flattened_async(): @pytest.mark.asyncio async def test_annotate_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2513,7 +2503,7 @@ async def test_annotate_text_flattened_error_async(): ) def test_analyze_sentiment_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2563,21 +2553,21 @@ def test_analyze_sentiment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2620,7 +2610,7 @@ def test_analyze_sentiment_rest_required_fields( def test_analyze_sentiment_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_sentiment._get_unset_required_fields({}) @@ -2630,7 +2620,7 @@ def test_analyze_sentiment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_sentiment_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2688,7 +2678,7 @@ def test_analyze_sentiment_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeSentimentRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2710,7 +2700,7 @@ def test_analyze_sentiment_rest_bad_request( def test_analyze_sentiment_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2753,7 +2743,7 @@ def test_analyze_sentiment_rest_flattened(): def test_analyze_sentiment_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2771,7 +2761,7 @@ def test_analyze_sentiment_rest_flattened_error(transport: str = "rest"): def test_analyze_sentiment_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2784,7 +2774,7 @@ def test_analyze_sentiment_rest_error(): ) def test_analyze_entities_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2834,21 +2824,21 @@ def test_analyze_entities_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entities._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entities._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2891,7 +2881,7 @@ def test_analyze_entities_rest_required_fields( def test_analyze_entities_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_entities._get_unset_required_fields({}) @@ -2901,7 +2891,7 @@ def test_analyze_entities_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_entities_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2959,7 +2949,7 @@ def test_analyze_entities_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeEntitiesRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2981,7 +2971,7 @@ def test_analyze_entities_rest_bad_request( def test_analyze_entities_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3024,7 +3014,7 @@ def test_analyze_entities_rest_flattened(): def test_analyze_entities_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3042,7 +3032,7 @@ def test_analyze_entities_rest_flattened_error(transport: str = "rest"): def test_analyze_entities_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3055,7 +3045,7 @@ def test_analyze_entities_rest_error(): ) def test_analyze_entity_sentiment_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3105,21 +3095,21 @@ def test_analyze_entity_sentiment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entity_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entity_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3164,7 +3154,7 @@ def test_analyze_entity_sentiment_rest_required_fields( def test_analyze_entity_sentiment_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_entity_sentiment._get_unset_required_fields({}) @@ -3174,7 +3164,7 @@ def test_analyze_entity_sentiment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_entity_sentiment_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3234,7 +3224,7 @@ def test_analyze_entity_sentiment_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeEntitySentimentRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3256,7 +3246,7 @@ def test_analyze_entity_sentiment_rest_bad_request( def test_analyze_entity_sentiment_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3299,7 +3289,7 @@ def test_analyze_entity_sentiment_rest_flattened(): def test_analyze_entity_sentiment_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3317,7 +3307,7 @@ def test_analyze_entity_sentiment_rest_flattened_error(transport: str = "rest"): def test_analyze_entity_sentiment_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3330,7 +3320,7 @@ def test_analyze_entity_sentiment_rest_error(): ) def test_analyze_syntax_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3380,21 +3370,21 @@ def test_analyze_syntax_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_syntax._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_syntax._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3437,7 +3427,7 @@ def test_analyze_syntax_rest_required_fields( def test_analyze_syntax_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_syntax._get_unset_required_fields({}) @@ -3447,7 +3437,7 @@ def test_analyze_syntax_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_syntax_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3505,7 +3495,7 @@ def test_analyze_syntax_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeSyntaxRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3527,7 +3517,7 @@ def test_analyze_syntax_rest_bad_request( def test_analyze_syntax_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3570,7 +3560,7 @@ def test_analyze_syntax_rest_flattened(): def test_analyze_syntax_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3588,7 +3578,7 @@ def test_analyze_syntax_rest_flattened_error(transport: str = "rest"): def test_analyze_syntax_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3601,7 +3591,7 @@ def test_analyze_syntax_rest_error(): ) def test_classify_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3648,21 +3638,21 @@ def test_classify_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).classify_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).classify_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3705,7 +3695,7 @@ def test_classify_text_rest_required_fields( def test_classify_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.classify_text._get_unset_required_fields({}) @@ -3715,7 +3705,7 @@ def test_classify_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_classify_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3773,7 +3763,7 @@ def test_classify_text_rest_bad_request( transport: str = "rest", request_type=language_service.ClassifyTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3795,7 +3785,7 @@ def test_classify_text_rest_bad_request( def test_classify_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3837,7 +3827,7 @@ def test_classify_text_rest_flattened(): def test_classify_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3854,7 +3844,7 @@ def test_classify_text_rest_flattened_error(transport: str = "rest"): def test_classify_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3867,7 +3857,7 @@ def test_classify_text_rest_error(): ) def test_moderate_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3914,21 +3904,21 @@ def test_moderate_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).moderate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).moderate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3971,7 +3961,7 @@ def test_moderate_text_rest_required_fields( def test_moderate_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.moderate_text._get_unset_required_fields({}) @@ -3981,7 +3971,7 @@ def test_moderate_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_moderate_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -4039,7 +4029,7 @@ def test_moderate_text_rest_bad_request( transport: str = "rest", request_type=language_service.ModerateTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4061,7 +4051,7 @@ def test_moderate_text_rest_bad_request( def test_moderate_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4103,7 +4093,7 @@ def test_moderate_text_rest_flattened(): def test_moderate_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4120,7 +4110,7 @@ def test_moderate_text_rest_flattened_error(transport: str = "rest"): def test_moderate_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4133,7 +4123,7 @@ def test_moderate_text_rest_error(): ) def test_annotate_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4183,21 +4173,21 @@ def test_annotate_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).annotate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).annotate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4240,7 +4230,7 @@ def test_annotate_text_rest_required_fields( def test_annotate_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.annotate_text._get_unset_required_fields({}) @@ -4258,7 +4248,7 @@ def test_annotate_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_annotate_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -4316,7 +4306,7 @@ def test_annotate_text_rest_bad_request( transport: str = "rest", request_type=language_service.AnnotateTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4338,7 +4328,7 @@ def test_annotate_text_rest_bad_request( def test_annotate_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4382,7 +4372,7 @@ def test_annotate_text_rest_flattened(): def test_annotate_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4401,24 +4391,24 @@ def test_annotate_text_rest_flattened_error(transport: str = "rest"): def test_annotate_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( @@ -4428,7 +4418,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -4443,13 +4433,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = LanguageServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( @@ -4461,7 +4450,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = LanguageServiceClient(transport=transport) assert client.transport is transport @@ -4470,13 +4459,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.LanguageServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4493,7 +4482,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4507,7 +4496,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = LanguageServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4515,7 +4504,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4527,7 +4516,7 @@ def test_language_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.LanguageServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4539,7 +4528,7 @@ def test_language_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.LanguageServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4577,7 +4566,7 @@ def test_language_service_base_transport_with_credentials_file(): "google.cloud.language_v1.services.language_service.transports.LanguageServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.LanguageServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4599,7 +4588,7 @@ def test_language_service_base_transport_with_adc(): "google.cloud.language_v1.services.language_service.transports.LanguageServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.LanguageServiceTransport() adc.assert_called_once() @@ -4607,7 +4596,7 @@ def test_language_service_base_transport_with_adc(): def test_language_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) LanguageServiceClient() adc.assert_called_once_with( scopes=None, @@ -4630,7 +4619,7 @@ def test_language_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4680,7 +4669,7 @@ def test_language_service_transport_create_channel(transport_class, grpc_helpers ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4711,7 +4700,7 @@ def test_language_service_transport_create_channel(transport_class, grpc_helpers ], ) def test_language_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4749,7 +4738,7 @@ def test_language_service_grpc_transport_client_cert_source_for_mtls(transport_c def test_language_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -4769,7 +4758,7 @@ def test_language_service_http_transport_client_cert_source_for_mtls(): ) def test_language_service_host_no_port(transport_name): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="language.googleapis.com" ), @@ -4792,7 +4781,7 @@ def test_language_service_host_no_port(transport_name): ) def test_language_service_host_with_port(transport_name): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="language.googleapis.com:8000" ), @@ -4812,8 +4801,8 @@ def test_language_service_host_with_port(transport_name): ], ) def test_language_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = LanguageServiceClient( credentials=creds1, transport=transport_name, @@ -4895,7 +4884,7 @@ def test_language_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -5081,7 +5070,7 @@ def test_client_with_default_client_info(): transports.LanguageServiceTransport, "_prep_wrapped_messages" ) as prep: client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5091,7 +5080,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = LanguageServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5100,7 +5089,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -5119,7 +5108,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -5136,7 +5125,7 @@ def test_client_ctx(): ] for transport in transports: client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-language/tests/unit/gapic/language_v1beta2/test_language_service.py b/packages/google-cloud-language/tests/unit/gapic/language_v1beta2/test_language_service.py index dc24f8f5c340..e62549cda5f7 100644 --- a/packages/google-cloud-language/tests/unit/gapic/language_v1beta2/test_language_service.py +++ b/packages/google-cloud-language/tests/unit/gapic/language_v1beta2/test_language_service.py @@ -76,18 +76,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -314,7 +302,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -341,42 +329,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -389,7 +384,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_language_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -443,7 +438,7 @@ def test_language_service_client_service_account_always_use_jwt( def test_language_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -506,9 +501,7 @@ def test_language_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(LanguageServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -927,20 +920,20 @@ def test_language_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -952,13 +945,11 @@ def test_language_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -974,8 +965,7 @@ def test_language_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1128,8 +1118,8 @@ def test_language_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1161,7 +1151,7 @@ def test_language_service_client_create_channel_credentials_file( ) def test_analyze_sentiment(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1193,7 +1183,7 @@ def test_analyze_sentiment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1213,7 +1203,7 @@ async def test_analyze_sentiment_async( request_type=language_service.AnalyzeSentimentRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1250,7 +1240,7 @@ async def test_analyze_sentiment_async_from_dict(): def test_analyze_sentiment_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1284,7 +1274,7 @@ def test_analyze_sentiment_flattened(): def test_analyze_sentiment_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1302,7 +1292,7 @@ def test_analyze_sentiment_flattened_error(): @pytest.mark.asyncio async def test_analyze_sentiment_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1341,7 +1331,7 @@ async def test_analyze_sentiment_flattened_async(): @pytest.mark.asyncio async def test_analyze_sentiment_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1365,7 +1355,7 @@ async def test_analyze_sentiment_flattened_error_async(): ) def test_analyze_entities(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1395,7 +1385,7 @@ def test_analyze_entities_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1413,7 +1403,7 @@ async def test_analyze_entities_async( request_type=language_service.AnalyzeEntitiesRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1448,7 +1438,7 @@ async def test_analyze_entities_async_from_dict(): def test_analyze_entities_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1480,7 +1470,7 @@ def test_analyze_entities_flattened(): def test_analyze_entities_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1498,7 +1488,7 @@ def test_analyze_entities_flattened_error(): @pytest.mark.asyncio async def test_analyze_entities_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1535,7 +1525,7 @@ async def test_analyze_entities_flattened_async(): @pytest.mark.asyncio async def test_analyze_entities_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1559,7 +1549,7 @@ async def test_analyze_entities_flattened_error_async(): ) def test_analyze_entity_sentiment(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1591,7 +1581,7 @@ def test_analyze_entity_sentiment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1611,7 +1601,7 @@ async def test_analyze_entity_sentiment_async( request_type=language_service.AnalyzeEntitySentimentRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1648,7 +1638,7 @@ async def test_analyze_entity_sentiment_async_from_dict(): def test_analyze_entity_sentiment_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1682,7 +1672,7 @@ def test_analyze_entity_sentiment_flattened(): def test_analyze_entity_sentiment_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1700,7 +1690,7 @@ def test_analyze_entity_sentiment_flattened_error(): @pytest.mark.asyncio async def test_analyze_entity_sentiment_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1739,7 +1729,7 @@ async def test_analyze_entity_sentiment_flattened_async(): @pytest.mark.asyncio async def test_analyze_entity_sentiment_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1763,7 +1753,7 @@ async def test_analyze_entity_sentiment_flattened_error_async(): ) def test_analyze_syntax(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1793,7 +1783,7 @@ def test_analyze_syntax_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1810,7 +1800,7 @@ async def test_analyze_syntax_async( transport: str = "grpc_asyncio", request_type=language_service.AnalyzeSyntaxRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1845,7 +1835,7 @@ async def test_analyze_syntax_async_from_dict(): def test_analyze_syntax_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1877,7 +1867,7 @@ def test_analyze_syntax_flattened(): def test_analyze_syntax_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1895,7 +1885,7 @@ def test_analyze_syntax_flattened_error(): @pytest.mark.asyncio async def test_analyze_syntax_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1932,7 +1922,7 @@ async def test_analyze_syntax_flattened_async(): @pytest.mark.asyncio async def test_analyze_syntax_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1956,7 +1946,7 @@ async def test_analyze_syntax_flattened_error_async(): ) def test_classify_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1983,7 +1973,7 @@ def test_classify_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2000,7 +1990,7 @@ async def test_classify_text_async( transport: str = "grpc_asyncio", request_type=language_service.ClassifyTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2032,7 +2022,7 @@ async def test_classify_text_async_from_dict(): def test_classify_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2060,7 +2050,7 @@ def test_classify_text_flattened(): def test_classify_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2077,7 +2067,7 @@ def test_classify_text_flattened_error(): @pytest.mark.asyncio async def test_classify_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2110,7 +2100,7 @@ async def test_classify_text_flattened_async(): @pytest.mark.asyncio async def test_classify_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2133,7 +2123,7 @@ async def test_classify_text_flattened_error_async(): ) def test_moderate_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2160,7 +2150,7 @@ def test_moderate_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2177,7 +2167,7 @@ async def test_moderate_text_async( transport: str = "grpc_asyncio", request_type=language_service.ModerateTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2209,7 +2199,7 @@ async def test_moderate_text_async_from_dict(): def test_moderate_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2237,7 +2227,7 @@ def test_moderate_text_flattened(): def test_moderate_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2254,7 +2244,7 @@ def test_moderate_text_flattened_error(): @pytest.mark.asyncio async def test_moderate_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2287,7 +2277,7 @@ async def test_moderate_text_flattened_async(): @pytest.mark.asyncio async def test_moderate_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2310,7 +2300,7 @@ async def test_moderate_text_flattened_error_async(): ) def test_annotate_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2340,7 +2330,7 @@ def test_annotate_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2357,7 +2347,7 @@ async def test_annotate_text_async( transport: str = "grpc_asyncio", request_type=language_service.AnnotateTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2392,7 +2382,7 @@ async def test_annotate_text_async_from_dict(): def test_annotate_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2428,7 +2418,7 @@ def test_annotate_text_flattened(): def test_annotate_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2447,7 +2437,7 @@ def test_annotate_text_flattened_error(): @pytest.mark.asyncio async def test_annotate_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2488,7 +2478,7 @@ async def test_annotate_text_flattened_async(): @pytest.mark.asyncio async def test_annotate_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2513,7 +2503,7 @@ async def test_annotate_text_flattened_error_async(): ) def test_analyze_sentiment_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2563,21 +2553,21 @@ def test_analyze_sentiment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2620,7 +2610,7 @@ def test_analyze_sentiment_rest_required_fields( def test_analyze_sentiment_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_sentiment._get_unset_required_fields({}) @@ -2630,7 +2620,7 @@ def test_analyze_sentiment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_sentiment_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2688,7 +2678,7 @@ def test_analyze_sentiment_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeSentimentRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2710,7 +2700,7 @@ def test_analyze_sentiment_rest_bad_request( def test_analyze_sentiment_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2753,7 +2743,7 @@ def test_analyze_sentiment_rest_flattened(): def test_analyze_sentiment_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2771,7 +2761,7 @@ def test_analyze_sentiment_rest_flattened_error(transport: str = "rest"): def test_analyze_sentiment_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2784,7 +2774,7 @@ def test_analyze_sentiment_rest_error(): ) def test_analyze_entities_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2834,21 +2824,21 @@ def test_analyze_entities_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entities._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entities._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2891,7 +2881,7 @@ def test_analyze_entities_rest_required_fields( def test_analyze_entities_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_entities._get_unset_required_fields({}) @@ -2901,7 +2891,7 @@ def test_analyze_entities_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_entities_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2959,7 +2949,7 @@ def test_analyze_entities_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeEntitiesRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2981,7 +2971,7 @@ def test_analyze_entities_rest_bad_request( def test_analyze_entities_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3024,7 +3014,7 @@ def test_analyze_entities_rest_flattened(): def test_analyze_entities_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3042,7 +3032,7 @@ def test_analyze_entities_rest_flattened_error(transport: str = "rest"): def test_analyze_entities_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3055,7 +3045,7 @@ def test_analyze_entities_rest_error(): ) def test_analyze_entity_sentiment_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3105,21 +3095,21 @@ def test_analyze_entity_sentiment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entity_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entity_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3164,7 +3154,7 @@ def test_analyze_entity_sentiment_rest_required_fields( def test_analyze_entity_sentiment_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_entity_sentiment._get_unset_required_fields({}) @@ -3174,7 +3164,7 @@ def test_analyze_entity_sentiment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_entity_sentiment_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3234,7 +3224,7 @@ def test_analyze_entity_sentiment_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeEntitySentimentRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3256,7 +3246,7 @@ def test_analyze_entity_sentiment_rest_bad_request( def test_analyze_entity_sentiment_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3300,7 +3290,7 @@ def test_analyze_entity_sentiment_rest_flattened(): def test_analyze_entity_sentiment_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3318,7 +3308,7 @@ def test_analyze_entity_sentiment_rest_flattened_error(transport: str = "rest"): def test_analyze_entity_sentiment_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3331,7 +3321,7 @@ def test_analyze_entity_sentiment_rest_error(): ) def test_analyze_syntax_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3381,21 +3371,21 @@ def test_analyze_syntax_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_syntax._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_syntax._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3438,7 +3428,7 @@ def test_analyze_syntax_rest_required_fields( def test_analyze_syntax_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_syntax._get_unset_required_fields({}) @@ -3448,7 +3438,7 @@ def test_analyze_syntax_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_syntax_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3506,7 +3496,7 @@ def test_analyze_syntax_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeSyntaxRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3528,7 +3518,7 @@ def test_analyze_syntax_rest_bad_request( def test_analyze_syntax_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3571,7 +3561,7 @@ def test_analyze_syntax_rest_flattened(): def test_analyze_syntax_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3589,7 +3579,7 @@ def test_analyze_syntax_rest_flattened_error(transport: str = "rest"): def test_analyze_syntax_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3602,7 +3592,7 @@ def test_analyze_syntax_rest_error(): ) def test_classify_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3649,21 +3639,21 @@ def test_classify_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).classify_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).classify_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3706,7 +3696,7 @@ def test_classify_text_rest_required_fields( def test_classify_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.classify_text._get_unset_required_fields({}) @@ -3716,7 +3706,7 @@ def test_classify_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_classify_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3774,7 +3764,7 @@ def test_classify_text_rest_bad_request( transport: str = "rest", request_type=language_service.ClassifyTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3796,7 +3786,7 @@ def test_classify_text_rest_bad_request( def test_classify_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3838,7 +3828,7 @@ def test_classify_text_rest_flattened(): def test_classify_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3855,7 +3845,7 @@ def test_classify_text_rest_flattened_error(transport: str = "rest"): def test_classify_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3868,7 +3858,7 @@ def test_classify_text_rest_error(): ) def test_moderate_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3915,21 +3905,21 @@ def test_moderate_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).moderate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).moderate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3972,7 +3962,7 @@ def test_moderate_text_rest_required_fields( def test_moderate_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.moderate_text._get_unset_required_fields({}) @@ -3982,7 +3972,7 @@ def test_moderate_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_moderate_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -4040,7 +4030,7 @@ def test_moderate_text_rest_bad_request( transport: str = "rest", request_type=language_service.ModerateTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4062,7 +4052,7 @@ def test_moderate_text_rest_bad_request( def test_moderate_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4104,7 +4094,7 @@ def test_moderate_text_rest_flattened(): def test_moderate_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4121,7 +4111,7 @@ def test_moderate_text_rest_flattened_error(transport: str = "rest"): def test_moderate_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4134,7 +4124,7 @@ def test_moderate_text_rest_error(): ) def test_annotate_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4184,21 +4174,21 @@ def test_annotate_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).annotate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).annotate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4241,7 +4231,7 @@ def test_annotate_text_rest_required_fields( def test_annotate_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.annotate_text._get_unset_required_fields({}) @@ -4259,7 +4249,7 @@ def test_annotate_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_annotate_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -4317,7 +4307,7 @@ def test_annotate_text_rest_bad_request( transport: str = "rest", request_type=language_service.AnnotateTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4339,7 +4329,7 @@ def test_annotate_text_rest_bad_request( def test_annotate_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4383,7 +4373,7 @@ def test_annotate_text_rest_flattened(): def test_annotate_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4402,24 +4392,24 @@ def test_annotate_text_rest_flattened_error(transport: str = "rest"): def test_annotate_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( @@ -4429,7 +4419,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -4444,13 +4434,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = LanguageServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( @@ -4462,7 +4451,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = LanguageServiceClient(transport=transport) assert client.transport is transport @@ -4471,13 +4460,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.LanguageServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4494,7 +4483,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4508,7 +4497,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = LanguageServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4516,7 +4505,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4528,7 +4517,7 @@ def test_language_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.LanguageServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4540,7 +4529,7 @@ def test_language_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.LanguageServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4578,7 +4567,7 @@ def test_language_service_base_transport_with_credentials_file(): "google.cloud.language_v1beta2.services.language_service.transports.LanguageServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.LanguageServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4600,7 +4589,7 @@ def test_language_service_base_transport_with_adc(): "google.cloud.language_v1beta2.services.language_service.transports.LanguageServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.LanguageServiceTransport() adc.assert_called_once() @@ -4608,7 +4597,7 @@ def test_language_service_base_transport_with_adc(): def test_language_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) LanguageServiceClient() adc.assert_called_once_with( scopes=None, @@ -4631,7 +4620,7 @@ def test_language_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4681,7 +4670,7 @@ def test_language_service_transport_create_channel(transport_class, grpc_helpers ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4712,7 +4701,7 @@ def test_language_service_transport_create_channel(transport_class, grpc_helpers ], ) def test_language_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4750,7 +4739,7 @@ def test_language_service_grpc_transport_client_cert_source_for_mtls(transport_c def test_language_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -4770,7 +4759,7 @@ def test_language_service_http_transport_client_cert_source_for_mtls(): ) def test_language_service_host_no_port(transport_name): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="language.googleapis.com" ), @@ -4793,7 +4782,7 @@ def test_language_service_host_no_port(transport_name): ) def test_language_service_host_with_port(transport_name): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="language.googleapis.com:8000" ), @@ -4813,8 +4802,8 @@ def test_language_service_host_with_port(transport_name): ], ) def test_language_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = LanguageServiceClient( credentials=creds1, transport=transport_name, @@ -4896,7 +4885,7 @@ def test_language_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -5082,7 +5071,7 @@ def test_client_with_default_client_info(): transports.LanguageServiceTransport, "_prep_wrapped_messages" ) as prep: client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5092,7 +5081,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = LanguageServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5101,7 +5090,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -5120,7 +5109,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -5137,7 +5126,7 @@ def test_client_ctx(): ] for transport in transports: client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-language/tests/unit/gapic/language_v2/test_language_service.py b/packages/google-cloud-language/tests/unit/gapic/language_v2/test_language_service.py index c2fc6fee241f..9fed9abd9d0c 100644 --- a/packages/google-cloud-language/tests/unit/gapic/language_v2/test_language_service.py +++ b/packages/google-cloud-language/tests/unit/gapic/language_v2/test_language_service.py @@ -76,18 +76,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -314,7 +302,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -341,42 +329,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -389,7 +384,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_language_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -443,7 +438,7 @@ def test_language_service_client_service_account_always_use_jwt( def test_language_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -506,9 +501,7 @@ def test_language_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(LanguageServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -927,20 +920,20 @@ def test_language_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -952,13 +945,11 @@ def test_language_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -974,8 +965,7 @@ def test_language_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1128,8 +1118,8 @@ def test_language_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1161,7 +1151,7 @@ def test_language_service_client_create_channel_credentials_file( ) def test_analyze_sentiment(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1195,7 +1185,7 @@ def test_analyze_sentiment_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1215,7 +1205,7 @@ async def test_analyze_sentiment_async( request_type=language_service.AnalyzeSentimentRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1254,7 +1244,7 @@ async def test_analyze_sentiment_async_from_dict(): def test_analyze_sentiment_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1288,7 +1278,7 @@ def test_analyze_sentiment_flattened(): def test_analyze_sentiment_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1306,7 +1296,7 @@ def test_analyze_sentiment_flattened_error(): @pytest.mark.asyncio async def test_analyze_sentiment_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1345,7 +1335,7 @@ async def test_analyze_sentiment_flattened_async(): @pytest.mark.asyncio async def test_analyze_sentiment_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1369,7 +1359,7 @@ async def test_analyze_sentiment_flattened_error_async(): ) def test_analyze_entities(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1401,7 +1391,7 @@ def test_analyze_entities_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1419,7 +1409,7 @@ async def test_analyze_entities_async( request_type=language_service.AnalyzeEntitiesRequest, ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1456,7 +1446,7 @@ async def test_analyze_entities_async_from_dict(): def test_analyze_entities_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1488,7 +1478,7 @@ def test_analyze_entities_flattened(): def test_analyze_entities_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1506,7 +1496,7 @@ def test_analyze_entities_flattened_error(): @pytest.mark.asyncio async def test_analyze_entities_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1543,7 +1533,7 @@ async def test_analyze_entities_flattened_async(): @pytest.mark.asyncio async def test_analyze_entities_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1567,7 +1557,7 @@ async def test_analyze_entities_flattened_error_async(): ) def test_classify_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1599,7 +1589,7 @@ def test_classify_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1616,7 +1606,7 @@ async def test_classify_text_async( transport: str = "grpc_asyncio", request_type=language_service.ClassifyTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1653,7 +1643,7 @@ async def test_classify_text_async_from_dict(): def test_classify_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1681,7 +1671,7 @@ def test_classify_text_flattened(): def test_classify_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1698,7 +1688,7 @@ def test_classify_text_flattened_error(): @pytest.mark.asyncio async def test_classify_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1731,7 +1721,7 @@ async def test_classify_text_flattened_async(): @pytest.mark.asyncio async def test_classify_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1754,7 +1744,7 @@ async def test_classify_text_flattened_error_async(): ) def test_moderate_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1786,7 +1776,7 @@ def test_moderate_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1803,7 +1793,7 @@ async def test_moderate_text_async( transport: str = "grpc_asyncio", request_type=language_service.ModerateTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1840,7 +1830,7 @@ async def test_moderate_text_async_from_dict(): def test_moderate_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1868,7 +1858,7 @@ def test_moderate_text_flattened(): def test_moderate_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1885,7 +1875,7 @@ def test_moderate_text_flattened_error(): @pytest.mark.asyncio async def test_moderate_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1918,7 +1908,7 @@ async def test_moderate_text_flattened_async(): @pytest.mark.asyncio async def test_moderate_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1941,7 +1931,7 @@ async def test_moderate_text_flattened_error_async(): ) def test_annotate_text(request_type, transport: str = "grpc"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1973,7 +1963,7 @@ def test_annotate_text_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1990,7 +1980,7 @@ async def test_annotate_text_async( transport: str = "grpc_asyncio", request_type=language_service.AnnotateTextRequest ): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2027,7 +2017,7 @@ async def test_annotate_text_async_from_dict(): def test_annotate_text_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2065,7 +2055,7 @@ def test_annotate_text_flattened(): def test_annotate_text_flattened_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2086,7 +2076,7 @@ def test_annotate_text_flattened_error(): @pytest.mark.asyncio async def test_annotate_text_flattened_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2129,7 +2119,7 @@ async def test_annotate_text_flattened_async(): @pytest.mark.asyncio async def test_annotate_text_flattened_error_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2156,7 +2146,7 @@ async def test_annotate_text_flattened_error_async(): ) def test_analyze_sentiment_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2208,21 +2198,21 @@ def test_analyze_sentiment_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_sentiment._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2265,7 +2255,7 @@ def test_analyze_sentiment_rest_required_fields( def test_analyze_sentiment_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_sentiment._get_unset_required_fields({}) @@ -2275,7 +2265,7 @@ def test_analyze_sentiment_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_sentiment_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2333,7 +2323,7 @@ def test_analyze_sentiment_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeSentimentRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2355,7 +2345,7 @@ def test_analyze_sentiment_rest_bad_request( def test_analyze_sentiment_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2398,7 +2388,7 @@ def test_analyze_sentiment_rest_flattened(): def test_analyze_sentiment_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2416,7 +2406,7 @@ def test_analyze_sentiment_rest_flattened_error(transport: str = "rest"): def test_analyze_sentiment_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2429,7 +2419,7 @@ def test_analyze_sentiment_rest_error(): ) def test_analyze_entities_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2481,21 +2471,21 @@ def test_analyze_entities_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entities._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).analyze_entities._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2538,7 +2528,7 @@ def test_analyze_entities_rest_required_fields( def test_analyze_entities_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.analyze_entities._get_unset_required_fields({}) @@ -2548,7 +2538,7 @@ def test_analyze_entities_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_analyze_entities_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2606,7 +2596,7 @@ def test_analyze_entities_rest_bad_request( transport: str = "rest", request_type=language_service.AnalyzeEntitiesRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2628,7 +2618,7 @@ def test_analyze_entities_rest_bad_request( def test_analyze_entities_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2671,7 +2661,7 @@ def test_analyze_entities_rest_flattened(): def test_analyze_entities_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2689,7 +2679,7 @@ def test_analyze_entities_rest_flattened_error(transport: str = "rest"): def test_analyze_entities_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2702,7 +2692,7 @@ def test_analyze_entities_rest_error(): ) def test_classify_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2754,21 +2744,21 @@ def test_classify_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).classify_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).classify_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2811,7 +2801,7 @@ def test_classify_text_rest_required_fields( def test_classify_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.classify_text._get_unset_required_fields({}) @@ -2821,7 +2811,7 @@ def test_classify_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_classify_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -2879,7 +2869,7 @@ def test_classify_text_rest_bad_request( transport: str = "rest", request_type=language_service.ClassifyTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2901,7 +2891,7 @@ def test_classify_text_rest_bad_request( def test_classify_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2943,7 +2933,7 @@ def test_classify_text_rest_flattened(): def test_classify_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2960,7 +2950,7 @@ def test_classify_text_rest_flattened_error(transport: str = "rest"): def test_classify_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2973,7 +2963,7 @@ def test_classify_text_rest_error(): ) def test_moderate_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3025,21 +3015,21 @@ def test_moderate_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).moderate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).moderate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3082,7 +3072,7 @@ def test_moderate_text_rest_required_fields( def test_moderate_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.moderate_text._get_unset_required_fields({}) @@ -3092,7 +3082,7 @@ def test_moderate_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_moderate_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3150,7 +3140,7 @@ def test_moderate_text_rest_bad_request( transport: str = "rest", request_type=language_service.ModerateTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3172,7 +3162,7 @@ def test_moderate_text_rest_bad_request( def test_moderate_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3214,7 +3204,7 @@ def test_moderate_text_rest_flattened(): def test_moderate_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3231,7 +3221,7 @@ def test_moderate_text_rest_flattened_error(transport: str = "rest"): def test_moderate_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3244,7 +3234,7 @@ def test_moderate_text_rest_error(): ) def test_annotate_text_rest(request_type): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3296,21 +3286,21 @@ def test_annotate_text_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).annotate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).annotate_text._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3353,7 +3343,7 @@ def test_annotate_text_rest_required_fields( def test_annotate_text_rest_unset_required_fields(): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.annotate_text._get_unset_required_fields({}) @@ -3371,7 +3361,7 @@ def test_annotate_text_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_annotate_text_rest_interceptors(null_interceptor): transport = transports.LanguageServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.LanguageServiceRestInterceptor(), @@ -3429,7 +3419,7 @@ def test_annotate_text_rest_bad_request( transport: str = "rest", request_type=language_service.AnnotateTextRequest ): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3451,7 +3441,7 @@ def test_annotate_text_rest_bad_request( def test_annotate_text_rest_flattened(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3497,7 +3487,7 @@ def test_annotate_text_rest_flattened(): def test_annotate_text_rest_flattened_error(transport: str = "rest"): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3518,24 +3508,24 @@ def test_annotate_text_rest_flattened_error(transport: str = "rest"): def test_annotate_text_rest_error(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( @@ -3545,7 +3535,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3560,13 +3550,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = LanguageServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = LanguageServiceClient( @@ -3578,7 +3567,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = LanguageServiceClient(transport=transport) assert client.transport is transport @@ -3587,13 +3576,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.LanguageServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.LanguageServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3610,7 +3599,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3624,7 +3613,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = LanguageServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3632,7 +3621,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3644,7 +3633,7 @@ def test_language_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.LanguageServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3656,7 +3645,7 @@ def test_language_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.LanguageServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3692,7 +3681,7 @@ def test_language_service_base_transport_with_credentials_file(): "google.cloud.language_v2.services.language_service.transports.LanguageServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.LanguageServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3714,7 +3703,7 @@ def test_language_service_base_transport_with_adc(): "google.cloud.language_v2.services.language_service.transports.LanguageServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.LanguageServiceTransport() adc.assert_called_once() @@ -3722,7 +3711,7 @@ def test_language_service_base_transport_with_adc(): def test_language_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) LanguageServiceClient() adc.assert_called_once_with( scopes=None, @@ -3745,7 +3734,7 @@ def test_language_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -3795,7 +3784,7 @@ def test_language_service_transport_create_channel(transport_class, grpc_helpers ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -3826,7 +3815,7 @@ def test_language_service_transport_create_channel(transport_class, grpc_helpers ], ) def test_language_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -3864,7 +3853,7 @@ def test_language_service_grpc_transport_client_cert_source_for_mtls(transport_c def test_language_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -3884,7 +3873,7 @@ def test_language_service_http_transport_client_cert_source_for_mtls(): ) def test_language_service_host_no_port(transport_name): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="language.googleapis.com" ), @@ -3907,7 +3896,7 @@ def test_language_service_host_no_port(transport_name): ) def test_language_service_host_with_port(transport_name): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="language.googleapis.com:8000" ), @@ -3927,8 +3916,8 @@ def test_language_service_host_with_port(transport_name): ], ) def test_language_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = LanguageServiceClient( credentials=creds1, transport=transport_name, @@ -4004,7 +3993,7 @@ def test_language_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4190,7 +4179,7 @@ def test_client_with_default_client_info(): transports.LanguageServiceTransport, "_prep_wrapped_messages" ) as prep: client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4200,7 +4189,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = LanguageServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4209,7 +4198,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = LanguageServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4228,7 +4217,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4245,7 +4234,7 @@ def test_client_ctx(): ] for transport in transports: client = LanguageServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-life-sciences/google/cloud/lifesciences/gapic_version.py b/packages/google-cloud-life-sciences/google/cloud/lifesciences/gapic_version.py index 06f92a710eca..360a0d13ebdd 100644 --- a/packages/google-cloud-life-sciences/google/cloud/lifesciences/gapic_version.py +++ b/packages/google-cloud-life-sciences/google/cloud/lifesciences/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.9.6" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/gapic_version.py b/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/gapic_version.py index 06f92a710eca..360a0d13ebdd 100644 --- a/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/gapic_version.py +++ b/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.9.6" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/client.py b/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/client.py index a68ccd71b5e5..f76091ea321a 100644 --- a/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/client.py +++ b/packages/google-cloud-life-sciences/google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/client.py @@ -366,6 +366,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -384,6 +385,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -460,17 +462,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = WorkflowsServiceV2BetaClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = WorkflowsServiceV2BetaClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-life-sciences/samples/generated_samples/snippet_metadata_google.cloud.lifesciences.v2beta.json b/packages/google-cloud-life-sciences/samples/generated_samples/snippet_metadata_google.cloud.lifesciences.v2beta.json index 77cc0e3d6f4d..a5f3a0632b0b 100644 --- a/packages/google-cloud-life-sciences/samples/generated_samples/snippet_metadata_google.cloud.lifesciences.v2beta.json +++ b/packages/google-cloud-life-sciences/samples/generated_samples/snippet_metadata_google.cloud.lifesciences.v2beta.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-life-sciences", - "version": "0.9.6" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-life-sciences/setup.py b/packages/google-cloud-life-sciences/setup.py index bbb10afd5a17..558b69fc72bc 100644 --- a/packages/google-cloud-life-sciences/setup.py +++ b/packages/google-cloud-life-sciences/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-life-sciences/testing/constraints-3.7.txt b/packages/google-cloud-life-sciences/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-life-sciences/testing/constraints-3.7.txt +++ b/packages/google-cloud-life-sciences/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-life-sciences/tests/unit/gapic/lifesciences_v2beta/test_workflows_service_v2_beta.py b/packages/google-cloud-life-sciences/tests/unit/gapic/lifesciences_v2beta/test_workflows_service_v2_beta.py index e7fc0fdaf8f9..fd6e83b0cd8e 100644 --- a/packages/google-cloud-life-sciences/tests/unit/gapic/lifesciences_v2beta/test_workflows_service_v2_beta.py +++ b/packages/google-cloud-life-sciences/tests/unit/gapic/lifesciences_v2beta/test_workflows_service_v2_beta.py @@ -88,18 +88,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -351,7 +339,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -378,42 +366,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -426,7 +421,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_workflows_service_v2_beta_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -480,7 +475,7 @@ def test_workflows_service_v2_beta_client_service_account_always_use_jwt( def test_workflows_service_v2_beta_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -551,9 +546,7 @@ def test_workflows_service_v2_beta_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(WorkflowsServiceV2BetaClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -974,20 +967,20 @@ def test_workflows_service_v2_beta_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -999,13 +992,11 @@ def test_workflows_service_v2_beta_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -1021,8 +1012,7 @@ def test_workflows_service_v2_beta_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1188,8 +1178,8 @@ def test_workflows_service_v2_beta_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1218,7 +1208,7 @@ def test_workflows_service_v2_beta_client_create_channel_credentials_file( ) def test_run_pipeline(request_type, transport: str = "grpc"): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1245,7 +1235,7 @@ def test_run_pipeline_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1262,7 +1252,7 @@ async def test_run_pipeline_async( transport: str = "grpc_asyncio", request_type=workflows.RunPipelineRequest ): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1294,7 +1284,7 @@ async def test_run_pipeline_async_from_dict(): def test_run_pipeline_field_headers(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1324,7 +1314,7 @@ def test_run_pipeline_field_headers(): @pytest.mark.asyncio async def test_run_pipeline_field_headers_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1362,7 +1352,7 @@ async def test_run_pipeline_field_headers_async(): ) def test_run_pipeline_rest(request_type): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -1405,21 +1395,21 @@ def test_run_pipeline_rest_required_fields(request_type=workflows.RunPipelineReq # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).run_pipeline._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).run_pipeline._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with non-default values are left alone client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -1459,7 +1449,7 @@ def test_run_pipeline_rest_required_fields(request_type=workflows.RunPipelineReq def test_run_pipeline_rest_unset_required_fields(): transport = transports.WorkflowsServiceV2BetaRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.run_pipeline._get_unset_required_fields({}) @@ -1469,7 +1459,7 @@ def test_run_pipeline_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_run_pipeline_rest_interceptors(null_interceptor): transport = transports.WorkflowsServiceV2BetaRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.WorkflowsServiceV2BetaRestInterceptor(), @@ -1527,7 +1517,7 @@ def test_run_pipeline_rest_bad_request( transport: str = "rest", request_type=workflows.RunPipelineRequest ): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1549,24 +1539,24 @@ def test_run_pipeline_rest_bad_request( def test_run_pipeline_rest_error(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.WorkflowsServiceV2BetaGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.WorkflowsServiceV2BetaGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = WorkflowsServiceV2BetaClient( @@ -1576,7 +1566,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.WorkflowsServiceV2BetaGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -1591,13 +1581,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = WorkflowsServiceV2BetaClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.WorkflowsServiceV2BetaGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = WorkflowsServiceV2BetaClient( @@ -1609,7 +1598,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.WorkflowsServiceV2BetaGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = WorkflowsServiceV2BetaClient(transport=transport) assert client.transport is transport @@ -1618,13 +1607,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.WorkflowsServiceV2BetaGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.WorkflowsServiceV2BetaGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -1641,7 +1630,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -1655,7 +1644,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = WorkflowsServiceV2BetaClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -1663,7 +1652,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -1675,7 +1664,7 @@ def test_workflows_service_v2_beta_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.WorkflowsServiceV2BetaTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -1687,7 +1676,7 @@ def test_workflows_service_v2_beta_base_transport(): ) as Transport: Transport.return_value = None transport = transports.WorkflowsServiceV2BetaTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -1729,7 +1718,7 @@ def test_workflows_service_v2_beta_base_transport_with_credentials_file(): "google.cloud.lifesciences_v2beta.services.workflows_service_v2_beta.transports.WorkflowsServiceV2BetaTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.WorkflowsServiceV2BetaTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -1748,7 +1737,7 @@ def test_workflows_service_v2_beta_base_transport_with_adc(): "google.cloud.lifesciences_v2beta.services.workflows_service_v2_beta.transports.WorkflowsServiceV2BetaTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.WorkflowsServiceV2BetaTransport() adc.assert_called_once() @@ -1756,7 +1745,7 @@ def test_workflows_service_v2_beta_base_transport_with_adc(): def test_workflows_service_v2_beta_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) WorkflowsServiceV2BetaClient() adc.assert_called_once_with( scopes=None, @@ -1776,7 +1765,7 @@ def test_workflows_service_v2_beta_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -1825,7 +1814,7 @@ def test_workflows_service_v2_beta_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -1855,7 +1844,7 @@ def test_workflows_service_v2_beta_transport_create_channel( def test_workflows_service_v2_beta_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -1893,7 +1882,7 @@ def test_workflows_service_v2_beta_grpc_transport_client_cert_source_for_mtls( def test_workflows_service_v2_beta_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -1905,7 +1894,7 @@ def test_workflows_service_v2_beta_http_transport_client_cert_source_for_mtls(): def test_workflows_service_v2_beta_rest_lro_client(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -1930,7 +1919,7 @@ def test_workflows_service_v2_beta_rest_lro_client(): ) def test_workflows_service_v2_beta_host_no_port(transport_name): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="lifesciences.googleapis.com" ), @@ -1953,7 +1942,7 @@ def test_workflows_service_v2_beta_host_no_port(transport_name): ) def test_workflows_service_v2_beta_host_with_port(transport_name): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="lifesciences.googleapis.com:8000" ), @@ -1973,8 +1962,8 @@ def test_workflows_service_v2_beta_host_with_port(transport_name): ], ) def test_workflows_service_v2_beta_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = WorkflowsServiceV2BetaClient( credentials=creds1, transport=transport_name, @@ -2038,7 +2027,7 @@ def test_workflows_service_v2_beta_transport_channel_mtls_with_client_cert_sourc mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2116,7 +2105,7 @@ def test_workflows_service_v2_beta_transport_channel_mtls_with_adc(transport_cla def test_workflows_service_v2_beta_grpc_lro_client(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -2133,7 +2122,7 @@ def test_workflows_service_v2_beta_grpc_lro_client(): def test_workflows_service_v2_beta_grpc_lro_async_client(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -2258,7 +2247,7 @@ def test_client_with_default_client_info(): transports.WorkflowsServiceV2BetaTransport, "_prep_wrapped_messages" ) as prep: client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2268,7 +2257,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = WorkflowsServiceV2BetaClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2277,7 +2266,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -2292,7 +2281,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2322,7 +2311,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -2350,7 +2339,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2378,7 +2367,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -2406,7 +2395,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2436,7 +2425,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -2464,7 +2453,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2494,7 +2483,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -2522,7 +2511,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2552,7 +2541,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -2578,7 +2567,7 @@ def test_list_operations_rest(request_type): def test_cancel_operation(transport: str = "grpc"): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2603,7 +2592,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2627,7 +2616,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2656,7 +2645,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2683,7 +2672,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -2701,7 +2690,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -2717,7 +2706,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2742,7 +2731,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2768,7 +2757,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2797,7 +2786,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2826,7 +2815,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -2844,7 +2833,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -2862,7 +2851,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2887,7 +2876,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2913,7 +2902,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2942,7 +2931,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2971,7 +2960,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -2989,7 +2978,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -3007,7 +2996,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3032,7 +3021,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3058,7 +3047,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3087,7 +3076,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3116,7 +3105,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3134,7 +3123,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3152,7 +3141,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3177,7 +3166,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3203,7 +3192,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3232,7 +3221,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3261,7 +3250,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3279,7 +3268,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = WorkflowsServiceV2BetaAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3303,7 +3292,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -3320,7 +3309,7 @@ def test_client_ctx(): ] for transport in transports: client = WorkflowsServiceV2BetaClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-managed-identities/google/cloud/managedidentities/gapic_version.py b/packages/google-cloud-managed-identities/google/cloud/managedidentities/gapic_version.py index b7ebf472ead3..360a0d13ebdd 100644 --- a/packages/google-cloud-managed-identities/google/cloud/managedidentities/gapic_version.py +++ b/packages/google-cloud-managed-identities/google/cloud/managedidentities/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.9.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/gapic_version.py b/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/gapic_version.py index b7ebf472ead3..360a0d13ebdd 100644 --- a/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/gapic_version.py +++ b/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.9.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/services/managed_identities_service/client.py b/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/services/managed_identities_service/client.py index c13976386d94..82b423f6c856 100644 --- a/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/services/managed_identities_service/client.py +++ b/packages/google-cloud-managed-identities/google/cloud/managedidentities_v1/services/managed_identities_service/client.py @@ -421,6 +421,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -439,6 +440,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -515,17 +517,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = ManagedIdentitiesServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = ManagedIdentitiesServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-managed-identities/samples/generated_samples/snippet_metadata_google.cloud.managedidentities.v1.json b/packages/google-cloud-managed-identities/samples/generated_samples/snippet_metadata_google.cloud.managedidentities.v1.json index 36b441f646ad..21e96cde5067 100644 --- a/packages/google-cloud-managed-identities/samples/generated_samples/snippet_metadata_google.cloud.managedidentities.v1.json +++ b/packages/google-cloud-managed-identities/samples/generated_samples/snippet_metadata_google.cloud.managedidentities.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-managed-identities", - "version": "1.9.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-managed-identities/setup.py b/packages/google-cloud-managed-identities/setup.py index 1fec0241aabd..338e197ab2c0 100644 --- a/packages/google-cloud-managed-identities/setup.py +++ b/packages/google-cloud-managed-identities/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-managed-identities/testing/constraints-3.7.txt b/packages/google-cloud-managed-identities/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-managed-identities/testing/constraints-3.7.txt +++ b/packages/google-cloud-managed-identities/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-managed-identities/tests/unit/gapic/managedidentities_v1/test_managed_identities_service.py b/packages/google-cloud-managed-identities/tests/unit/gapic/managedidentities_v1/test_managed_identities_service.py index 245e688026c2..e4c2849faa74 100644 --- a/packages/google-cloud-managed-identities/tests/unit/gapic/managedidentities_v1/test_managed_identities_service.py +++ b/packages/google-cloud-managed-identities/tests/unit/gapic/managedidentities_v1/test_managed_identities_service.py @@ -85,18 +85,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -343,7 +331,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -370,42 +358,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -417,7 +412,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_managed_identities_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -465,7 +460,7 @@ def test_managed_identities_service_client_service_account_always_use_jwt( def test_managed_identities_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -528,9 +523,7 @@ def test_managed_identities_service_client_client_options( with mock.patch.object( ManagedIdentitiesServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -943,20 +936,20 @@ def test_managed_identities_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -968,13 +961,11 @@ def test_managed_identities_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -990,8 +981,7 @@ def test_managed_identities_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1146,8 +1136,8 @@ def test_managed_identities_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1176,7 +1166,7 @@ def test_managed_identities_service_client_create_channel_credentials_file( ) def test_create_microsoft_ad_domain(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1205,7 +1195,7 @@ def test_create_microsoft_ad_domain_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1225,7 +1215,7 @@ async def test_create_microsoft_ad_domain_async( request_type=managed_identities_service.CreateMicrosoftAdDomainRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1259,7 +1249,7 @@ async def test_create_microsoft_ad_domain_async_from_dict(): def test_create_microsoft_ad_domain_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1291,7 +1281,7 @@ def test_create_microsoft_ad_domain_field_headers(): @pytest.mark.asyncio async def test_create_microsoft_ad_domain_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1324,7 +1314,7 @@ async def test_create_microsoft_ad_domain_field_headers_async(): def test_create_microsoft_ad_domain_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1358,7 +1348,7 @@ def test_create_microsoft_ad_domain_flattened(): def test_create_microsoft_ad_domain_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1375,7 +1365,7 @@ def test_create_microsoft_ad_domain_flattened_error(): @pytest.mark.asyncio async def test_create_microsoft_ad_domain_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1414,7 +1404,7 @@ async def test_create_microsoft_ad_domain_flattened_async(): @pytest.mark.asyncio async def test_create_microsoft_ad_domain_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1437,7 +1427,7 @@ async def test_create_microsoft_ad_domain_flattened_error_async(): ) def test_reset_admin_password(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1469,7 +1459,7 @@ def test_reset_admin_password_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1489,7 +1479,7 @@ async def test_reset_admin_password_async( request_type=managed_identities_service.ResetAdminPasswordRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1526,7 +1516,7 @@ async def test_reset_admin_password_async_from_dict(): def test_reset_admin_password_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1558,7 +1548,7 @@ def test_reset_admin_password_field_headers(): @pytest.mark.asyncio async def test_reset_admin_password_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1591,7 +1581,7 @@ async def test_reset_admin_password_field_headers_async(): def test_reset_admin_password_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1617,7 +1607,7 @@ def test_reset_admin_password_flattened(): def test_reset_admin_password_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1632,7 +1622,7 @@ def test_reset_admin_password_flattened_error(): @pytest.mark.asyncio async def test_reset_admin_password_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1663,7 +1653,7 @@ async def test_reset_admin_password_flattened_async(): @pytest.mark.asyncio async def test_reset_admin_password_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1684,7 +1674,7 @@ async def test_reset_admin_password_flattened_error_async(): ) def test_list_domains(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1716,7 +1706,7 @@ def test_list_domains_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1734,7 +1724,7 @@ async def test_list_domains_async( request_type=managed_identities_service.ListDomainsRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1771,7 +1761,7 @@ async def test_list_domains_async_from_dict(): def test_list_domains_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1801,7 +1791,7 @@ def test_list_domains_field_headers(): @pytest.mark.asyncio async def test_list_domains_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1832,7 +1822,7 @@ async def test_list_domains_field_headers_async(): def test_list_domains_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1856,7 +1846,7 @@ def test_list_domains_flattened(): def test_list_domains_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1871,7 +1861,7 @@ def test_list_domains_flattened_error(): @pytest.mark.asyncio async def test_list_domains_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1900,7 +1890,7 @@ async def test_list_domains_flattened_async(): @pytest.mark.asyncio async def test_list_domains_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1914,7 +1904,7 @@ async def test_list_domains_flattened_error_async(): def test_list_domains_pager(transport_name: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1964,7 +1954,7 @@ def test_list_domains_pager(transport_name: str = "grpc"): def test_list_domains_pages(transport_name: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2006,7 +1996,7 @@ def test_list_domains_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_domains_async_pager(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2056,7 +2046,7 @@ async def test_list_domains_async_pager(): @pytest.mark.asyncio async def test_list_domains_async_pages(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2111,7 +2101,7 @@ async def test_list_domains_async_pages(): ) def test_get_domain(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2155,7 +2145,7 @@ def test_get_domain_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2173,7 +2163,7 @@ async def test_get_domain_async( request_type=managed_identities_service.GetDomainRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2222,7 +2212,7 @@ async def test_get_domain_async_from_dict(): def test_get_domain_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2252,7 +2242,7 @@ def test_get_domain_field_headers(): @pytest.mark.asyncio async def test_get_domain_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2281,7 +2271,7 @@ async def test_get_domain_field_headers_async(): def test_get_domain_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2305,7 +2295,7 @@ def test_get_domain_flattened(): def test_get_domain_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2320,7 +2310,7 @@ def test_get_domain_flattened_error(): @pytest.mark.asyncio async def test_get_domain_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2347,7 +2337,7 @@ async def test_get_domain_flattened_async(): @pytest.mark.asyncio async def test_get_domain_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2368,7 +2358,7 @@ async def test_get_domain_flattened_error_async(): ) def test_update_domain(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2395,7 +2385,7 @@ def test_update_domain_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2413,7 +2403,7 @@ async def test_update_domain_async( request_type=managed_identities_service.UpdateDomainRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2445,7 +2435,7 @@ async def test_update_domain_async_from_dict(): def test_update_domain_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2475,7 +2465,7 @@ def test_update_domain_field_headers(): @pytest.mark.asyncio async def test_update_domain_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2506,7 +2496,7 @@ async def test_update_domain_field_headers_async(): def test_update_domain_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2534,7 +2524,7 @@ def test_update_domain_flattened(): def test_update_domain_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2550,7 +2540,7 @@ def test_update_domain_flattened_error(): @pytest.mark.asyncio async def test_update_domain_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2583,7 +2573,7 @@ async def test_update_domain_flattened_async(): @pytest.mark.asyncio async def test_update_domain_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2605,7 +2595,7 @@ async def test_update_domain_flattened_error_async(): ) def test_delete_domain(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2632,7 +2622,7 @@ def test_delete_domain_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2650,7 +2640,7 @@ async def test_delete_domain_async( request_type=managed_identities_service.DeleteDomainRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2682,7 +2672,7 @@ async def test_delete_domain_async_from_dict(): def test_delete_domain_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2712,7 +2702,7 @@ def test_delete_domain_field_headers(): @pytest.mark.asyncio async def test_delete_domain_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2743,7 +2733,7 @@ async def test_delete_domain_field_headers_async(): def test_delete_domain_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2767,7 +2757,7 @@ def test_delete_domain_flattened(): def test_delete_domain_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2782,7 +2772,7 @@ def test_delete_domain_flattened_error(): @pytest.mark.asyncio async def test_delete_domain_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2811,7 +2801,7 @@ async def test_delete_domain_flattened_async(): @pytest.mark.asyncio async def test_delete_domain_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2832,7 +2822,7 @@ async def test_delete_domain_flattened_error_async(): ) def test_attach_trust(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2859,7 +2849,7 @@ def test_attach_trust_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2877,7 +2867,7 @@ async def test_attach_trust_async( request_type=managed_identities_service.AttachTrustRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2909,7 +2899,7 @@ async def test_attach_trust_async_from_dict(): def test_attach_trust_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2939,7 +2929,7 @@ def test_attach_trust_field_headers(): @pytest.mark.asyncio async def test_attach_trust_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2970,7 +2960,7 @@ async def test_attach_trust_field_headers_async(): def test_attach_trust_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2998,7 +2988,7 @@ def test_attach_trust_flattened(): def test_attach_trust_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3014,7 +3004,7 @@ def test_attach_trust_flattened_error(): @pytest.mark.asyncio async def test_attach_trust_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3047,7 +3037,7 @@ async def test_attach_trust_flattened_async(): @pytest.mark.asyncio async def test_attach_trust_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3069,7 +3059,7 @@ async def test_attach_trust_flattened_error_async(): ) def test_reconfigure_trust(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3098,7 +3088,7 @@ def test_reconfigure_trust_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3118,7 +3108,7 @@ async def test_reconfigure_trust_async( request_type=managed_identities_service.ReconfigureTrustRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3152,7 +3142,7 @@ async def test_reconfigure_trust_async_from_dict(): def test_reconfigure_trust_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3184,7 +3174,7 @@ def test_reconfigure_trust_field_headers(): @pytest.mark.asyncio async def test_reconfigure_trust_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3217,7 +3207,7 @@ async def test_reconfigure_trust_field_headers_async(): def test_reconfigure_trust_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3251,7 +3241,7 @@ def test_reconfigure_trust_flattened(): def test_reconfigure_trust_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3268,7 +3258,7 @@ def test_reconfigure_trust_flattened_error(): @pytest.mark.asyncio async def test_reconfigure_trust_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3307,7 +3297,7 @@ async def test_reconfigure_trust_flattened_async(): @pytest.mark.asyncio async def test_reconfigure_trust_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3330,7 +3320,7 @@ async def test_reconfigure_trust_flattened_error_async(): ) def test_detach_trust(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3357,7 +3347,7 @@ def test_detach_trust_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3375,7 +3365,7 @@ async def test_detach_trust_async( request_type=managed_identities_service.DetachTrustRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3407,7 +3397,7 @@ async def test_detach_trust_async_from_dict(): def test_detach_trust_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3437,7 +3427,7 @@ def test_detach_trust_field_headers(): @pytest.mark.asyncio async def test_detach_trust_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3468,7 +3458,7 @@ async def test_detach_trust_field_headers_async(): def test_detach_trust_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3496,7 +3486,7 @@ def test_detach_trust_flattened(): def test_detach_trust_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3512,7 +3502,7 @@ def test_detach_trust_flattened_error(): @pytest.mark.asyncio async def test_detach_trust_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3545,7 +3535,7 @@ async def test_detach_trust_flattened_async(): @pytest.mark.asyncio async def test_detach_trust_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3567,7 +3557,7 @@ async def test_detach_trust_flattened_error_async(): ) def test_validate_trust(request_type, transport: str = "grpc"): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3594,7 +3584,7 @@ def test_validate_trust_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3612,7 +3602,7 @@ async def test_validate_trust_async( request_type=managed_identities_service.ValidateTrustRequest, ): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3644,7 +3634,7 @@ async def test_validate_trust_async_from_dict(): def test_validate_trust_field_headers(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3674,7 +3664,7 @@ def test_validate_trust_field_headers(): @pytest.mark.asyncio async def test_validate_trust_field_headers_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3705,7 +3695,7 @@ async def test_validate_trust_field_headers_async(): def test_validate_trust_flattened(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3733,7 +3723,7 @@ def test_validate_trust_flattened(): def test_validate_trust_flattened_error(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3749,7 +3739,7 @@ def test_validate_trust_flattened_error(): @pytest.mark.asyncio async def test_validate_trust_flattened_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3782,7 +3772,7 @@ async def test_validate_trust_flattened_async(): @pytest.mark.asyncio async def test_validate_trust_flattened_error_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3798,17 +3788,17 @@ async def test_validate_trust_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ManagedIdentitiesServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.ManagedIdentitiesServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = ManagedIdentitiesServiceClient( @@ -3818,7 +3808,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.ManagedIdentitiesServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3833,13 +3823,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = ManagedIdentitiesServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.ManagedIdentitiesServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = ManagedIdentitiesServiceClient( @@ -3851,7 +3840,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.ManagedIdentitiesServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = ManagedIdentitiesServiceClient(transport=transport) assert client.transport is transport @@ -3860,13 +3849,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.ManagedIdentitiesServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.ManagedIdentitiesServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3882,7 +3871,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3895,7 +3884,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = ManagedIdentitiesServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3903,7 +3892,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3915,7 +3904,7 @@ def test_managed_identities_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.ManagedIdentitiesServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3927,7 +3916,7 @@ def test_managed_identities_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.ManagedIdentitiesServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3973,7 +3962,7 @@ def test_managed_identities_service_base_transport_with_credentials_file(): "google.cloud.managedidentities_v1.services.managed_identities_service.transports.ManagedIdentitiesServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ManagedIdentitiesServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3992,7 +3981,7 @@ def test_managed_identities_service_base_transport_with_adc(): "google.cloud.managedidentities_v1.services.managed_identities_service.transports.ManagedIdentitiesServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ManagedIdentitiesServiceTransport() adc.assert_called_once() @@ -4000,7 +3989,7 @@ def test_managed_identities_service_base_transport_with_adc(): def test_managed_identities_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) ManagedIdentitiesServiceClient() adc.assert_called_once_with( scopes=None, @@ -4020,7 +4009,7 @@ def test_managed_identities_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4068,7 +4057,7 @@ def test_managed_identities_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4098,7 +4087,7 @@ def test_managed_identities_service_transport_create_channel( def test_managed_identities_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4144,7 +4133,7 @@ def test_managed_identities_service_grpc_transport_client_cert_source_for_mtls( ) def test_managed_identities_service_host_no_port(transport_name): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="managedidentities.googleapis.com" ), @@ -4162,7 +4151,7 @@ def test_managed_identities_service_host_no_port(transport_name): ) def test_managed_identities_service_host_with_port(transport_name): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="managedidentities.googleapis.com:8000" ), @@ -4221,7 +4210,7 @@ def test_managed_identities_service_transport_channel_mtls_with_client_cert_sour mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4299,7 +4288,7 @@ def test_managed_identities_service_transport_channel_mtls_with_adc(transport_cl def test_managed_identities_service_grpc_lro_client(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -4316,7 +4305,7 @@ def test_managed_identities_service_grpc_lro_client(): def test_managed_identities_service_grpc_lro_async_client(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -4467,7 +4456,7 @@ def test_client_with_default_client_info(): transports.ManagedIdentitiesServiceTransport, "_prep_wrapped_messages" ) as prep: client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4477,7 +4466,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = ManagedIdentitiesServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4486,7 +4475,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = ManagedIdentitiesServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4504,7 +4493,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4520,7 +4509,7 @@ def test_client_ctx(): ] for transport in transports: client = ManagedIdentitiesServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-media-translation/google/cloud/mediatranslation/gapic_version.py b/packages/google-cloud-media-translation/google/cloud/mediatranslation/gapic_version.py index 76197bc2c0db..360a0d13ebdd 100644 --- a/packages/google-cloud-media-translation/google/cloud/mediatranslation/gapic_version.py +++ b/packages/google-cloud-media-translation/google/cloud/mediatranslation/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.11.6" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/gapic_version.py b/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/gapic_version.py index 76197bc2c0db..360a0d13ebdd 100644 --- a/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/gapic_version.py +++ b/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.11.6" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/services/speech_translation_service/client.py b/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/services/speech_translation_service/client.py index c263f9f1a141..96a6296c19af 100644 --- a/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/services/speech_translation_service/client.py +++ b/packages/google-cloud-media-translation/google/cloud/mediatranslation_v1beta1/services/speech_translation_service/client.py @@ -361,6 +361,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -379,6 +380,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -455,17 +457,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = SpeechTranslationServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = SpeechTranslationServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-media-translation/samples/generated_samples/snippet_metadata_google.cloud.mediatranslation.v1beta1.json b/packages/google-cloud-media-translation/samples/generated_samples/snippet_metadata_google.cloud.mediatranslation.v1beta1.json index 43b5677dc520..53086cedf83d 100644 --- a/packages/google-cloud-media-translation/samples/generated_samples/snippet_metadata_google.cloud.mediatranslation.v1beta1.json +++ b/packages/google-cloud-media-translation/samples/generated_samples/snippet_metadata_google.cloud.mediatranslation.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-media-translation", - "version": "0.11.6" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-media-translation/setup.py b/packages/google-cloud-media-translation/setup.py index e799fe1d5b51..d05aa52bee90 100644 --- a/packages/google-cloud-media-translation/setup.py +++ b/packages/google-cloud-media-translation/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-media-translation/testing/constraints-3.7.txt b/packages/google-cloud-media-translation/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-media-translation/testing/constraints-3.7.txt +++ b/packages/google-cloud-media-translation/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-media-translation/tests/unit/gapic/mediatranslation_v1beta1/test_speech_translation_service.py b/packages/google-cloud-media-translation/tests/unit/gapic/mediatranslation_v1beta1/test_speech_translation_service.py index 59dbfc367fe6..efa0c07a7786 100644 --- a/packages/google-cloud-media-translation/tests/unit/gapic/mediatranslation_v1beta1/test_speech_translation_service.py +++ b/packages/google-cloud-media-translation/tests/unit/gapic/mediatranslation_v1beta1/test_speech_translation_service.py @@ -72,18 +72,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -330,7 +318,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -357,42 +345,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -404,7 +399,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_speech_translation_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -452,7 +447,7 @@ def test_speech_translation_service_client_service_account_always_use_jwt( def test_speech_translation_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -515,9 +510,7 @@ def test_speech_translation_service_client_client_options( with mock.patch.object( SpeechTranslationServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -930,20 +923,20 @@ def test_speech_translation_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -955,13 +948,11 @@ def test_speech_translation_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -977,8 +968,7 @@ def test_speech_translation_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1133,8 +1123,8 @@ def test_speech_translation_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1163,7 +1153,7 @@ def test_speech_translation_service_client_create_channel_credentials_file( ) def test_streaming_translate_speech(request_type, transport: str = "grpc"): client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1196,7 +1186,7 @@ async def test_streaming_translate_speech_async( request_type=media_translation.StreamingTranslateSpeechRequest, ): client = SpeechTranslationServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1234,17 +1224,17 @@ async def test_streaming_translate_speech_async_from_dict(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.SpeechTranslationServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.SpeechTranslationServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = SpeechTranslationServiceClient( @@ -1254,7 +1244,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.SpeechTranslationServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -1269,13 +1259,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = SpeechTranslationServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.SpeechTranslationServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = SpeechTranslationServiceClient( @@ -1287,7 +1276,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.SpeechTranslationServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = SpeechTranslationServiceClient(transport=transport) assert client.transport is transport @@ -1296,13 +1285,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.SpeechTranslationServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.SpeechTranslationServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -1318,7 +1307,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -1331,7 +1320,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = SpeechTranslationServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -1339,7 +1328,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -1351,7 +1340,7 @@ def test_speech_translation_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.SpeechTranslationServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -1363,7 +1352,7 @@ def test_speech_translation_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.SpeechTranslationServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -1393,7 +1382,7 @@ def test_speech_translation_service_base_transport_with_credentials_file(): "google.cloud.mediatranslation_v1beta1.services.speech_translation_service.transports.SpeechTranslationServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.SpeechTranslationServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -1412,7 +1401,7 @@ def test_speech_translation_service_base_transport_with_adc(): "google.cloud.mediatranslation_v1beta1.services.speech_translation_service.transports.SpeechTranslationServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.SpeechTranslationServiceTransport() adc.assert_called_once() @@ -1420,7 +1409,7 @@ def test_speech_translation_service_base_transport_with_adc(): def test_speech_translation_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) SpeechTranslationServiceClient() adc.assert_called_once_with( scopes=None, @@ -1440,7 +1429,7 @@ def test_speech_translation_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -1488,7 +1477,7 @@ def test_speech_translation_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -1518,7 +1507,7 @@ def test_speech_translation_service_transport_create_channel( def test_speech_translation_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -1564,7 +1553,7 @@ def test_speech_translation_service_grpc_transport_client_cert_source_for_mtls( ) def test_speech_translation_service_host_no_port(transport_name): client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="mediatranslation.googleapis.com" ), @@ -1582,7 +1571,7 @@ def test_speech_translation_service_host_no_port(transport_name): ) def test_speech_translation_service_host_with_port(transport_name): client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="mediatranslation.googleapis.com:8000" ), @@ -1641,7 +1630,7 @@ def test_speech_translation_service_transport_channel_mtls_with_client_cert_sour mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -1827,7 +1816,7 @@ def test_client_with_default_client_info(): transports.SpeechTranslationServiceTransport, "_prep_wrapped_messages" ) as prep: client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1837,7 +1826,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = SpeechTranslationServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -1846,7 +1835,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = SpeechTranslationServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -1864,7 +1853,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -1880,7 +1869,7 @@ def test_client_ctx(): ] for transport in transports: client = SpeechTranslationServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-memcache/google/cloud/memcache/gapic_version.py b/packages/google-cloud-memcache/google/cloud/memcache/gapic_version.py index b7ebf472ead3..360a0d13ebdd 100644 --- a/packages/google-cloud-memcache/google/cloud/memcache/gapic_version.py +++ b/packages/google-cloud-memcache/google/cloud/memcache/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.9.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-memcache/google/cloud/memcache_v1/gapic_version.py b/packages/google-cloud-memcache/google/cloud/memcache_v1/gapic_version.py index b7ebf472ead3..360a0d13ebdd 100644 --- a/packages/google-cloud-memcache/google/cloud/memcache_v1/gapic_version.py +++ b/packages/google-cloud-memcache/google/cloud/memcache_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.9.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-memcache/google/cloud/memcache_v1/services/cloud_memcache/client.py b/packages/google-cloud-memcache/google/cloud/memcache_v1/services/cloud_memcache/client.py index 11d0177ab394..e8dde75a54ed 100644 --- a/packages/google-cloud-memcache/google/cloud/memcache_v1/services/cloud_memcache/client.py +++ b/packages/google-cloud-memcache/google/cloud/memcache_v1/services/cloud_memcache/client.py @@ -407,6 +407,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -425,6 +426,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -499,17 +501,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = CloudMemcacheClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = CloudMemcacheClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/gapic_version.py b/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/gapic_version.py index b7ebf472ead3..360a0d13ebdd 100644 --- a/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/gapic_version.py +++ b/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.9.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/services/cloud_memcache/client.py b/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/services/cloud_memcache/client.py index 74c6c4ffe1c4..d6049d7cc155 100644 --- a/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/services/cloud_memcache/client.py +++ b/packages/google-cloud-memcache/google/cloud/memcache_v1beta2/services/cloud_memcache/client.py @@ -407,6 +407,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -425,6 +426,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -499,17 +501,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = CloudMemcacheClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = CloudMemcacheClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1.json index 862f17d63227..4fbe6f0f3a20 100644 --- a/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-memcache", - "version": "1.9.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1beta2.json index cd257f5e5c64..a19a59a135cf 100644 --- a/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated_samples/snippet_metadata_google.cloud.memcache.v1beta2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-memcache", - "version": "1.9.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-memcache/setup.py b/packages/google-cloud-memcache/setup.py index 8a879756b46d..6887fb18d1e5 100644 --- a/packages/google-cloud-memcache/setup.py +++ b/packages/google-cloud-memcache/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-memcache/testing/constraints-3.7.txt b/packages/google-cloud-memcache/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-memcache/testing/constraints-3.7.txt +++ b/packages/google-cloud-memcache/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1/test_cloud_memcache.py b/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1/test_cloud_memcache.py index c9cde822e6a2..3a46aa6552f8 100644 --- a/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1/test_cloud_memcache.py +++ b/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1/test_cloud_memcache.py @@ -94,18 +94,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -328,7 +316,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -355,42 +343,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -401,7 +396,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_cloud_memcache_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -453,7 +448,7 @@ def test_cloud_memcache_client_service_account_always_use_jwt( ], ) def test_cloud_memcache_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -516,9 +511,7 @@ def test_cloud_memcache_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(CloudMemcacheClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -917,20 +910,20 @@ def test_cloud_memcache_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -942,13 +935,11 @@ def test_cloud_memcache_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -964,8 +955,7 @@ def test_cloud_memcache_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1118,8 +1108,8 @@ def test_cloud_memcache_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1148,7 +1138,7 @@ def test_cloud_memcache_client_create_channel_credentials_file( ) def test_list_instances(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1180,7 +1170,7 @@ def test_list_instances_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1197,7 +1187,7 @@ async def test_list_instances_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.ListInstancesRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1234,7 +1224,7 @@ async def test_list_instances_async_from_dict(): def test_list_instances_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1264,7 +1254,7 @@ def test_list_instances_field_headers(): @pytest.mark.asyncio async def test_list_instances_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1295,7 +1285,7 @@ async def test_list_instances_field_headers_async(): def test_list_instances_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1319,7 +1309,7 @@ def test_list_instances_flattened(): def test_list_instances_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1334,7 +1324,7 @@ def test_list_instances_flattened_error(): @pytest.mark.asyncio async def test_list_instances_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1363,7 +1353,7 @@ async def test_list_instances_flattened_async(): @pytest.mark.asyncio async def test_list_instances_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1377,7 +1367,7 @@ async def test_list_instances_flattened_error_async(): def test_list_instances_pager(transport_name: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1427,7 +1417,7 @@ def test_list_instances_pager(transport_name: str = "grpc"): def test_list_instances_pages(transport_name: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1469,7 +1459,7 @@ def test_list_instances_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_instances_async_pager(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1519,7 +1509,7 @@ async def test_list_instances_async_pager(): @pytest.mark.asyncio async def test_list_instances_async_pages(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1574,7 +1564,7 @@ async def test_list_instances_async_pages(): ) def test_get_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1620,7 +1610,7 @@ def test_get_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1637,7 +1627,7 @@ async def test_get_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.GetInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1688,7 +1678,7 @@ async def test_get_instance_async_from_dict(): def test_get_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1718,7 +1708,7 @@ def test_get_instance_field_headers(): @pytest.mark.asyncio async def test_get_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1749,7 +1739,7 @@ async def test_get_instance_field_headers_async(): def test_get_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1773,7 +1763,7 @@ def test_get_instance_flattened(): def test_get_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1788,7 +1778,7 @@ def test_get_instance_flattened_error(): @pytest.mark.asyncio async def test_get_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1817,7 +1807,7 @@ async def test_get_instance_flattened_async(): @pytest.mark.asyncio async def test_get_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1838,7 +1828,7 @@ async def test_get_instance_flattened_error_async(): ) def test_create_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1865,7 +1855,7 @@ def test_create_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1882,7 +1872,7 @@ async def test_create_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.CreateInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1914,7 +1904,7 @@ async def test_create_instance_async_from_dict(): def test_create_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1944,7 +1934,7 @@ def test_create_instance_field_headers(): @pytest.mark.asyncio async def test_create_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1975,7 +1965,7 @@ async def test_create_instance_field_headers_async(): def test_create_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2007,7 +1997,7 @@ def test_create_instance_flattened(): def test_create_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2024,7 +2014,7 @@ def test_create_instance_flattened_error(): @pytest.mark.asyncio async def test_create_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2061,7 +2051,7 @@ async def test_create_instance_flattened_async(): @pytest.mark.asyncio async def test_create_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2084,7 +2074,7 @@ async def test_create_instance_flattened_error_async(): ) def test_update_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2111,7 +2101,7 @@ def test_update_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2128,7 +2118,7 @@ async def test_update_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.UpdateInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2160,7 +2150,7 @@ async def test_update_instance_async_from_dict(): def test_update_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2190,7 +2180,7 @@ def test_update_instance_field_headers(): @pytest.mark.asyncio async def test_update_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2221,7 +2211,7 @@ async def test_update_instance_field_headers_async(): def test_update_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2249,7 +2239,7 @@ def test_update_instance_flattened(): def test_update_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2265,7 +2255,7 @@ def test_update_instance_flattened_error(): @pytest.mark.asyncio async def test_update_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2298,7 +2288,7 @@ async def test_update_instance_flattened_async(): @pytest.mark.asyncio async def test_update_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2320,7 +2310,7 @@ async def test_update_instance_flattened_error_async(): ) def test_update_parameters(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2349,7 +2339,7 @@ def test_update_parameters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2368,7 +2358,7 @@ async def test_update_parameters_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.UpdateParametersRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2402,7 +2392,7 @@ async def test_update_parameters_async_from_dict(): def test_update_parameters_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2434,7 +2424,7 @@ def test_update_parameters_field_headers(): @pytest.mark.asyncio async def test_update_parameters_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2467,7 +2457,7 @@ async def test_update_parameters_field_headers_async(): def test_update_parameters_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2501,7 +2491,7 @@ def test_update_parameters_flattened(): def test_update_parameters_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2518,7 +2508,7 @@ def test_update_parameters_flattened_error(): @pytest.mark.asyncio async def test_update_parameters_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2557,7 +2547,7 @@ async def test_update_parameters_flattened_async(): @pytest.mark.asyncio async def test_update_parameters_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2580,7 +2570,7 @@ async def test_update_parameters_flattened_error_async(): ) def test_delete_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2607,7 +2597,7 @@ def test_delete_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2624,7 +2614,7 @@ async def test_delete_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.DeleteInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2656,7 +2646,7 @@ async def test_delete_instance_async_from_dict(): def test_delete_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2686,7 +2676,7 @@ def test_delete_instance_field_headers(): @pytest.mark.asyncio async def test_delete_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2717,7 +2707,7 @@ async def test_delete_instance_field_headers_async(): def test_delete_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2741,7 +2731,7 @@ def test_delete_instance_flattened(): def test_delete_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2756,7 +2746,7 @@ def test_delete_instance_flattened_error(): @pytest.mark.asyncio async def test_delete_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2785,7 +2775,7 @@ async def test_delete_instance_flattened_async(): @pytest.mark.asyncio async def test_delete_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2806,7 +2796,7 @@ async def test_delete_instance_flattened_error_async(): ) def test_apply_parameters(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2833,7 +2823,7 @@ def test_apply_parameters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2850,7 +2840,7 @@ async def test_apply_parameters_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.ApplyParametersRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2882,7 +2872,7 @@ async def test_apply_parameters_async_from_dict(): def test_apply_parameters_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2912,7 +2902,7 @@ def test_apply_parameters_field_headers(): @pytest.mark.asyncio async def test_apply_parameters_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2943,7 +2933,7 @@ async def test_apply_parameters_field_headers_async(): def test_apply_parameters_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2975,7 +2965,7 @@ def test_apply_parameters_flattened(): def test_apply_parameters_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2992,7 +2982,7 @@ def test_apply_parameters_flattened_error(): @pytest.mark.asyncio async def test_apply_parameters_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3029,7 +3019,7 @@ async def test_apply_parameters_flattened_async(): @pytest.mark.asyncio async def test_apply_parameters_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3052,7 +3042,7 @@ async def test_apply_parameters_flattened_error_async(): ) def test_reschedule_maintenance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3081,7 +3071,7 @@ def test_reschedule_maintenance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3101,7 +3091,7 @@ async def test_reschedule_maintenance_async( request_type=cloud_memcache.RescheduleMaintenanceRequest, ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3135,7 +3125,7 @@ async def test_reschedule_maintenance_async_from_dict(): def test_reschedule_maintenance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3167,7 +3157,7 @@ def test_reschedule_maintenance_field_headers(): @pytest.mark.asyncio async def test_reschedule_maintenance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3200,7 +3190,7 @@ async def test_reschedule_maintenance_field_headers_async(): def test_reschedule_maintenance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3234,7 +3224,7 @@ def test_reschedule_maintenance_flattened(): def test_reschedule_maintenance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3251,7 +3241,7 @@ def test_reschedule_maintenance_flattened_error(): @pytest.mark.asyncio async def test_reschedule_maintenance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3290,7 +3280,7 @@ async def test_reschedule_maintenance_flattened_async(): @pytest.mark.asyncio async def test_reschedule_maintenance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3313,7 +3303,7 @@ async def test_reschedule_maintenance_flattened_error_async(): ) def test_list_instances_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3366,7 +3356,7 @@ def test_list_instances_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_instances._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3375,7 +3365,7 @@ def test_list_instances_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_instances._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -3393,7 +3383,7 @@ def test_list_instances_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3435,7 +3425,7 @@ def test_list_instances_rest_required_fields( def test_list_instances_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_instances._get_unset_required_fields({}) @@ -3455,7 +3445,7 @@ def test_list_instances_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_instances_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -3513,7 +3503,7 @@ def test_list_instances_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.ListInstancesRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3535,7 +3525,7 @@ def test_list_instances_rest_bad_request( def test_list_instances_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3576,7 +3566,7 @@ def test_list_instances_rest_flattened(): def test_list_instances_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3591,7 +3581,7 @@ def test_list_instances_rest_flattened_error(transport: str = "rest"): def test_list_instances_rest_pager(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3661,7 +3651,7 @@ def test_list_instances_rest_pager(transport: str = "rest"): ) def test_get_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3728,7 +3718,7 @@ def test_get_instance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3737,7 +3727,7 @@ def test_get_instance_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3746,7 +3736,7 @@ def test_get_instance_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3788,7 +3778,7 @@ def test_get_instance_rest_required_fields( def test_get_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_instance._get_unset_required_fields({}) @@ -3798,7 +3788,7 @@ def test_get_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -3856,7 +3846,7 @@ def test_get_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.GetInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3878,7 +3868,7 @@ def test_get_instance_rest_bad_request( def test_get_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3921,7 +3911,7 @@ def test_get_instance_rest_flattened(): def test_get_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3936,7 +3926,7 @@ def test_get_instance_rest_flattened_error(transport: str = "rest"): def test_get_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3949,7 +3939,7 @@ def test_get_instance_rest_error(): ) def test_create_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4113,7 +4103,7 @@ def test_create_instance_rest_required_fields( assert "instanceId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4125,7 +4115,7 @@ def test_create_instance_rest_required_fields( jsonified_request["instanceId"] = "instance_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_instance._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("instance_id",)) @@ -4138,7 +4128,7 @@ def test_create_instance_rest_required_fields( assert jsonified_request["instanceId"] == "instance_id_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4184,7 +4174,7 @@ def test_create_instance_rest_required_fields( def test_create_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_instance._get_unset_required_fields({}) @@ -4203,7 +4193,7 @@ def test_create_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -4263,7 +4253,7 @@ def test_create_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.CreateInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4285,7 +4275,7 @@ def test_create_instance_rest_bad_request( def test_create_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4326,7 +4316,7 @@ def test_create_instance_rest_flattened(): def test_create_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4343,7 +4333,7 @@ def test_create_instance_rest_flattened_error(transport: str = "rest"): def test_create_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4356,7 +4346,7 @@ def test_create_instance_rest_error(): ) def test_update_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4519,14 +4509,14 @@ def test_update_instance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_instance._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -4535,7 +4525,7 @@ def test_update_instance_rest_required_fields( # verify required fields with non-default values are left alone client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4575,7 +4565,7 @@ def test_update_instance_rest_required_fields( def test_update_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_instance._get_unset_required_fields({}) @@ -4593,7 +4583,7 @@ def test_update_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -4653,7 +4643,7 @@ def test_update_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.UpdateInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4677,7 +4667,7 @@ def test_update_instance_rest_bad_request( def test_update_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4720,7 +4710,7 @@ def test_update_instance_rest_flattened(): def test_update_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4736,7 +4726,7 @@ def test_update_instance_rest_flattened_error(transport: str = "rest"): def test_update_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4749,7 +4739,7 @@ def test_update_instance_rest_error(): ) def test_update_parameters_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4795,7 +4785,7 @@ def test_update_parameters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4804,7 +4794,7 @@ def test_update_parameters_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4813,7 +4803,7 @@ def test_update_parameters_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4853,7 +4843,7 @@ def test_update_parameters_rest_required_fields( def test_update_parameters_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_parameters._get_unset_required_fields({}) @@ -4871,7 +4861,7 @@ def test_update_parameters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_parameters_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -4931,7 +4921,7 @@ def test_update_parameters_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.UpdateParametersRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4953,7 +4943,7 @@ def test_update_parameters_rest_bad_request( def test_update_parameters_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4997,7 +4987,7 @@ def test_update_parameters_rest_flattened(): def test_update_parameters_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5014,7 +5004,7 @@ def test_update_parameters_rest_flattened_error(transport: str = "rest"): def test_update_parameters_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5027,7 +5017,7 @@ def test_update_parameters_rest_error(): ) def test_delete_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5073,7 +5063,7 @@ def test_delete_instance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5082,7 +5072,7 @@ def test_delete_instance_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5091,7 +5081,7 @@ def test_delete_instance_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5130,7 +5120,7 @@ def test_delete_instance_rest_required_fields( def test_delete_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_instance._get_unset_required_fields({}) @@ -5140,7 +5130,7 @@ def test_delete_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -5200,7 +5190,7 @@ def test_delete_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.DeleteInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5222,7 +5212,7 @@ def test_delete_instance_rest_bad_request( def test_delete_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5263,7 +5253,7 @@ def test_delete_instance_rest_flattened(): def test_delete_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5278,7 +5268,7 @@ def test_delete_instance_rest_flattened_error(transport: str = "rest"): def test_delete_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5291,7 +5281,7 @@ def test_delete_instance_rest_error(): ) def test_apply_parameters_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5337,7 +5327,7 @@ def test_apply_parameters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).apply_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5346,7 +5336,7 @@ def test_apply_parameters_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).apply_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5355,7 +5345,7 @@ def test_apply_parameters_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5395,7 +5385,7 @@ def test_apply_parameters_rest_required_fields( def test_apply_parameters_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.apply_parameters._get_unset_required_fields({}) @@ -5405,7 +5395,7 @@ def test_apply_parameters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_apply_parameters_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -5465,7 +5455,7 @@ def test_apply_parameters_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.ApplyParametersRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5487,7 +5477,7 @@ def test_apply_parameters_rest_bad_request( def test_apply_parameters_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5531,7 +5521,7 @@ def test_apply_parameters_rest_flattened(): def test_apply_parameters_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5548,7 +5538,7 @@ def test_apply_parameters_rest_flattened_error(transport: str = "rest"): def test_apply_parameters_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5561,7 +5551,7 @@ def test_apply_parameters_rest_error(): ) def test_reschedule_maintenance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5607,7 +5597,7 @@ def test_reschedule_maintenance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reschedule_maintenance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5616,7 +5606,7 @@ def test_reschedule_maintenance_rest_required_fields( jsonified_request["instance"] = "instance_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reschedule_maintenance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5625,7 +5615,7 @@ def test_reschedule_maintenance_rest_required_fields( assert jsonified_request["instance"] == "instance_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5665,7 +5655,7 @@ def test_reschedule_maintenance_rest_required_fields( def test_reschedule_maintenance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.reschedule_maintenance._get_unset_required_fields({}) @@ -5683,7 +5673,7 @@ def test_reschedule_maintenance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_reschedule_maintenance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -5743,7 +5733,7 @@ def test_reschedule_maintenance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.RescheduleMaintenanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5765,7 +5755,7 @@ def test_reschedule_maintenance_rest_bad_request( def test_reschedule_maintenance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5809,7 +5799,7 @@ def test_reschedule_maintenance_rest_flattened(): def test_reschedule_maintenance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5826,24 +5816,24 @@ def test_reschedule_maintenance_rest_flattened_error(transport: str = "rest"): def test_reschedule_maintenance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudMemcacheClient( @@ -5853,7 +5843,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -5868,13 +5858,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = CloudMemcacheClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudMemcacheClient( @@ -5886,7 +5875,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = CloudMemcacheClient(transport=transport) assert client.transport is transport @@ -5895,13 +5884,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.CloudMemcacheGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -5918,7 +5907,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -5932,7 +5921,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = CloudMemcacheClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -5940,7 +5929,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -5952,7 +5941,7 @@ def test_cloud_memcache_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.CloudMemcacheTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -5964,7 +5953,7 @@ def test_cloud_memcache_base_transport(): ) as Transport: Transport.return_value = None transport = transports.CloudMemcacheTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -6014,7 +6003,7 @@ def test_cloud_memcache_base_transport_with_credentials_file(): "google.cloud.memcache_v1.services.cloud_memcache.transports.CloudMemcacheTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudMemcacheTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -6033,7 +6022,7 @@ def test_cloud_memcache_base_transport_with_adc(): "google.cloud.memcache_v1.services.cloud_memcache.transports.CloudMemcacheTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudMemcacheTransport() adc.assert_called_once() @@ -6041,7 +6030,7 @@ def test_cloud_memcache_base_transport_with_adc(): def test_cloud_memcache_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) CloudMemcacheClient() adc.assert_called_once_with( scopes=None, @@ -6061,7 +6050,7 @@ def test_cloud_memcache_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -6108,7 +6097,7 @@ def test_cloud_memcache_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -6136,7 +6125,7 @@ def test_cloud_memcache_transport_create_channel(transport_class, grpc_helpers): ], ) def test_cloud_memcache_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -6174,7 +6163,7 @@ def test_cloud_memcache_grpc_transport_client_cert_source_for_mtls(transport_cla def test_cloud_memcache_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -6186,7 +6175,7 @@ def test_cloud_memcache_http_transport_client_cert_source_for_mtls(): def test_cloud_memcache_rest_lro_client(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -6211,7 +6200,7 @@ def test_cloud_memcache_rest_lro_client(): ) def test_cloud_memcache_host_no_port(transport_name): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="memcache.googleapis.com" ), @@ -6234,7 +6223,7 @@ def test_cloud_memcache_host_no_port(transport_name): ) def test_cloud_memcache_host_with_port(transport_name): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="memcache.googleapis.com:8000" ), @@ -6254,8 +6243,8 @@ def test_cloud_memcache_host_with_port(transport_name): ], ) def test_cloud_memcache_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = CloudMemcacheClient( credentials=creds1, transport=transport_name, @@ -6338,7 +6327,7 @@ def test_cloud_memcache_transport_channel_mtls_with_client_cert_source(transport mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -6416,7 +6405,7 @@ def test_cloud_memcache_transport_channel_mtls_with_adc(transport_class): def test_cloud_memcache_grpc_lro_client(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -6433,7 +6422,7 @@ def test_cloud_memcache_grpc_lro_client(): def test_cloud_memcache_grpc_lro_async_client(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -6584,7 +6573,7 @@ def test_client_with_default_client_info(): transports.CloudMemcacheTransport, "_prep_wrapped_messages" ) as prep: client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6594,7 +6583,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CloudMemcacheClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -6603,7 +6592,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -6618,7 +6607,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6648,7 +6637,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -6676,7 +6665,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6704,7 +6693,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -6732,7 +6721,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6762,7 +6751,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -6790,7 +6779,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6820,7 +6809,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -6848,7 +6837,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6878,7 +6867,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -6906,7 +6895,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6936,7 +6925,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -6962,7 +6951,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6987,7 +6976,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7011,7 +7000,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7040,7 +7029,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7067,7 +7056,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7085,7 +7074,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7101,7 +7090,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7126,7 +7115,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7150,7 +7139,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7179,7 +7168,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7206,7 +7195,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7224,7 +7213,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7240,7 +7229,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7265,7 +7254,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7291,7 +7280,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7320,7 +7309,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7349,7 +7338,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -7367,7 +7356,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -7385,7 +7374,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7410,7 +7399,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7436,7 +7425,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7465,7 +7454,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7494,7 +7483,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -7512,7 +7501,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -7530,7 +7519,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7555,7 +7544,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7581,7 +7570,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7610,7 +7599,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7639,7 +7628,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -7657,7 +7646,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -7675,7 +7664,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7700,7 +7689,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7725,7 +7714,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): - client = CloudMemcacheClient(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = CloudMemcacheClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -7752,9 +7741,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): - client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + client = CloudMemcacheAsyncClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -7782,7 +7769,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -7800,7 +7787,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -7824,7 +7811,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -7841,7 +7828,7 @@ def test_client_ctx(): ] for transport in transports: client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1beta2/test_cloud_memcache.py b/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1beta2/test_cloud_memcache.py index d1911de4aa4b..f78a2fcd29db 100644 --- a/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1beta2/test_cloud_memcache.py +++ b/packages/google-cloud-memcache/tests/unit/gapic/memcache_v1beta2/test_cloud_memcache.py @@ -94,18 +94,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -328,7 +316,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -355,42 +343,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -401,7 +396,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_cloud_memcache_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -453,7 +448,7 @@ def test_cloud_memcache_client_service_account_always_use_jwt( ], ) def test_cloud_memcache_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -516,9 +511,7 @@ def test_cloud_memcache_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(CloudMemcacheClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -917,20 +910,20 @@ def test_cloud_memcache_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -942,13 +935,11 @@ def test_cloud_memcache_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -964,8 +955,7 @@ def test_cloud_memcache_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1118,8 +1108,8 @@ def test_cloud_memcache_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1148,7 +1138,7 @@ def test_cloud_memcache_client_create_channel_credentials_file( ) def test_list_instances(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1180,7 +1170,7 @@ def test_list_instances_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1197,7 +1187,7 @@ async def test_list_instances_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.ListInstancesRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1234,7 +1224,7 @@ async def test_list_instances_async_from_dict(): def test_list_instances_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1264,7 +1254,7 @@ def test_list_instances_field_headers(): @pytest.mark.asyncio async def test_list_instances_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1295,7 +1285,7 @@ async def test_list_instances_field_headers_async(): def test_list_instances_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1319,7 +1309,7 @@ def test_list_instances_flattened(): def test_list_instances_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1334,7 +1324,7 @@ def test_list_instances_flattened_error(): @pytest.mark.asyncio async def test_list_instances_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1363,7 +1353,7 @@ async def test_list_instances_flattened_async(): @pytest.mark.asyncio async def test_list_instances_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1377,7 +1367,7 @@ async def test_list_instances_flattened_error_async(): def test_list_instances_pager(transport_name: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1427,7 +1417,7 @@ def test_list_instances_pager(transport_name: str = "grpc"): def test_list_instances_pages(transport_name: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1469,7 +1459,7 @@ def test_list_instances_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_instances_async_pager(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1519,7 +1509,7 @@ async def test_list_instances_async_pager(): @pytest.mark.asyncio async def test_list_instances_async_pages(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1574,7 +1564,7 @@ async def test_list_instances_async_pages(): ) def test_get_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1622,7 +1612,7 @@ def test_get_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1639,7 +1629,7 @@ async def test_get_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.GetInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1692,7 +1682,7 @@ async def test_get_instance_async_from_dict(): def test_get_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1722,7 +1712,7 @@ def test_get_instance_field_headers(): @pytest.mark.asyncio async def test_get_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1753,7 +1743,7 @@ async def test_get_instance_field_headers_async(): def test_get_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1777,7 +1767,7 @@ def test_get_instance_flattened(): def test_get_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1792,7 +1782,7 @@ def test_get_instance_flattened_error(): @pytest.mark.asyncio async def test_get_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1821,7 +1811,7 @@ async def test_get_instance_flattened_async(): @pytest.mark.asyncio async def test_get_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1842,7 +1832,7 @@ async def test_get_instance_flattened_error_async(): ) def test_create_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1869,7 +1859,7 @@ def test_create_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1886,7 +1876,7 @@ async def test_create_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.CreateInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1918,7 +1908,7 @@ async def test_create_instance_async_from_dict(): def test_create_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1948,7 +1938,7 @@ def test_create_instance_field_headers(): @pytest.mark.asyncio async def test_create_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1979,7 +1969,7 @@ async def test_create_instance_field_headers_async(): def test_create_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2011,7 +2001,7 @@ def test_create_instance_flattened(): def test_create_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2028,7 +2018,7 @@ def test_create_instance_flattened_error(): @pytest.mark.asyncio async def test_create_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2065,7 +2055,7 @@ async def test_create_instance_flattened_async(): @pytest.mark.asyncio async def test_create_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2088,7 +2078,7 @@ async def test_create_instance_flattened_error_async(): ) def test_update_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2115,7 +2105,7 @@ def test_update_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2132,7 +2122,7 @@ async def test_update_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.UpdateInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2164,7 +2154,7 @@ async def test_update_instance_async_from_dict(): def test_update_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2194,7 +2184,7 @@ def test_update_instance_field_headers(): @pytest.mark.asyncio async def test_update_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2225,7 +2215,7 @@ async def test_update_instance_field_headers_async(): def test_update_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2253,7 +2243,7 @@ def test_update_instance_flattened(): def test_update_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2269,7 +2259,7 @@ def test_update_instance_flattened_error(): @pytest.mark.asyncio async def test_update_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2302,7 +2292,7 @@ async def test_update_instance_flattened_async(): @pytest.mark.asyncio async def test_update_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2324,7 +2314,7 @@ async def test_update_instance_flattened_error_async(): ) def test_update_parameters(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2353,7 +2343,7 @@ def test_update_parameters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2372,7 +2362,7 @@ async def test_update_parameters_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.UpdateParametersRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2406,7 +2396,7 @@ async def test_update_parameters_async_from_dict(): def test_update_parameters_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2438,7 +2428,7 @@ def test_update_parameters_field_headers(): @pytest.mark.asyncio async def test_update_parameters_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2471,7 +2461,7 @@ async def test_update_parameters_field_headers_async(): def test_update_parameters_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2505,7 +2495,7 @@ def test_update_parameters_flattened(): def test_update_parameters_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2522,7 +2512,7 @@ def test_update_parameters_flattened_error(): @pytest.mark.asyncio async def test_update_parameters_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2561,7 +2551,7 @@ async def test_update_parameters_flattened_async(): @pytest.mark.asyncio async def test_update_parameters_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2584,7 +2574,7 @@ async def test_update_parameters_flattened_error_async(): ) def test_delete_instance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2611,7 +2601,7 @@ def test_delete_instance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2628,7 +2618,7 @@ async def test_delete_instance_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.DeleteInstanceRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2660,7 +2650,7 @@ async def test_delete_instance_async_from_dict(): def test_delete_instance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2690,7 +2680,7 @@ def test_delete_instance_field_headers(): @pytest.mark.asyncio async def test_delete_instance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2721,7 +2711,7 @@ async def test_delete_instance_field_headers_async(): def test_delete_instance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2745,7 +2735,7 @@ def test_delete_instance_flattened(): def test_delete_instance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2760,7 +2750,7 @@ def test_delete_instance_flattened_error(): @pytest.mark.asyncio async def test_delete_instance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2789,7 +2779,7 @@ async def test_delete_instance_flattened_async(): @pytest.mark.asyncio async def test_delete_instance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2810,7 +2800,7 @@ async def test_delete_instance_flattened_error_async(): ) def test_apply_parameters(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2837,7 +2827,7 @@ def test_apply_parameters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2854,7 +2844,7 @@ async def test_apply_parameters_async( transport: str = "grpc_asyncio", request_type=cloud_memcache.ApplyParametersRequest ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2886,7 +2876,7 @@ async def test_apply_parameters_async_from_dict(): def test_apply_parameters_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2916,7 +2906,7 @@ def test_apply_parameters_field_headers(): @pytest.mark.asyncio async def test_apply_parameters_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2947,7 +2937,7 @@ async def test_apply_parameters_field_headers_async(): def test_apply_parameters_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2979,7 +2969,7 @@ def test_apply_parameters_flattened(): def test_apply_parameters_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2996,7 +2986,7 @@ def test_apply_parameters_flattened_error(): @pytest.mark.asyncio async def test_apply_parameters_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3033,7 +3023,7 @@ async def test_apply_parameters_flattened_async(): @pytest.mark.asyncio async def test_apply_parameters_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3056,7 +3046,7 @@ async def test_apply_parameters_flattened_error_async(): ) def test_apply_software_update(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3085,7 +3075,7 @@ def test_apply_software_update_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3105,7 +3095,7 @@ async def test_apply_software_update_async( request_type=cloud_memcache.ApplySoftwareUpdateRequest, ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3139,7 +3129,7 @@ async def test_apply_software_update_async_from_dict(): def test_apply_software_update_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3171,7 +3161,7 @@ def test_apply_software_update_field_headers(): @pytest.mark.asyncio async def test_apply_software_update_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3204,7 +3194,7 @@ async def test_apply_software_update_field_headers_async(): def test_apply_software_update_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3238,7 +3228,7 @@ def test_apply_software_update_flattened(): def test_apply_software_update_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3255,7 +3245,7 @@ def test_apply_software_update_flattened_error(): @pytest.mark.asyncio async def test_apply_software_update_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3294,7 +3284,7 @@ async def test_apply_software_update_flattened_async(): @pytest.mark.asyncio async def test_apply_software_update_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3317,7 +3307,7 @@ async def test_apply_software_update_flattened_error_async(): ) def test_reschedule_maintenance(request_type, transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3346,7 +3336,7 @@ def test_reschedule_maintenance_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3366,7 +3356,7 @@ async def test_reschedule_maintenance_async( request_type=cloud_memcache.RescheduleMaintenanceRequest, ): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3400,7 +3390,7 @@ async def test_reschedule_maintenance_async_from_dict(): def test_reschedule_maintenance_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3432,7 +3422,7 @@ def test_reschedule_maintenance_field_headers(): @pytest.mark.asyncio async def test_reschedule_maintenance_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3465,7 +3455,7 @@ async def test_reschedule_maintenance_field_headers_async(): def test_reschedule_maintenance_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3499,7 +3489,7 @@ def test_reschedule_maintenance_flattened(): def test_reschedule_maintenance_flattened_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3516,7 +3506,7 @@ def test_reschedule_maintenance_flattened_error(): @pytest.mark.asyncio async def test_reschedule_maintenance_flattened_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3555,7 +3545,7 @@ async def test_reschedule_maintenance_flattened_async(): @pytest.mark.asyncio async def test_reschedule_maintenance_flattened_error_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3578,7 +3568,7 @@ async def test_reschedule_maintenance_flattened_error_async(): ) def test_list_instances_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3631,7 +3621,7 @@ def test_list_instances_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_instances._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3640,7 +3630,7 @@ def test_list_instances_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_instances._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -3658,7 +3648,7 @@ def test_list_instances_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3700,7 +3690,7 @@ def test_list_instances_rest_required_fields( def test_list_instances_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_instances._get_unset_required_fields({}) @@ -3720,7 +3710,7 @@ def test_list_instances_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_instances_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -3778,7 +3768,7 @@ def test_list_instances_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.ListInstancesRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3800,7 +3790,7 @@ def test_list_instances_rest_bad_request( def test_list_instances_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3842,7 +3832,7 @@ def test_list_instances_rest_flattened(): def test_list_instances_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3857,7 +3847,7 @@ def test_list_instances_rest_flattened_error(transport: str = "rest"): def test_list_instances_rest_pager(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3927,7 +3917,7 @@ def test_list_instances_rest_pager(transport: str = "rest"): ) def test_get_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3996,7 +3986,7 @@ def test_get_instance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4005,7 +3995,7 @@ def test_get_instance_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4014,7 +4004,7 @@ def test_get_instance_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4056,7 +4046,7 @@ def test_get_instance_rest_required_fields( def test_get_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_instance._get_unset_required_fields({}) @@ -4066,7 +4056,7 @@ def test_get_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -4124,7 +4114,7 @@ def test_get_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.GetInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4146,7 +4136,7 @@ def test_get_instance_rest_bad_request( def test_get_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4190,7 +4180,7 @@ def test_get_instance_rest_flattened(): def test_get_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4205,7 +4195,7 @@ def test_get_instance_rest_flattened_error(transport: str = "rest"): def test_get_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4218,7 +4208,7 @@ def test_get_instance_rest_error(): ) def test_create_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4384,7 +4374,7 @@ def test_create_instance_rest_required_fields( assert "instanceId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -4396,7 +4386,7 @@ def test_create_instance_rest_required_fields( jsonified_request["instanceId"] = "instance_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_instance._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("instance_id",)) @@ -4409,7 +4399,7 @@ def test_create_instance_rest_required_fields( assert jsonified_request["instanceId"] == "instance_id_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4455,7 +4445,7 @@ def test_create_instance_rest_required_fields( def test_create_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_instance._get_unset_required_fields({}) @@ -4474,7 +4464,7 @@ def test_create_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -4534,7 +4524,7 @@ def test_create_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.CreateInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4556,7 +4546,7 @@ def test_create_instance_rest_bad_request( def test_create_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4598,7 +4588,7 @@ def test_create_instance_rest_flattened(): def test_create_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4615,7 +4605,7 @@ def test_create_instance_rest_flattened_error(transport: str = "rest"): def test_create_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -4628,7 +4618,7 @@ def test_create_instance_rest_error(): ) def test_update_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4793,14 +4783,14 @@ def test_update_instance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_instance._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -4809,7 +4799,7 @@ def test_update_instance_rest_required_fields( # verify required fields with non-default values are left alone client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -4849,7 +4839,7 @@ def test_update_instance_rest_required_fields( def test_update_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_instance._get_unset_required_fields({}) @@ -4867,7 +4857,7 @@ def test_update_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -4927,7 +4917,7 @@ def test_update_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.UpdateInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4951,7 +4941,7 @@ def test_update_instance_rest_bad_request( def test_update_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -4994,7 +4984,7 @@ def test_update_instance_rest_flattened(): def test_update_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5010,7 +5000,7 @@ def test_update_instance_rest_flattened_error(transport: str = "rest"): def test_update_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5023,7 +5013,7 @@ def test_update_instance_rest_error(): ) def test_update_parameters_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5069,7 +5059,7 @@ def test_update_parameters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5078,7 +5068,7 @@ def test_update_parameters_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5087,7 +5077,7 @@ def test_update_parameters_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5127,7 +5117,7 @@ def test_update_parameters_rest_required_fields( def test_update_parameters_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_parameters._get_unset_required_fields({}) @@ -5145,7 +5135,7 @@ def test_update_parameters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_parameters_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -5205,7 +5195,7 @@ def test_update_parameters_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.UpdateParametersRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5227,7 +5217,7 @@ def test_update_parameters_rest_bad_request( def test_update_parameters_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5271,7 +5261,7 @@ def test_update_parameters_rest_flattened(): def test_update_parameters_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5288,7 +5278,7 @@ def test_update_parameters_rest_flattened_error(transport: str = "rest"): def test_update_parameters_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5301,7 +5291,7 @@ def test_update_parameters_rest_error(): ) def test_delete_instance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5347,7 +5337,7 @@ def test_delete_instance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5356,7 +5346,7 @@ def test_delete_instance_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_instance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5365,7 +5355,7 @@ def test_delete_instance_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5404,7 +5394,7 @@ def test_delete_instance_rest_required_fields( def test_delete_instance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_instance._get_unset_required_fields({}) @@ -5414,7 +5404,7 @@ def test_delete_instance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_instance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -5474,7 +5464,7 @@ def test_delete_instance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.DeleteInstanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5496,7 +5486,7 @@ def test_delete_instance_rest_bad_request( def test_delete_instance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5538,7 +5528,7 @@ def test_delete_instance_rest_flattened(): def test_delete_instance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5553,7 +5543,7 @@ def test_delete_instance_rest_flattened_error(transport: str = "rest"): def test_delete_instance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5566,7 +5556,7 @@ def test_delete_instance_rest_error(): ) def test_apply_parameters_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5612,7 +5602,7 @@ def test_apply_parameters_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).apply_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5621,7 +5611,7 @@ def test_apply_parameters_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).apply_parameters._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5630,7 +5620,7 @@ def test_apply_parameters_rest_required_fields( assert jsonified_request["name"] == "name_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5670,7 +5660,7 @@ def test_apply_parameters_rest_required_fields( def test_apply_parameters_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.apply_parameters._get_unset_required_fields({}) @@ -5680,7 +5670,7 @@ def test_apply_parameters_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_apply_parameters_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -5740,7 +5730,7 @@ def test_apply_parameters_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.ApplyParametersRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5762,7 +5752,7 @@ def test_apply_parameters_rest_bad_request( def test_apply_parameters_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5806,7 +5796,7 @@ def test_apply_parameters_rest_flattened(): def test_apply_parameters_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5823,7 +5813,7 @@ def test_apply_parameters_rest_flattened_error(transport: str = "rest"): def test_apply_parameters_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -5836,7 +5826,7 @@ def test_apply_parameters_rest_error(): ) def test_apply_software_update_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -5882,7 +5872,7 @@ def test_apply_software_update_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).apply_software_update._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5891,7 +5881,7 @@ def test_apply_software_update_rest_required_fields( jsonified_request["instance"] = "instance_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).apply_software_update._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -5900,7 +5890,7 @@ def test_apply_software_update_rest_required_fields( assert jsonified_request["instance"] == "instance_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -5940,7 +5930,7 @@ def test_apply_software_update_rest_required_fields( def test_apply_software_update_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.apply_software_update._get_unset_required_fields({}) @@ -5950,7 +5940,7 @@ def test_apply_software_update_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_apply_software_update_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -6010,7 +6000,7 @@ def test_apply_software_update_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.ApplySoftwareUpdateRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6032,7 +6022,7 @@ def test_apply_software_update_rest_bad_request( def test_apply_software_update_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6076,7 +6066,7 @@ def test_apply_software_update_rest_flattened(): def test_apply_software_update_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6093,7 +6083,7 @@ def test_apply_software_update_rest_flattened_error(transport: str = "rest"): def test_apply_software_update_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -6106,7 +6096,7 @@ def test_apply_software_update_rest_error(): ) def test_reschedule_maintenance_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6152,7 +6142,7 @@ def test_reschedule_maintenance_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reschedule_maintenance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6161,7 +6151,7 @@ def test_reschedule_maintenance_rest_required_fields( jsonified_request["instance"] = "instance_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reschedule_maintenance._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -6170,7 +6160,7 @@ def test_reschedule_maintenance_rest_required_fields( assert jsonified_request["instance"] == "instance_value" client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -6210,7 +6200,7 @@ def test_reschedule_maintenance_rest_required_fields( def test_reschedule_maintenance_rest_unset_required_fields(): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.reschedule_maintenance._get_unset_required_fields({}) @@ -6228,7 +6218,7 @@ def test_reschedule_maintenance_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_reschedule_maintenance_rest_interceptors(null_interceptor): transport = transports.CloudMemcacheRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.CloudMemcacheRestInterceptor(), @@ -6288,7 +6278,7 @@ def test_reschedule_maintenance_rest_bad_request( transport: str = "rest", request_type=cloud_memcache.RescheduleMaintenanceRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6310,7 +6300,7 @@ def test_reschedule_maintenance_rest_bad_request( def test_reschedule_maintenance_rest_flattened(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -6354,7 +6344,7 @@ def test_reschedule_maintenance_rest_flattened(): def test_reschedule_maintenance_rest_flattened_error(transport: str = "rest"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6371,24 +6361,24 @@ def test_reschedule_maintenance_rest_flattened_error(transport: str = "rest"): def test_reschedule_maintenance_rest_error(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudMemcacheClient( @@ -6398,7 +6388,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -6413,13 +6403,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = CloudMemcacheClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudMemcacheClient( @@ -6431,7 +6420,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = CloudMemcacheClient(transport=transport) assert client.transport is transport @@ -6440,13 +6429,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.CloudMemcacheGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.CloudMemcacheGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -6463,7 +6452,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -6477,7 +6466,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = CloudMemcacheClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -6485,7 +6474,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -6497,7 +6486,7 @@ def test_cloud_memcache_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.CloudMemcacheTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -6509,7 +6498,7 @@ def test_cloud_memcache_base_transport(): ) as Transport: Transport.return_value = None transport = transports.CloudMemcacheTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -6560,7 +6549,7 @@ def test_cloud_memcache_base_transport_with_credentials_file(): "google.cloud.memcache_v1beta2.services.cloud_memcache.transports.CloudMemcacheTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudMemcacheTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -6579,7 +6568,7 @@ def test_cloud_memcache_base_transport_with_adc(): "google.cloud.memcache_v1beta2.services.cloud_memcache.transports.CloudMemcacheTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudMemcacheTransport() adc.assert_called_once() @@ -6587,7 +6576,7 @@ def test_cloud_memcache_base_transport_with_adc(): def test_cloud_memcache_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) CloudMemcacheClient() adc.assert_called_once_with( scopes=None, @@ -6607,7 +6596,7 @@ def test_cloud_memcache_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -6654,7 +6643,7 @@ def test_cloud_memcache_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -6682,7 +6671,7 @@ def test_cloud_memcache_transport_create_channel(transport_class, grpc_helpers): ], ) def test_cloud_memcache_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -6720,7 +6709,7 @@ def test_cloud_memcache_grpc_transport_client_cert_source_for_mtls(transport_cla def test_cloud_memcache_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -6732,7 +6721,7 @@ def test_cloud_memcache_http_transport_client_cert_source_for_mtls(): def test_cloud_memcache_rest_lro_client(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -6757,7 +6746,7 @@ def test_cloud_memcache_rest_lro_client(): ) def test_cloud_memcache_host_no_port(transport_name): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="memcache.googleapis.com" ), @@ -6780,7 +6769,7 @@ def test_cloud_memcache_host_no_port(transport_name): ) def test_cloud_memcache_host_with_port(transport_name): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="memcache.googleapis.com:8000" ), @@ -6800,8 +6789,8 @@ def test_cloud_memcache_host_with_port(transport_name): ], ) def test_cloud_memcache_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = CloudMemcacheClient( credentials=creds1, transport=transport_name, @@ -6887,7 +6876,7 @@ def test_cloud_memcache_transport_channel_mtls_with_client_cert_source(transport mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -6965,7 +6954,7 @@ def test_cloud_memcache_transport_channel_mtls_with_adc(transport_class): def test_cloud_memcache_grpc_lro_client(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -6982,7 +6971,7 @@ def test_cloud_memcache_grpc_lro_client(): def test_cloud_memcache_grpc_lro_async_client(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -7133,7 +7122,7 @@ def test_client_with_default_client_info(): transports.CloudMemcacheTransport, "_prep_wrapped_messages" ) as prep: client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7143,7 +7132,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CloudMemcacheClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7152,7 +7141,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -7167,7 +7156,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7197,7 +7186,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -7225,7 +7214,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7253,7 +7242,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -7281,7 +7270,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7311,7 +7300,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -7339,7 +7328,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7369,7 +7358,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -7397,7 +7386,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7427,7 +7416,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -7455,7 +7444,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7485,7 +7474,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -7511,7 +7500,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7536,7 +7525,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7560,7 +7549,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7589,7 +7578,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7616,7 +7605,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7634,7 +7623,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7650,7 +7639,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7675,7 +7664,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7699,7 +7688,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7728,7 +7717,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7755,7 +7744,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7773,7 +7762,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7789,7 +7778,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7814,7 +7803,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7840,7 +7829,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7869,7 +7858,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7898,7 +7887,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -7916,7 +7905,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -7934,7 +7923,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7959,7 +7948,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7985,7 +7974,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8014,7 +8003,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8043,7 +8032,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -8061,7 +8050,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -8079,7 +8068,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8104,7 +8093,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8130,7 +8119,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8159,7 +8148,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8188,7 +8177,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8206,7 +8195,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8224,7 +8213,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8249,7 +8238,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8274,7 +8263,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): - client = CloudMemcacheClient(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = CloudMemcacheClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -8301,9 +8290,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): - client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + client = CloudMemcacheAsyncClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -8331,7 +8318,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8349,7 +8336,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = CloudMemcacheAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8373,7 +8360,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -8390,7 +8377,7 @@ def test_client_ctx(): ] for transport in transports: client = CloudMemcacheClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-migrationcenter/google/cloud/migrationcenter/gapic_version.py b/packages/google-cloud-migrationcenter/google/cloud/migrationcenter/gapic_version.py index 286ce4ad5531..360a0d13ebdd 100644 --- a/packages/google-cloud-migrationcenter/google/cloud/migrationcenter/gapic_version.py +++ b/packages/google-cloud-migrationcenter/google/cloud/migrationcenter/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.4" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/gapic_version.py b/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/gapic_version.py index 286ce4ad5531..360a0d13ebdd 100644 --- a/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/gapic_version.py +++ b/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.1.4" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/services/migration_center/client.py b/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/services/migration_center/client.py index e7f9eef4f7c5..04564cf12324 100644 --- a/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/services/migration_center/client.py +++ b/packages/google-cloud-migrationcenter/google/cloud/migrationcenter_v1/services/migration_center/client.py @@ -591,6 +591,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -609,6 +610,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -683,17 +685,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = MigrationCenterClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = MigrationCenterClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-migrationcenter/samples/generated_samples/snippet_metadata_google.cloud.migrationcenter.v1.json b/packages/google-cloud-migrationcenter/samples/generated_samples/snippet_metadata_google.cloud.migrationcenter.v1.json index 67f8192bb6b7..3fc0956a4d6c 100644 --- a/packages/google-cloud-migrationcenter/samples/generated_samples/snippet_metadata_google.cloud.migrationcenter.v1.json +++ b/packages/google-cloud-migrationcenter/samples/generated_samples/snippet_metadata_google.cloud.migrationcenter.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-migrationcenter", - "version": "0.1.4" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-migrationcenter/setup.py b/packages/google-cloud-migrationcenter/setup.py index 2ef2ace32b66..0d88d1c30ea8 100644 --- a/packages/google-cloud-migrationcenter/setup.py +++ b/packages/google-cloud-migrationcenter/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-migrationcenter/testing/constraints-3.7.txt b/packages/google-cloud-migrationcenter/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-migrationcenter/testing/constraints-3.7.txt +++ b/packages/google-cloud-migrationcenter/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-migrationcenter/tests/unit/gapic/migrationcenter_v1/test_migration_center.py b/packages/google-cloud-migrationcenter/tests/unit/gapic/migrationcenter_v1/test_migration_center.py index d0d486e3ac76..8d63fb849640 100644 --- a/packages/google-cloud-migrationcenter/tests/unit/gapic/migrationcenter_v1/test_migration_center.py +++ b/packages/google-cloud-migrationcenter/tests/unit/gapic/migrationcenter_v1/test_migration_center.py @@ -93,18 +93,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -331,7 +319,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -358,42 +346,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -406,7 +401,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_migration_center_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -460,7 +455,7 @@ def test_migration_center_client_service_account_always_use_jwt( def test_migration_center_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -523,9 +518,7 @@ def test_migration_center_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(MigrationCenterClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -944,20 +937,20 @@ def test_migration_center_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -969,13 +962,11 @@ def test_migration_center_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -991,8 +982,7 @@ def test_migration_center_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1145,8 +1135,8 @@ def test_migration_center_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1175,7 +1165,7 @@ def test_migration_center_client_create_channel_credentials_file( ) def test_list_assets(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1207,7 +1197,7 @@ def test_list_assets_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1224,7 +1214,7 @@ async def test_list_assets_async( transport: str = "grpc_asyncio", request_type=migrationcenter.ListAssetsRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1261,7 +1251,7 @@ async def test_list_assets_async_from_dict(): def test_list_assets_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1291,7 +1281,7 @@ def test_list_assets_field_headers(): @pytest.mark.asyncio async def test_list_assets_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1322,7 +1312,7 @@ async def test_list_assets_field_headers_async(): def test_list_assets_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1346,7 +1336,7 @@ def test_list_assets_flattened(): def test_list_assets_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1361,7 +1351,7 @@ def test_list_assets_flattened_error(): @pytest.mark.asyncio async def test_list_assets_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1390,7 +1380,7 @@ async def test_list_assets_flattened_async(): @pytest.mark.asyncio async def test_list_assets_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1404,7 +1394,7 @@ async def test_list_assets_flattened_error_async(): def test_list_assets_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1454,7 +1444,7 @@ def test_list_assets_pager(transport_name: str = "grpc"): def test_list_assets_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1496,7 +1486,7 @@ def test_list_assets_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_assets_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1546,7 +1536,7 @@ async def test_list_assets_async_pager(): @pytest.mark.asyncio async def test_list_assets_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1601,7 +1591,7 @@ async def test_list_assets_async_pages(): ) def test_get_asset(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1635,7 +1625,7 @@ def test_get_asset_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1652,7 +1642,7 @@ async def test_get_asset_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetAssetRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1691,7 +1681,7 @@ async def test_get_asset_async_from_dict(): def test_get_asset_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1721,7 +1711,7 @@ def test_get_asset_field_headers(): @pytest.mark.asyncio async def test_get_asset_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1752,7 +1742,7 @@ async def test_get_asset_field_headers_async(): def test_get_asset_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1776,7 +1766,7 @@ def test_get_asset_flattened(): def test_get_asset_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1791,7 +1781,7 @@ def test_get_asset_flattened_error(): @pytest.mark.asyncio async def test_get_asset_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1820,7 +1810,7 @@ async def test_get_asset_flattened_async(): @pytest.mark.asyncio async def test_get_asset_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1841,7 +1831,7 @@ async def test_get_asset_flattened_error_async(): ) def test_update_asset(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1875,7 +1865,7 @@ def test_update_asset_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1892,7 +1882,7 @@ async def test_update_asset_async( transport: str = "grpc_asyncio", request_type=migrationcenter.UpdateAssetRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1931,7 +1921,7 @@ async def test_update_asset_async_from_dict(): def test_update_asset_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1961,7 +1951,7 @@ def test_update_asset_field_headers(): @pytest.mark.asyncio async def test_update_asset_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1992,7 +1982,7 @@ async def test_update_asset_field_headers_async(): def test_update_asset_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2020,7 +2010,7 @@ def test_update_asset_flattened(): def test_update_asset_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2036,7 +2026,7 @@ def test_update_asset_flattened_error(): @pytest.mark.asyncio async def test_update_asset_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2069,7 +2059,7 @@ async def test_update_asset_flattened_async(): @pytest.mark.asyncio async def test_update_asset_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2091,7 +2081,7 @@ async def test_update_asset_flattened_error_async(): ) def test_batch_update_assets(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2120,7 +2110,7 @@ def test_batch_update_assets_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2140,7 +2130,7 @@ async def test_batch_update_assets_async( request_type=migrationcenter.BatchUpdateAssetsRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2174,7 +2164,7 @@ async def test_batch_update_assets_async_from_dict(): def test_batch_update_assets_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2206,7 +2196,7 @@ def test_batch_update_assets_field_headers(): @pytest.mark.asyncio async def test_batch_update_assets_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2239,7 +2229,7 @@ async def test_batch_update_assets_field_headers_async(): def test_batch_update_assets_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2277,7 +2267,7 @@ def test_batch_update_assets_flattened(): def test_batch_update_assets_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2297,7 +2287,7 @@ def test_batch_update_assets_flattened_error(): @pytest.mark.asyncio async def test_batch_update_assets_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2340,7 +2330,7 @@ async def test_batch_update_assets_flattened_async(): @pytest.mark.asyncio async def test_batch_update_assets_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2366,7 +2356,7 @@ async def test_batch_update_assets_flattened_error_async(): ) def test_delete_asset(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2393,7 +2383,7 @@ def test_delete_asset_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2410,7 +2400,7 @@ async def test_delete_asset_async( transport: str = "grpc_asyncio", request_type=migrationcenter.DeleteAssetRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2440,7 +2430,7 @@ async def test_delete_asset_async_from_dict(): def test_delete_asset_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2470,7 +2460,7 @@ def test_delete_asset_field_headers(): @pytest.mark.asyncio async def test_delete_asset_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2499,7 +2489,7 @@ async def test_delete_asset_field_headers_async(): def test_delete_asset_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2523,7 +2513,7 @@ def test_delete_asset_flattened(): def test_delete_asset_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2538,7 +2528,7 @@ def test_delete_asset_flattened_error(): @pytest.mark.asyncio async def test_delete_asset_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2565,7 +2555,7 @@ async def test_delete_asset_flattened_async(): @pytest.mark.asyncio async def test_delete_asset_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2586,7 +2576,7 @@ async def test_delete_asset_flattened_error_async(): ) def test_batch_delete_assets(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2615,7 +2605,7 @@ def test_batch_delete_assets_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2635,7 +2625,7 @@ async def test_batch_delete_assets_async( request_type=migrationcenter.BatchDeleteAssetsRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2667,7 +2657,7 @@ async def test_batch_delete_assets_async_from_dict(): def test_batch_delete_assets_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2699,7 +2689,7 @@ def test_batch_delete_assets_field_headers(): @pytest.mark.asyncio async def test_batch_delete_assets_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2730,7 +2720,7 @@ async def test_batch_delete_assets_field_headers_async(): def test_batch_delete_assets_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2760,7 +2750,7 @@ def test_batch_delete_assets_flattened(): def test_batch_delete_assets_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2776,7 +2766,7 @@ def test_batch_delete_assets_flattened_error(): @pytest.mark.asyncio async def test_batch_delete_assets_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2809,7 +2799,7 @@ async def test_batch_delete_assets_flattened_async(): @pytest.mark.asyncio async def test_batch_delete_assets_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2831,7 +2821,7 @@ async def test_batch_delete_assets_flattened_error_async(): ) def test_report_asset_frames(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2860,7 +2850,7 @@ def test_report_asset_frames_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2880,7 +2870,7 @@ async def test_report_asset_frames_async( request_type=migrationcenter.ReportAssetFramesRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2914,7 +2904,7 @@ async def test_report_asset_frames_async_from_dict(): def test_report_asset_frames_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2946,7 +2936,7 @@ def test_report_asset_frames_field_headers(): @pytest.mark.asyncio async def test_report_asset_frames_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2986,7 +2976,7 @@ async def test_report_asset_frames_field_headers_async(): ) def test_aggregate_assets_values(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3015,7 +3005,7 @@ def test_aggregate_assets_values_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3035,7 +3025,7 @@ async def test_aggregate_assets_values_async( request_type=migrationcenter.AggregateAssetsValuesRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3069,7 +3059,7 @@ async def test_aggregate_assets_values_async_from_dict(): def test_aggregate_assets_values_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3101,7 +3091,7 @@ def test_aggregate_assets_values_field_headers(): @pytest.mark.asyncio async def test_aggregate_assets_values_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3141,7 +3131,7 @@ async def test_aggregate_assets_values_field_headers_async(): ) def test_create_import_job(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3170,7 +3160,7 @@ def test_create_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3189,7 +3179,7 @@ async def test_create_import_job_async( transport: str = "grpc_asyncio", request_type=migrationcenter.CreateImportJobRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3223,7 +3213,7 @@ async def test_create_import_job_async_from_dict(): def test_create_import_job_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3255,7 +3245,7 @@ def test_create_import_job_field_headers(): @pytest.mark.asyncio async def test_create_import_job_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3288,7 +3278,7 @@ async def test_create_import_job_field_headers_async(): def test_create_import_job_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3322,7 +3312,7 @@ def test_create_import_job_flattened(): def test_create_import_job_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3339,7 +3329,7 @@ def test_create_import_job_flattened_error(): @pytest.mark.asyncio async def test_create_import_job_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3378,7 +3368,7 @@ async def test_create_import_job_flattened_async(): @pytest.mark.asyncio async def test_create_import_job_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3401,7 +3391,7 @@ async def test_create_import_job_flattened_error_async(): ) def test_list_import_jobs(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3433,7 +3423,7 @@ def test_list_import_jobs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3450,7 +3440,7 @@ async def test_list_import_jobs_async( transport: str = "grpc_asyncio", request_type=migrationcenter.ListImportJobsRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3487,7 +3477,7 @@ async def test_list_import_jobs_async_from_dict(): def test_list_import_jobs_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3517,7 +3507,7 @@ def test_list_import_jobs_field_headers(): @pytest.mark.asyncio async def test_list_import_jobs_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3548,7 +3538,7 @@ async def test_list_import_jobs_field_headers_async(): def test_list_import_jobs_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3572,7 +3562,7 @@ def test_list_import_jobs_flattened(): def test_list_import_jobs_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3587,7 +3577,7 @@ def test_list_import_jobs_flattened_error(): @pytest.mark.asyncio async def test_list_import_jobs_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3616,7 +3606,7 @@ async def test_list_import_jobs_flattened_async(): @pytest.mark.asyncio async def test_list_import_jobs_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3630,7 +3620,7 @@ async def test_list_import_jobs_flattened_error_async(): def test_list_import_jobs_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3680,7 +3670,7 @@ def test_list_import_jobs_pager(transport_name: str = "grpc"): def test_list_import_jobs_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3722,7 +3712,7 @@ def test_list_import_jobs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_import_jobs_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3772,7 +3762,7 @@ async def test_list_import_jobs_async_pager(): @pytest.mark.asyncio async def test_list_import_jobs_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3827,7 +3817,7 @@ async def test_list_import_jobs_async_pages(): ) def test_get_import_job(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3866,7 +3856,7 @@ def test_get_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3883,7 +3873,7 @@ async def test_get_import_job_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetImportJobRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3927,7 +3917,7 @@ async def test_get_import_job_async_from_dict(): def test_get_import_job_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3957,7 +3947,7 @@ def test_get_import_job_field_headers(): @pytest.mark.asyncio async def test_get_import_job_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3988,7 +3978,7 @@ async def test_get_import_job_field_headers_async(): def test_get_import_job_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4012,7 +4002,7 @@ def test_get_import_job_flattened(): def test_get_import_job_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4027,7 +4017,7 @@ def test_get_import_job_flattened_error(): @pytest.mark.asyncio async def test_get_import_job_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4056,7 +4046,7 @@ async def test_get_import_job_flattened_async(): @pytest.mark.asyncio async def test_get_import_job_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4077,7 +4067,7 @@ async def test_get_import_job_flattened_error_async(): ) def test_delete_import_job(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4106,7 +4096,7 @@ def test_delete_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4125,7 +4115,7 @@ async def test_delete_import_job_async( transport: str = "grpc_asyncio", request_type=migrationcenter.DeleteImportJobRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4159,7 +4149,7 @@ async def test_delete_import_job_async_from_dict(): def test_delete_import_job_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4191,7 +4181,7 @@ def test_delete_import_job_field_headers(): @pytest.mark.asyncio async def test_delete_import_job_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4224,7 +4214,7 @@ async def test_delete_import_job_field_headers_async(): def test_delete_import_job_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4250,7 +4240,7 @@ def test_delete_import_job_flattened(): def test_delete_import_job_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4265,7 +4255,7 @@ def test_delete_import_job_flattened_error(): @pytest.mark.asyncio async def test_delete_import_job_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4296,7 +4286,7 @@ async def test_delete_import_job_flattened_async(): @pytest.mark.asyncio async def test_delete_import_job_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4317,7 +4307,7 @@ async def test_delete_import_job_flattened_error_async(): ) def test_update_import_job(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4346,7 +4336,7 @@ def test_update_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4365,7 +4355,7 @@ async def test_update_import_job_async( transport: str = "grpc_asyncio", request_type=migrationcenter.UpdateImportJobRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4399,7 +4389,7 @@ async def test_update_import_job_async_from_dict(): def test_update_import_job_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4431,7 +4421,7 @@ def test_update_import_job_field_headers(): @pytest.mark.asyncio async def test_update_import_job_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4464,7 +4454,7 @@ async def test_update_import_job_field_headers_async(): def test_update_import_job_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4494,7 +4484,7 @@ def test_update_import_job_flattened(): def test_update_import_job_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4510,7 +4500,7 @@ def test_update_import_job_flattened_error(): @pytest.mark.asyncio async def test_update_import_job_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4545,7 +4535,7 @@ async def test_update_import_job_flattened_async(): @pytest.mark.asyncio async def test_update_import_job_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4567,7 +4557,7 @@ async def test_update_import_job_flattened_error_async(): ) def test_validate_import_job(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4596,7 +4586,7 @@ def test_validate_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4616,7 +4606,7 @@ async def test_validate_import_job_async( request_type=migrationcenter.ValidateImportJobRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4650,7 +4640,7 @@ async def test_validate_import_job_async_from_dict(): def test_validate_import_job_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4682,7 +4672,7 @@ def test_validate_import_job_field_headers(): @pytest.mark.asyncio async def test_validate_import_job_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4715,7 +4705,7 @@ async def test_validate_import_job_field_headers_async(): def test_validate_import_job_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4741,7 +4731,7 @@ def test_validate_import_job_flattened(): def test_validate_import_job_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4756,7 +4746,7 @@ def test_validate_import_job_flattened_error(): @pytest.mark.asyncio async def test_validate_import_job_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4787,7 +4777,7 @@ async def test_validate_import_job_flattened_async(): @pytest.mark.asyncio async def test_validate_import_job_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4808,7 +4798,7 @@ async def test_validate_import_job_flattened_error_async(): ) def test_run_import_job(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4835,7 +4825,7 @@ def test_run_import_job_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4852,7 +4842,7 @@ async def test_run_import_job_async( transport: str = "grpc_asyncio", request_type=migrationcenter.RunImportJobRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4884,7 +4874,7 @@ async def test_run_import_job_async_from_dict(): def test_run_import_job_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4914,7 +4904,7 @@ def test_run_import_job_field_headers(): @pytest.mark.asyncio async def test_run_import_job_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4945,7 +4935,7 @@ async def test_run_import_job_field_headers_async(): def test_run_import_job_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4969,7 +4959,7 @@ def test_run_import_job_flattened(): def test_run_import_job_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4984,7 +4974,7 @@ def test_run_import_job_flattened_error(): @pytest.mark.asyncio async def test_run_import_job_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5013,7 +5003,7 @@ async def test_run_import_job_flattened_async(): @pytest.mark.asyncio async def test_run_import_job_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5034,7 +5024,7 @@ async def test_run_import_job_flattened_error_async(): ) def test_get_import_data_file(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5075,7 +5065,7 @@ def test_get_import_data_file_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5095,7 +5085,7 @@ async def test_get_import_data_file_async( request_type=migrationcenter.GetImportDataFileRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5141,7 +5131,7 @@ async def test_get_import_data_file_async_from_dict(): def test_get_import_data_file_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5173,7 +5163,7 @@ def test_get_import_data_file_field_headers(): @pytest.mark.asyncio async def test_get_import_data_file_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5206,7 +5196,7 @@ async def test_get_import_data_file_field_headers_async(): def test_get_import_data_file_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5232,7 +5222,7 @@ def test_get_import_data_file_flattened(): def test_get_import_data_file_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5247,7 +5237,7 @@ def test_get_import_data_file_flattened_error(): @pytest.mark.asyncio async def test_get_import_data_file_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5278,7 +5268,7 @@ async def test_get_import_data_file_flattened_async(): @pytest.mark.asyncio async def test_get_import_data_file_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5299,7 +5289,7 @@ async def test_get_import_data_file_flattened_error_async(): ) def test_list_import_data_files(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5333,7 +5323,7 @@ def test_list_import_data_files_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5353,7 +5343,7 @@ async def test_list_import_data_files_async( request_type=migrationcenter.ListImportDataFilesRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5392,7 +5382,7 @@ async def test_list_import_data_files_async_from_dict(): def test_list_import_data_files_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5424,7 +5414,7 @@ def test_list_import_data_files_field_headers(): @pytest.mark.asyncio async def test_list_import_data_files_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5457,7 +5447,7 @@ async def test_list_import_data_files_field_headers_async(): def test_list_import_data_files_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5483,7 +5473,7 @@ def test_list_import_data_files_flattened(): def test_list_import_data_files_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5498,7 +5488,7 @@ def test_list_import_data_files_flattened_error(): @pytest.mark.asyncio async def test_list_import_data_files_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5529,7 +5519,7 @@ async def test_list_import_data_files_flattened_async(): @pytest.mark.asyncio async def test_list_import_data_files_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5543,7 +5533,7 @@ async def test_list_import_data_files_flattened_error_async(): def test_list_import_data_files_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5595,7 +5585,7 @@ def test_list_import_data_files_pager(transport_name: str = "grpc"): def test_list_import_data_files_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5639,7 +5629,7 @@ def test_list_import_data_files_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_import_data_files_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5691,7 +5681,7 @@ async def test_list_import_data_files_async_pager(): @pytest.mark.asyncio async def test_list_import_data_files_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5748,7 +5738,7 @@ async def test_list_import_data_files_async_pages(): ) def test_create_import_data_file(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5777,7 +5767,7 @@ def test_create_import_data_file_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5797,7 +5787,7 @@ async def test_create_import_data_file_async( request_type=migrationcenter.CreateImportDataFileRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5831,7 +5821,7 @@ async def test_create_import_data_file_async_from_dict(): def test_create_import_data_file_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5863,7 +5853,7 @@ def test_create_import_data_file_field_headers(): @pytest.mark.asyncio async def test_create_import_data_file_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5896,7 +5886,7 @@ async def test_create_import_data_file_field_headers_async(): def test_create_import_data_file_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5930,7 +5920,7 @@ def test_create_import_data_file_flattened(): def test_create_import_data_file_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5947,7 +5937,7 @@ def test_create_import_data_file_flattened_error(): @pytest.mark.asyncio async def test_create_import_data_file_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5986,7 +5976,7 @@ async def test_create_import_data_file_flattened_async(): @pytest.mark.asyncio async def test_create_import_data_file_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6009,7 +5999,7 @@ async def test_create_import_data_file_flattened_error_async(): ) def test_delete_import_data_file(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6038,7 +6028,7 @@ def test_delete_import_data_file_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6058,7 +6048,7 @@ async def test_delete_import_data_file_async( request_type=migrationcenter.DeleteImportDataFileRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6092,7 +6082,7 @@ async def test_delete_import_data_file_async_from_dict(): def test_delete_import_data_file_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6124,7 +6114,7 @@ def test_delete_import_data_file_field_headers(): @pytest.mark.asyncio async def test_delete_import_data_file_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6157,7 +6147,7 @@ async def test_delete_import_data_file_field_headers_async(): def test_delete_import_data_file_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6183,7 +6173,7 @@ def test_delete_import_data_file_flattened(): def test_delete_import_data_file_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6198,7 +6188,7 @@ def test_delete_import_data_file_flattened_error(): @pytest.mark.asyncio async def test_delete_import_data_file_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6229,7 +6219,7 @@ async def test_delete_import_data_file_flattened_async(): @pytest.mark.asyncio async def test_delete_import_data_file_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6250,7 +6240,7 @@ async def test_delete_import_data_file_flattened_error_async(): ) def test_list_groups(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6282,7 +6272,7 @@ def test_list_groups_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6299,7 +6289,7 @@ async def test_list_groups_async( transport: str = "grpc_asyncio", request_type=migrationcenter.ListGroupsRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6336,7 +6326,7 @@ async def test_list_groups_async_from_dict(): def test_list_groups_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6366,7 +6356,7 @@ def test_list_groups_field_headers(): @pytest.mark.asyncio async def test_list_groups_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6397,7 +6387,7 @@ async def test_list_groups_field_headers_async(): def test_list_groups_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6421,7 +6411,7 @@ def test_list_groups_flattened(): def test_list_groups_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6436,7 +6426,7 @@ def test_list_groups_flattened_error(): @pytest.mark.asyncio async def test_list_groups_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6465,7 +6455,7 @@ async def test_list_groups_flattened_async(): @pytest.mark.asyncio async def test_list_groups_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6479,7 +6469,7 @@ async def test_list_groups_flattened_error_async(): def test_list_groups_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -6529,7 +6519,7 @@ def test_list_groups_pager(transport_name: str = "grpc"): def test_list_groups_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -6571,7 +6561,7 @@ def test_list_groups_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_groups_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6621,7 +6611,7 @@ async def test_list_groups_async_pager(): @pytest.mark.asyncio async def test_list_groups_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6676,7 +6666,7 @@ async def test_list_groups_async_pages(): ) def test_get_group(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6710,7 +6700,7 @@ def test_get_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6727,7 +6717,7 @@ async def test_get_group_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetGroupRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6766,7 +6756,7 @@ async def test_get_group_async_from_dict(): def test_get_group_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6796,7 +6786,7 @@ def test_get_group_field_headers(): @pytest.mark.asyncio async def test_get_group_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6827,7 +6817,7 @@ async def test_get_group_field_headers_async(): def test_get_group_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6851,7 +6841,7 @@ def test_get_group_flattened(): def test_get_group_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6866,7 +6856,7 @@ def test_get_group_flattened_error(): @pytest.mark.asyncio async def test_get_group_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6895,7 +6885,7 @@ async def test_get_group_flattened_async(): @pytest.mark.asyncio async def test_get_group_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6916,7 +6906,7 @@ async def test_get_group_flattened_error_async(): ) def test_create_group(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6943,7 +6933,7 @@ def test_create_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6960,7 +6950,7 @@ async def test_create_group_async( transport: str = "grpc_asyncio", request_type=migrationcenter.CreateGroupRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6992,7 +6982,7 @@ async def test_create_group_async_from_dict(): def test_create_group_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7022,7 +7012,7 @@ def test_create_group_field_headers(): @pytest.mark.asyncio async def test_create_group_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7053,7 +7043,7 @@ async def test_create_group_field_headers_async(): def test_create_group_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7085,7 +7075,7 @@ def test_create_group_flattened(): def test_create_group_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7102,7 +7092,7 @@ def test_create_group_flattened_error(): @pytest.mark.asyncio async def test_create_group_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7139,7 +7129,7 @@ async def test_create_group_flattened_async(): @pytest.mark.asyncio async def test_create_group_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7162,7 +7152,7 @@ async def test_create_group_flattened_error_async(): ) def test_update_group(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7189,7 +7179,7 @@ def test_update_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7206,7 +7196,7 @@ async def test_update_group_async( transport: str = "grpc_asyncio", request_type=migrationcenter.UpdateGroupRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7238,7 +7228,7 @@ async def test_update_group_async_from_dict(): def test_update_group_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7268,7 +7258,7 @@ def test_update_group_field_headers(): @pytest.mark.asyncio async def test_update_group_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7299,7 +7289,7 @@ async def test_update_group_field_headers_async(): def test_update_group_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7327,7 +7317,7 @@ def test_update_group_flattened(): def test_update_group_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7343,7 +7333,7 @@ def test_update_group_flattened_error(): @pytest.mark.asyncio async def test_update_group_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7376,7 +7366,7 @@ async def test_update_group_flattened_async(): @pytest.mark.asyncio async def test_update_group_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7398,7 +7388,7 @@ async def test_update_group_flattened_error_async(): ) def test_delete_group(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7425,7 +7415,7 @@ def test_delete_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7442,7 +7432,7 @@ async def test_delete_group_async( transport: str = "grpc_asyncio", request_type=migrationcenter.DeleteGroupRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7474,7 +7464,7 @@ async def test_delete_group_async_from_dict(): def test_delete_group_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7504,7 +7494,7 @@ def test_delete_group_field_headers(): @pytest.mark.asyncio async def test_delete_group_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7535,7 +7525,7 @@ async def test_delete_group_field_headers_async(): def test_delete_group_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7559,7 +7549,7 @@ def test_delete_group_flattened(): def test_delete_group_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7574,7 +7564,7 @@ def test_delete_group_flattened_error(): @pytest.mark.asyncio async def test_delete_group_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7603,7 +7593,7 @@ async def test_delete_group_flattened_async(): @pytest.mark.asyncio async def test_delete_group_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7624,7 +7614,7 @@ async def test_delete_group_flattened_error_async(): ) def test_add_assets_to_group(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7653,7 +7643,7 @@ def test_add_assets_to_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7673,7 +7663,7 @@ async def test_add_assets_to_group_async( request_type=migrationcenter.AddAssetsToGroupRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7707,7 +7697,7 @@ async def test_add_assets_to_group_async_from_dict(): def test_add_assets_to_group_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7739,7 +7729,7 @@ def test_add_assets_to_group_field_headers(): @pytest.mark.asyncio async def test_add_assets_to_group_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7772,7 +7762,7 @@ async def test_add_assets_to_group_field_headers_async(): def test_add_assets_to_group_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7798,7 +7788,7 @@ def test_add_assets_to_group_flattened(): def test_add_assets_to_group_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7813,7 +7803,7 @@ def test_add_assets_to_group_flattened_error(): @pytest.mark.asyncio async def test_add_assets_to_group_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7844,7 +7834,7 @@ async def test_add_assets_to_group_flattened_async(): @pytest.mark.asyncio async def test_add_assets_to_group_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7865,7 +7855,7 @@ async def test_add_assets_to_group_flattened_error_async(): ) def test_remove_assets_from_group(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7894,7 +7884,7 @@ def test_remove_assets_from_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7914,7 +7904,7 @@ async def test_remove_assets_from_group_async( request_type=migrationcenter.RemoveAssetsFromGroupRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7948,7 +7938,7 @@ async def test_remove_assets_from_group_async_from_dict(): def test_remove_assets_from_group_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7980,7 +7970,7 @@ def test_remove_assets_from_group_field_headers(): @pytest.mark.asyncio async def test_remove_assets_from_group_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8013,7 +8003,7 @@ async def test_remove_assets_from_group_field_headers_async(): def test_remove_assets_from_group_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8039,7 +8029,7 @@ def test_remove_assets_from_group_flattened(): def test_remove_assets_from_group_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8054,7 +8044,7 @@ def test_remove_assets_from_group_flattened_error(): @pytest.mark.asyncio async def test_remove_assets_from_group_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8085,7 +8075,7 @@ async def test_remove_assets_from_group_flattened_async(): @pytest.mark.asyncio async def test_remove_assets_from_group_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8106,7 +8096,7 @@ async def test_remove_assets_from_group_flattened_error_async(): ) def test_list_error_frames(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8140,7 +8130,7 @@ def test_list_error_frames_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8159,7 +8149,7 @@ async def test_list_error_frames_async( transport: str = "grpc_asyncio", request_type=migrationcenter.ListErrorFramesRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8198,7 +8188,7 @@ async def test_list_error_frames_async_from_dict(): def test_list_error_frames_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8230,7 +8220,7 @@ def test_list_error_frames_field_headers(): @pytest.mark.asyncio async def test_list_error_frames_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8263,7 +8253,7 @@ async def test_list_error_frames_field_headers_async(): def test_list_error_frames_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8289,7 +8279,7 @@ def test_list_error_frames_flattened(): def test_list_error_frames_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8304,7 +8294,7 @@ def test_list_error_frames_flattened_error(): @pytest.mark.asyncio async def test_list_error_frames_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8335,7 +8325,7 @@ async def test_list_error_frames_flattened_async(): @pytest.mark.asyncio async def test_list_error_frames_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8349,7 +8339,7 @@ async def test_list_error_frames_flattened_error_async(): def test_list_error_frames_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -8401,7 +8391,7 @@ def test_list_error_frames_pager(transport_name: str = "grpc"): def test_list_error_frames_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -8445,7 +8435,7 @@ def test_list_error_frames_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_error_frames_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8497,7 +8487,7 @@ async def test_list_error_frames_async_pager(): @pytest.mark.asyncio async def test_list_error_frames_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8554,7 +8544,7 @@ async def test_list_error_frames_async_pages(): ) def test_get_error_frame(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8584,7 +8574,7 @@ def test_get_error_frame_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8601,7 +8591,7 @@ async def test_get_error_frame_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetErrorFrameRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8636,7 +8626,7 @@ async def test_get_error_frame_async_from_dict(): def test_get_error_frame_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8666,7 +8656,7 @@ def test_get_error_frame_field_headers(): @pytest.mark.asyncio async def test_get_error_frame_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8697,7 +8687,7 @@ async def test_get_error_frame_field_headers_async(): def test_get_error_frame_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8721,7 +8711,7 @@ def test_get_error_frame_flattened(): def test_get_error_frame_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8736,7 +8726,7 @@ def test_get_error_frame_flattened_error(): @pytest.mark.asyncio async def test_get_error_frame_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8765,7 +8755,7 @@ async def test_get_error_frame_flattened_async(): @pytest.mark.asyncio async def test_get_error_frame_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8786,7 +8776,7 @@ async def test_get_error_frame_flattened_error_async(): ) def test_list_sources(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8818,7 +8808,7 @@ def test_list_sources_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8835,7 +8825,7 @@ async def test_list_sources_async( transport: str = "grpc_asyncio", request_type=migrationcenter.ListSourcesRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8872,7 +8862,7 @@ async def test_list_sources_async_from_dict(): def test_list_sources_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8902,7 +8892,7 @@ def test_list_sources_field_headers(): @pytest.mark.asyncio async def test_list_sources_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8933,7 +8923,7 @@ async def test_list_sources_field_headers_async(): def test_list_sources_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8957,7 +8947,7 @@ def test_list_sources_flattened(): def test_list_sources_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8972,7 +8962,7 @@ def test_list_sources_flattened_error(): @pytest.mark.asyncio async def test_list_sources_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9001,7 +8991,7 @@ async def test_list_sources_flattened_async(): @pytest.mark.asyncio async def test_list_sources_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9015,7 +9005,7 @@ async def test_list_sources_flattened_error_async(): def test_list_sources_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -9065,7 +9055,7 @@ def test_list_sources_pager(transport_name: str = "grpc"): def test_list_sources_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -9107,7 +9097,7 @@ def test_list_sources_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_sources_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9157,7 +9147,7 @@ async def test_list_sources_async_pager(): @pytest.mark.asyncio async def test_list_sources_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9212,7 +9202,7 @@ async def test_list_sources_async_pages(): ) def test_get_source(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9258,7 +9248,7 @@ def test_get_source_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9275,7 +9265,7 @@ async def test_get_source_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetSourceRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9326,7 +9316,7 @@ async def test_get_source_async_from_dict(): def test_get_source_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9356,7 +9346,7 @@ def test_get_source_field_headers(): @pytest.mark.asyncio async def test_get_source_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9387,7 +9377,7 @@ async def test_get_source_field_headers_async(): def test_get_source_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9411,7 +9401,7 @@ def test_get_source_flattened(): def test_get_source_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9426,7 +9416,7 @@ def test_get_source_flattened_error(): @pytest.mark.asyncio async def test_get_source_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9455,7 +9445,7 @@ async def test_get_source_flattened_async(): @pytest.mark.asyncio async def test_get_source_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9476,7 +9466,7 @@ async def test_get_source_flattened_error_async(): ) def test_create_source(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9503,7 +9493,7 @@ def test_create_source_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9520,7 +9510,7 @@ async def test_create_source_async( transport: str = "grpc_asyncio", request_type=migrationcenter.CreateSourceRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9552,7 +9542,7 @@ async def test_create_source_async_from_dict(): def test_create_source_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9582,7 +9572,7 @@ def test_create_source_field_headers(): @pytest.mark.asyncio async def test_create_source_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9613,7 +9603,7 @@ async def test_create_source_field_headers_async(): def test_create_source_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9645,7 +9635,7 @@ def test_create_source_flattened(): def test_create_source_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9662,7 +9652,7 @@ def test_create_source_flattened_error(): @pytest.mark.asyncio async def test_create_source_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9699,7 +9689,7 @@ async def test_create_source_flattened_async(): @pytest.mark.asyncio async def test_create_source_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9722,7 +9712,7 @@ async def test_create_source_flattened_error_async(): ) def test_update_source(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9749,7 +9739,7 @@ def test_update_source_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9766,7 +9756,7 @@ async def test_update_source_async( transport: str = "grpc_asyncio", request_type=migrationcenter.UpdateSourceRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9798,7 +9788,7 @@ async def test_update_source_async_from_dict(): def test_update_source_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9828,7 +9818,7 @@ def test_update_source_field_headers(): @pytest.mark.asyncio async def test_update_source_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9859,7 +9849,7 @@ async def test_update_source_field_headers_async(): def test_update_source_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9887,7 +9877,7 @@ def test_update_source_flattened(): def test_update_source_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9903,7 +9893,7 @@ def test_update_source_flattened_error(): @pytest.mark.asyncio async def test_update_source_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9936,7 +9926,7 @@ async def test_update_source_flattened_async(): @pytest.mark.asyncio async def test_update_source_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9958,7 +9948,7 @@ async def test_update_source_flattened_error_async(): ) def test_delete_source(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9985,7 +9975,7 @@ def test_delete_source_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10002,7 +9992,7 @@ async def test_delete_source_async( transport: str = "grpc_asyncio", request_type=migrationcenter.DeleteSourceRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10034,7 +10024,7 @@ async def test_delete_source_async_from_dict(): def test_delete_source_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10064,7 +10054,7 @@ def test_delete_source_field_headers(): @pytest.mark.asyncio async def test_delete_source_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10095,7 +10085,7 @@ async def test_delete_source_field_headers_async(): def test_delete_source_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10119,7 +10109,7 @@ def test_delete_source_flattened(): def test_delete_source_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10134,7 +10124,7 @@ def test_delete_source_flattened_error(): @pytest.mark.asyncio async def test_delete_source_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10163,7 +10153,7 @@ async def test_delete_source_flattened_async(): @pytest.mark.asyncio async def test_delete_source_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10184,7 +10174,7 @@ async def test_delete_source_flattened_error_async(): ) def test_list_preference_sets(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10218,7 +10208,7 @@ def test_list_preference_sets_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10238,7 +10228,7 @@ async def test_list_preference_sets_async( request_type=migrationcenter.ListPreferenceSetsRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10277,7 +10267,7 @@ async def test_list_preference_sets_async_from_dict(): def test_list_preference_sets_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10309,7 +10299,7 @@ def test_list_preference_sets_field_headers(): @pytest.mark.asyncio async def test_list_preference_sets_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10342,7 +10332,7 @@ async def test_list_preference_sets_field_headers_async(): def test_list_preference_sets_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10368,7 +10358,7 @@ def test_list_preference_sets_flattened(): def test_list_preference_sets_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10383,7 +10373,7 @@ def test_list_preference_sets_flattened_error(): @pytest.mark.asyncio async def test_list_preference_sets_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10414,7 +10404,7 @@ async def test_list_preference_sets_flattened_async(): @pytest.mark.asyncio async def test_list_preference_sets_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10428,7 +10418,7 @@ async def test_list_preference_sets_flattened_error_async(): def test_list_preference_sets_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -10480,7 +10470,7 @@ def test_list_preference_sets_pager(transport_name: str = "grpc"): def test_list_preference_sets_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -10524,7 +10514,7 @@ def test_list_preference_sets_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_preference_sets_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10576,7 +10566,7 @@ async def test_list_preference_sets_async_pager(): @pytest.mark.asyncio async def test_list_preference_sets_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10633,7 +10623,7 @@ async def test_list_preference_sets_async_pages(): ) def test_get_preference_set(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10669,7 +10659,7 @@ def test_get_preference_set_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10689,7 +10679,7 @@ async def test_get_preference_set_async( request_type=migrationcenter.GetPreferenceSetRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10730,7 +10720,7 @@ async def test_get_preference_set_async_from_dict(): def test_get_preference_set_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10762,7 +10752,7 @@ def test_get_preference_set_field_headers(): @pytest.mark.asyncio async def test_get_preference_set_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10795,7 +10785,7 @@ async def test_get_preference_set_field_headers_async(): def test_get_preference_set_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10821,7 +10811,7 @@ def test_get_preference_set_flattened(): def test_get_preference_set_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10836,7 +10826,7 @@ def test_get_preference_set_flattened_error(): @pytest.mark.asyncio async def test_get_preference_set_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10867,7 +10857,7 @@ async def test_get_preference_set_flattened_async(): @pytest.mark.asyncio async def test_get_preference_set_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10888,7 +10878,7 @@ async def test_get_preference_set_flattened_error_async(): ) def test_create_preference_set(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10917,7 +10907,7 @@ def test_create_preference_set_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10937,7 +10927,7 @@ async def test_create_preference_set_async( request_type=migrationcenter.CreatePreferenceSetRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10971,7 +10961,7 @@ async def test_create_preference_set_async_from_dict(): def test_create_preference_set_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11003,7 +10993,7 @@ def test_create_preference_set_field_headers(): @pytest.mark.asyncio async def test_create_preference_set_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11036,7 +11026,7 @@ async def test_create_preference_set_field_headers_async(): def test_create_preference_set_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11070,7 +11060,7 @@ def test_create_preference_set_flattened(): def test_create_preference_set_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11087,7 +11077,7 @@ def test_create_preference_set_flattened_error(): @pytest.mark.asyncio async def test_create_preference_set_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11126,7 +11116,7 @@ async def test_create_preference_set_flattened_async(): @pytest.mark.asyncio async def test_create_preference_set_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11149,7 +11139,7 @@ async def test_create_preference_set_flattened_error_async(): ) def test_update_preference_set(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11178,7 +11168,7 @@ def test_update_preference_set_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11198,7 +11188,7 @@ async def test_update_preference_set_async( request_type=migrationcenter.UpdatePreferenceSetRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11232,7 +11222,7 @@ async def test_update_preference_set_async_from_dict(): def test_update_preference_set_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11264,7 +11254,7 @@ def test_update_preference_set_field_headers(): @pytest.mark.asyncio async def test_update_preference_set_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11297,7 +11287,7 @@ async def test_update_preference_set_field_headers_async(): def test_update_preference_set_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11327,7 +11317,7 @@ def test_update_preference_set_flattened(): def test_update_preference_set_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11343,7 +11333,7 @@ def test_update_preference_set_flattened_error(): @pytest.mark.asyncio async def test_update_preference_set_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11378,7 +11368,7 @@ async def test_update_preference_set_flattened_async(): @pytest.mark.asyncio async def test_update_preference_set_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11400,7 +11390,7 @@ async def test_update_preference_set_flattened_error_async(): ) def test_delete_preference_set(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11429,7 +11419,7 @@ def test_delete_preference_set_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11449,7 +11439,7 @@ async def test_delete_preference_set_async( request_type=migrationcenter.DeletePreferenceSetRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11483,7 +11473,7 @@ async def test_delete_preference_set_async_from_dict(): def test_delete_preference_set_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11515,7 +11505,7 @@ def test_delete_preference_set_field_headers(): @pytest.mark.asyncio async def test_delete_preference_set_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11548,7 +11538,7 @@ async def test_delete_preference_set_field_headers_async(): def test_delete_preference_set_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11574,7 +11564,7 @@ def test_delete_preference_set_flattened(): def test_delete_preference_set_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11589,7 +11579,7 @@ def test_delete_preference_set_flattened_error(): @pytest.mark.asyncio async def test_delete_preference_set_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11620,7 +11610,7 @@ async def test_delete_preference_set_flattened_async(): @pytest.mark.asyncio async def test_delete_preference_set_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11641,7 +11631,7 @@ async def test_delete_preference_set_flattened_error_async(): ) def test_get_settings(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11673,7 +11663,7 @@ def test_get_settings_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11690,7 +11680,7 @@ async def test_get_settings_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetSettingsRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11727,7 +11717,7 @@ async def test_get_settings_async_from_dict(): def test_get_settings_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11757,7 +11747,7 @@ def test_get_settings_field_headers(): @pytest.mark.asyncio async def test_get_settings_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11788,7 +11778,7 @@ async def test_get_settings_field_headers_async(): def test_get_settings_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11812,7 +11802,7 @@ def test_get_settings_flattened(): def test_get_settings_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11827,7 +11817,7 @@ def test_get_settings_flattened_error(): @pytest.mark.asyncio async def test_get_settings_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11856,7 +11846,7 @@ async def test_get_settings_flattened_async(): @pytest.mark.asyncio async def test_get_settings_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11877,7 +11867,7 @@ async def test_get_settings_flattened_error_async(): ) def test_update_settings(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11904,7 +11894,7 @@ def test_update_settings_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11921,7 +11911,7 @@ async def test_update_settings_async( transport: str = "grpc_asyncio", request_type=migrationcenter.UpdateSettingsRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11953,7 +11943,7 @@ async def test_update_settings_async_from_dict(): def test_update_settings_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11983,7 +11973,7 @@ def test_update_settings_field_headers(): @pytest.mark.asyncio async def test_update_settings_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12014,7 +12004,7 @@ async def test_update_settings_field_headers_async(): def test_update_settings_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12042,7 +12032,7 @@ def test_update_settings_flattened(): def test_update_settings_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12058,7 +12048,7 @@ def test_update_settings_flattened_error(): @pytest.mark.asyncio async def test_update_settings_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12091,7 +12081,7 @@ async def test_update_settings_flattened_async(): @pytest.mark.asyncio async def test_update_settings_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12113,7 +12103,7 @@ async def test_update_settings_flattened_error_async(): ) def test_create_report_config(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12142,7 +12132,7 @@ def test_create_report_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -12162,7 +12152,7 @@ async def test_create_report_config_async( request_type=migrationcenter.CreateReportConfigRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12196,7 +12186,7 @@ async def test_create_report_config_async_from_dict(): def test_create_report_config_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12228,7 +12218,7 @@ def test_create_report_config_field_headers(): @pytest.mark.asyncio async def test_create_report_config_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12261,7 +12251,7 @@ async def test_create_report_config_field_headers_async(): def test_create_report_config_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12295,7 +12285,7 @@ def test_create_report_config_flattened(): def test_create_report_config_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12312,7 +12302,7 @@ def test_create_report_config_flattened_error(): @pytest.mark.asyncio async def test_create_report_config_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12351,7 +12341,7 @@ async def test_create_report_config_flattened_async(): @pytest.mark.asyncio async def test_create_report_config_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12374,7 +12364,7 @@ async def test_create_report_config_flattened_error_async(): ) def test_get_report_config(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12410,7 +12400,7 @@ def test_get_report_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -12429,7 +12419,7 @@ async def test_get_report_config_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetReportConfigRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12470,7 +12460,7 @@ async def test_get_report_config_async_from_dict(): def test_get_report_config_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12502,7 +12492,7 @@ def test_get_report_config_field_headers(): @pytest.mark.asyncio async def test_get_report_config_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12535,7 +12525,7 @@ async def test_get_report_config_field_headers_async(): def test_get_report_config_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12561,7 +12551,7 @@ def test_get_report_config_flattened(): def test_get_report_config_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12576,7 +12566,7 @@ def test_get_report_config_flattened_error(): @pytest.mark.asyncio async def test_get_report_config_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12607,7 +12597,7 @@ async def test_get_report_config_flattened_async(): @pytest.mark.asyncio async def test_get_report_config_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12628,7 +12618,7 @@ async def test_get_report_config_flattened_error_async(): ) def test_list_report_configs(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12662,7 +12652,7 @@ def test_list_report_configs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -12682,7 +12672,7 @@ async def test_list_report_configs_async( request_type=migrationcenter.ListReportConfigsRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12721,7 +12711,7 @@ async def test_list_report_configs_async_from_dict(): def test_list_report_configs_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12753,7 +12743,7 @@ def test_list_report_configs_field_headers(): @pytest.mark.asyncio async def test_list_report_configs_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12786,7 +12776,7 @@ async def test_list_report_configs_field_headers_async(): def test_list_report_configs_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12812,7 +12802,7 @@ def test_list_report_configs_flattened(): def test_list_report_configs_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12827,7 +12817,7 @@ def test_list_report_configs_flattened_error(): @pytest.mark.asyncio async def test_list_report_configs_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12858,7 +12848,7 @@ async def test_list_report_configs_flattened_async(): @pytest.mark.asyncio async def test_list_report_configs_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12872,7 +12862,7 @@ async def test_list_report_configs_flattened_error_async(): def test_list_report_configs_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -12924,7 +12914,7 @@ def test_list_report_configs_pager(transport_name: str = "grpc"): def test_list_report_configs_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -12968,7 +12958,7 @@ def test_list_report_configs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_report_configs_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13020,7 +13010,7 @@ async def test_list_report_configs_async_pager(): @pytest.mark.asyncio async def test_list_report_configs_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13077,7 +13067,7 @@ async def test_list_report_configs_async_pages(): ) def test_delete_report_config(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13106,7 +13096,7 @@ def test_delete_report_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13126,7 +13116,7 @@ async def test_delete_report_config_async( request_type=migrationcenter.DeleteReportConfigRequest, ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13160,7 +13150,7 @@ async def test_delete_report_config_async_from_dict(): def test_delete_report_config_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13192,7 +13182,7 @@ def test_delete_report_config_field_headers(): @pytest.mark.asyncio async def test_delete_report_config_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13225,7 +13215,7 @@ async def test_delete_report_config_field_headers_async(): def test_delete_report_config_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13251,7 +13241,7 @@ def test_delete_report_config_flattened(): def test_delete_report_config_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13266,7 +13256,7 @@ def test_delete_report_config_flattened_error(): @pytest.mark.asyncio async def test_delete_report_config_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13297,7 +13287,7 @@ async def test_delete_report_config_flattened_async(): @pytest.mark.asyncio async def test_delete_report_config_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13318,7 +13308,7 @@ async def test_delete_report_config_flattened_error_async(): ) def test_create_report(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13345,7 +13335,7 @@ def test_create_report_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13362,7 +13352,7 @@ async def test_create_report_async( transport: str = "grpc_asyncio", request_type=migrationcenter.CreateReportRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13394,7 +13384,7 @@ async def test_create_report_async_from_dict(): def test_create_report_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13424,7 +13414,7 @@ def test_create_report_field_headers(): @pytest.mark.asyncio async def test_create_report_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13455,7 +13445,7 @@ async def test_create_report_field_headers_async(): def test_create_report_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13487,7 +13477,7 @@ def test_create_report_flattened(): def test_create_report_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13504,7 +13494,7 @@ def test_create_report_flattened_error(): @pytest.mark.asyncio async def test_create_report_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13541,7 +13531,7 @@ async def test_create_report_flattened_async(): @pytest.mark.asyncio async def test_create_report_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13564,7 +13554,7 @@ async def test_create_report_flattened_error_async(): ) def test_get_report(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13602,7 +13592,7 @@ def test_get_report_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13619,7 +13609,7 @@ async def test_get_report_async( transport: str = "grpc_asyncio", request_type=migrationcenter.GetReportRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13662,7 +13652,7 @@ async def test_get_report_async_from_dict(): def test_get_report_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13692,7 +13682,7 @@ def test_get_report_field_headers(): @pytest.mark.asyncio async def test_get_report_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13723,7 +13713,7 @@ async def test_get_report_field_headers_async(): def test_get_report_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13747,7 +13737,7 @@ def test_get_report_flattened(): def test_get_report_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13762,7 +13752,7 @@ def test_get_report_flattened_error(): @pytest.mark.asyncio async def test_get_report_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13791,7 +13781,7 @@ async def test_get_report_flattened_async(): @pytest.mark.asyncio async def test_get_report_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13812,7 +13802,7 @@ async def test_get_report_flattened_error_async(): ) def test_list_reports(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13844,7 +13834,7 @@ def test_list_reports_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13861,7 +13851,7 @@ async def test_list_reports_async( transport: str = "grpc_asyncio", request_type=migrationcenter.ListReportsRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13898,7 +13888,7 @@ async def test_list_reports_async_from_dict(): def test_list_reports_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13928,7 +13918,7 @@ def test_list_reports_field_headers(): @pytest.mark.asyncio async def test_list_reports_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13959,7 +13949,7 @@ async def test_list_reports_field_headers_async(): def test_list_reports_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13983,7 +13973,7 @@ def test_list_reports_flattened(): def test_list_reports_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13998,7 +13988,7 @@ def test_list_reports_flattened_error(): @pytest.mark.asyncio async def test_list_reports_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14027,7 +14017,7 @@ async def test_list_reports_flattened_async(): @pytest.mark.asyncio async def test_list_reports_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14041,7 +14031,7 @@ async def test_list_reports_flattened_error_async(): def test_list_reports_pager(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -14091,7 +14081,7 @@ def test_list_reports_pager(transport_name: str = "grpc"): def test_list_reports_pages(transport_name: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -14133,7 +14123,7 @@ def test_list_reports_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_reports_async_pager(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14183,7 +14173,7 @@ async def test_list_reports_async_pager(): @pytest.mark.asyncio async def test_list_reports_async_pages(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14238,7 +14228,7 @@ async def test_list_reports_async_pages(): ) def test_delete_report(request_type, transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14265,7 +14255,7 @@ def test_delete_report_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -14282,7 +14272,7 @@ async def test_delete_report_async( transport: str = "grpc_asyncio", request_type=migrationcenter.DeleteReportRequest ): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14314,7 +14304,7 @@ async def test_delete_report_async_from_dict(): def test_delete_report_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14344,7 +14334,7 @@ def test_delete_report_field_headers(): @pytest.mark.asyncio async def test_delete_report_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14375,7 +14365,7 @@ async def test_delete_report_field_headers_async(): def test_delete_report_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14399,7 +14389,7 @@ def test_delete_report_flattened(): def test_delete_report_flattened_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14414,7 +14404,7 @@ def test_delete_report_flattened_error(): @pytest.mark.asyncio async def test_delete_report_flattened_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14443,7 +14433,7 @@ async def test_delete_report_flattened_async(): @pytest.mark.asyncio async def test_delete_report_flattened_error_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14464,7 +14454,7 @@ async def test_delete_report_flattened_error_async(): ) def test_list_assets_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14517,7 +14507,7 @@ def test_list_assets_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_assets._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -14526,7 +14516,7 @@ def test_list_assets_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_assets._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -14545,7 +14535,7 @@ def test_list_assets_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -14587,7 +14577,7 @@ def test_list_assets_rest_required_fields( def test_list_assets_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_assets._get_unset_required_fields({}) @@ -14608,7 +14598,7 @@ def test_list_assets_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_assets_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -14666,7 +14656,7 @@ def test_list_assets_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListAssetsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14688,7 +14678,7 @@ def test_list_assets_rest_bad_request( def test_list_assets_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14729,7 +14719,7 @@ def test_list_assets_rest_flattened(): def test_list_assets_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14744,7 +14734,7 @@ def test_list_assets_rest_flattened_error(transport: str = "rest"): def test_list_assets_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14814,7 +14804,7 @@ def test_list_assets_rest_pager(transport: str = "rest"): ) def test_get_asset_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14867,7 +14857,7 @@ def test_get_asset_rest_required_fields(request_type=migrationcenter.GetAssetReq # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_asset._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -14876,7 +14866,7 @@ def test_get_asset_rest_required_fields(request_type=migrationcenter.GetAssetReq jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_asset._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("view",)) @@ -14887,7 +14877,7 @@ def test_get_asset_rest_required_fields(request_type=migrationcenter.GetAssetReq assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -14929,7 +14919,7 @@ def test_get_asset_rest_required_fields(request_type=migrationcenter.GetAssetReq def test_get_asset_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_asset._get_unset_required_fields({}) @@ -14939,7 +14929,7 @@ def test_get_asset_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_asset_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -14997,7 +14987,7 @@ def test_get_asset_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetAssetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15019,7 +15009,7 @@ def test_get_asset_rest_bad_request( def test_get_asset_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15060,7 +15050,7 @@ def test_get_asset_rest_flattened(): def test_get_asset_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15075,7 +15065,7 @@ def test_get_asset_rest_flattened_error(transport: str = "rest"): def test_get_asset_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -15088,7 +15078,7 @@ def test_get_asset_rest_error(): ) def test_update_asset_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15477,14 +15467,14 @@ def test_update_asset_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_asset._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_asset._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -15498,7 +15488,7 @@ def test_update_asset_rest_required_fields( # verify required fields with non-default values are left alone client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15541,7 +15531,7 @@ def test_update_asset_rest_required_fields( def test_update_asset_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_asset._get_unset_required_fields({}) @@ -15564,7 +15554,7 @@ def test_update_asset_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_asset_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -15622,7 +15612,7 @@ def test_update_asset_rest_bad_request( transport: str = "rest", request_type=migrationcenter.UpdateAssetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15646,7 +15636,7 @@ def test_update_asset_rest_bad_request( def test_update_asset_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15691,7 +15681,7 @@ def test_update_asset_rest_flattened(): def test_update_asset_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15707,7 +15697,7 @@ def test_update_asset_rest_flattened_error(transport: str = "rest"): def test_update_asset_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -15720,7 +15710,7 @@ def test_update_asset_rest_error(): ) def test_batch_update_assets_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15768,7 +15758,7 @@ def test_batch_update_assets_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).batch_update_assets._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15777,7 +15767,7 @@ def test_batch_update_assets_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).batch_update_assets._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15786,7 +15776,7 @@ def test_batch_update_assets_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15829,7 +15819,7 @@ def test_batch_update_assets_rest_required_fields( def test_batch_update_assets_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.batch_update_assets._get_unset_required_fields({}) @@ -15847,7 +15837,7 @@ def test_batch_update_assets_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_batch_update_assets_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -15905,7 +15895,7 @@ def test_batch_update_assets_rest_bad_request( transport: str = "rest", request_type=migrationcenter.BatchUpdateAssetsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15927,7 +15917,7 @@ def test_batch_update_assets_rest_bad_request( def test_batch_update_assets_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15974,7 +15964,7 @@ def test_batch_update_assets_rest_flattened(): def test_batch_update_assets_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15994,7 +15984,7 @@ def test_batch_update_assets_rest_flattened_error(transport: str = "rest"): def test_batch_update_assets_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16007,7 +15997,7 @@ def test_batch_update_assets_rest_error(): ) def test_delete_asset_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16053,7 +16043,7 @@ def test_delete_asset_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_asset._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16062,7 +16052,7 @@ def test_delete_asset_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_asset._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -16073,7 +16063,7 @@ def test_delete_asset_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16112,7 +16102,7 @@ def test_delete_asset_rest_required_fields( def test_delete_asset_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_asset._get_unset_required_fields({}) @@ -16122,7 +16112,7 @@ def test_delete_asset_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_asset_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -16172,7 +16162,7 @@ def test_delete_asset_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteAssetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16194,7 +16184,7 @@ def test_delete_asset_rest_bad_request( def test_delete_asset_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16233,7 +16223,7 @@ def test_delete_asset_rest_flattened(): def test_delete_asset_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16248,7 +16238,7 @@ def test_delete_asset_rest_flattened_error(transport: str = "rest"): def test_delete_asset_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16261,7 +16251,7 @@ def test_delete_asset_rest_error(): ) def test_batch_delete_assets_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16308,7 +16298,7 @@ def test_batch_delete_assets_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).batch_delete_assets._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16318,7 +16308,7 @@ def test_batch_delete_assets_rest_required_fields( jsonified_request["names"] = "names_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).batch_delete_assets._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16329,7 +16319,7 @@ def test_batch_delete_assets_rest_required_fields( assert jsonified_request["names"] == "names_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16369,7 +16359,7 @@ def test_batch_delete_assets_rest_required_fields( def test_batch_delete_assets_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.batch_delete_assets._get_unset_required_fields({}) @@ -16387,7 +16377,7 @@ def test_batch_delete_assets_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_batch_delete_assets_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -16437,7 +16427,7 @@ def test_batch_delete_assets_rest_bad_request( transport: str = "rest", request_type=migrationcenter.BatchDeleteAssetsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16459,7 +16449,7 @@ def test_batch_delete_assets_rest_bad_request( def test_batch_delete_assets_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16500,7 +16490,7 @@ def test_batch_delete_assets_rest_flattened(): def test_batch_delete_assets_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16516,7 +16506,7 @@ def test_batch_delete_assets_rest_flattened_error(transport: str = "rest"): def test_batch_delete_assets_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16529,7 +16519,7 @@ def test_batch_delete_assets_rest_error(): ) def test_report_asset_frames_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16879,7 +16869,7 @@ def test_report_asset_frames_rest_required_fields( assert "source" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).report_asset_frames._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16891,7 +16881,7 @@ def test_report_asset_frames_rest_required_fields( jsonified_request["source"] = "source_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).report_asset_frames._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("source",)) @@ -16904,7 +16894,7 @@ def test_report_asset_frames_rest_required_fields( assert jsonified_request["source"] == "source_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16953,7 +16943,7 @@ def test_report_asset_frames_rest_required_fields( def test_report_asset_frames_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.report_asset_frames._get_unset_required_fields({}) @@ -16971,7 +16961,7 @@ def test_report_asset_frames_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_report_asset_frames_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -17029,7 +17019,7 @@ def test_report_asset_frames_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ReportAssetFramesRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17051,7 +17041,7 @@ def test_report_asset_frames_rest_bad_request( def test_report_asset_frames_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17064,7 +17054,7 @@ def test_report_asset_frames_rest_error(): ) def test_aggregate_assets_values_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17112,7 +17102,7 @@ def test_aggregate_assets_values_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).aggregate_assets_values._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17121,7 +17111,7 @@ def test_aggregate_assets_values_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).aggregate_assets_values._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17130,7 +17120,7 @@ def test_aggregate_assets_values_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17175,7 +17165,7 @@ def test_aggregate_assets_values_rest_required_fields( def test_aggregate_assets_values_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.aggregate_assets_values._get_unset_required_fields({}) @@ -17185,7 +17175,7 @@ def test_aggregate_assets_values_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_aggregate_assets_values_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -17245,7 +17235,7 @@ def test_aggregate_assets_values_rest_bad_request( transport: str = "rest", request_type=migrationcenter.AggregateAssetsValuesRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17267,7 +17257,7 @@ def test_aggregate_assets_values_rest_bad_request( def test_aggregate_assets_values_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17280,7 +17270,7 @@ def test_aggregate_assets_values_rest_error(): ) def test_create_import_job_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17430,7 +17420,7 @@ def test_create_import_job_rest_required_fields( assert "importJobId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17442,7 +17432,7 @@ def test_create_import_job_rest_required_fields( jsonified_request["importJobId"] = "import_job_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_import_job._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -17460,7 +17450,7 @@ def test_create_import_job_rest_required_fields( assert jsonified_request["importJobId"] == "import_job_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17506,7 +17496,7 @@ def test_create_import_job_rest_required_fields( def test_create_import_job_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_import_job._get_unset_required_fields({}) @@ -17530,7 +17520,7 @@ def test_create_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_import_job_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -17590,7 +17580,7 @@ def test_create_import_job_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreateImportJobRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17612,7 +17602,7 @@ def test_create_import_job_rest_bad_request( def test_create_import_job_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17653,7 +17643,7 @@ def test_create_import_job_rest_flattened(): def test_create_import_job_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17670,7 +17660,7 @@ def test_create_import_job_rest_flattened_error(transport: str = "rest"): def test_create_import_job_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17683,7 +17673,7 @@ def test_create_import_job_rest_error(): ) def test_list_import_jobs_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17736,7 +17726,7 @@ def test_list_import_jobs_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_import_jobs._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17745,7 +17735,7 @@ def test_list_import_jobs_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_import_jobs._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -17764,7 +17754,7 @@ def test_list_import_jobs_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17806,7 +17796,7 @@ def test_list_import_jobs_rest_required_fields( def test_list_import_jobs_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_import_jobs._get_unset_required_fields({}) @@ -17827,7 +17817,7 @@ def test_list_import_jobs_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_import_jobs_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -17885,7 +17875,7 @@ def test_list_import_jobs_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListImportJobsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17907,7 +17897,7 @@ def test_list_import_jobs_rest_bad_request( def test_list_import_jobs_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17948,7 +17938,7 @@ def test_list_import_jobs_rest_flattened(): def test_list_import_jobs_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17963,7 +17953,7 @@ def test_list_import_jobs_rest_flattened_error(transport: str = "rest"): def test_list_import_jobs_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18033,7 +18023,7 @@ def test_list_import_jobs_rest_pager(transport: str = "rest"): ) def test_get_import_job_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18093,7 +18083,7 @@ def test_get_import_job_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -18102,7 +18092,7 @@ def test_get_import_job_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_import_job._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("view",)) @@ -18113,7 +18103,7 @@ def test_get_import_job_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18155,7 +18145,7 @@ def test_get_import_job_rest_required_fields( def test_get_import_job_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_import_job._get_unset_required_fields({}) @@ -18165,7 +18155,7 @@ def test_get_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_import_job_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -18223,7 +18213,7 @@ def test_get_import_job_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetImportJobRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18245,7 +18235,7 @@ def test_get_import_job_rest_bad_request( def test_get_import_job_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18288,7 +18278,7 @@ def test_get_import_job_rest_flattened(): def test_get_import_job_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18303,7 +18293,7 @@ def test_get_import_job_rest_flattened_error(transport: str = "rest"): def test_get_import_job_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -18316,7 +18306,7 @@ def test_get_import_job_rest_error(): ) def test_delete_import_job_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18362,7 +18352,7 @@ def test_delete_import_job_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -18371,7 +18361,7 @@ def test_delete_import_job_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_import_job._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -18387,7 +18377,7 @@ def test_delete_import_job_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18426,7 +18416,7 @@ def test_delete_import_job_rest_required_fields( def test_delete_import_job_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_import_job._get_unset_required_fields({}) @@ -18444,7 +18434,7 @@ def test_delete_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_import_job_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -18504,7 +18494,7 @@ def test_delete_import_job_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteImportJobRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18526,7 +18516,7 @@ def test_delete_import_job_rest_bad_request( def test_delete_import_job_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18567,7 +18557,7 @@ def test_delete_import_job_rest_flattened(): def test_delete_import_job_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18582,7 +18572,7 @@ def test_delete_import_job_rest_flattened_error(transport: str = "rest"): def test_delete_import_job_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -18595,7 +18585,7 @@ def test_delete_import_job_rest_error(): ) def test_update_import_job_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18744,14 +18734,14 @@ def test_update_import_job_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_import_job._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -18765,7 +18755,7 @@ def test_update_import_job_rest_required_fields( # verify required fields with non-default values are left alone client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18805,7 +18795,7 @@ def test_update_import_job_rest_required_fields( def test_update_import_job_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_import_job._get_unset_required_fields({}) @@ -18828,7 +18818,7 @@ def test_update_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_import_job_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -18888,7 +18878,7 @@ def test_update_import_job_rest_bad_request( transport: str = "rest", request_type=migrationcenter.UpdateImportJobRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18912,7 +18902,7 @@ def test_update_import_job_rest_bad_request( def test_update_import_job_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18957,7 +18947,7 @@ def test_update_import_job_rest_flattened(): def test_update_import_job_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18973,7 +18963,7 @@ def test_update_import_job_rest_flattened_error(transport: str = "rest"): def test_update_import_job_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -18986,7 +18976,7 @@ def test_update_import_job_rest_error(): ) def test_validate_import_job_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19032,7 +19022,7 @@ def test_validate_import_job_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).validate_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19041,7 +19031,7 @@ def test_validate_import_job_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).validate_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19050,7 +19040,7 @@ def test_validate_import_job_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19090,7 +19080,7 @@ def test_validate_import_job_rest_required_fields( def test_validate_import_job_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.validate_import_job._get_unset_required_fields({}) @@ -19100,7 +19090,7 @@ def test_validate_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_validate_import_job_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -19160,7 +19150,7 @@ def test_validate_import_job_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ValidateImportJobRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19182,7 +19172,7 @@ def test_validate_import_job_rest_bad_request( def test_validate_import_job_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19224,7 +19214,7 @@ def test_validate_import_job_rest_flattened(): def test_validate_import_job_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19239,7 +19229,7 @@ def test_validate_import_job_rest_flattened_error(transport: str = "rest"): def test_validate_import_job_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19252,7 +19242,7 @@ def test_validate_import_job_rest_error(): ) def test_run_import_job_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19298,7 +19288,7 @@ def test_run_import_job_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).run_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19307,7 +19297,7 @@ def test_run_import_job_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).run_import_job._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19316,7 +19306,7 @@ def test_run_import_job_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19356,7 +19346,7 @@ def test_run_import_job_rest_required_fields( def test_run_import_job_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.run_import_job._get_unset_required_fields({}) @@ -19366,7 +19356,7 @@ def test_run_import_job_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_run_import_job_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -19426,7 +19416,7 @@ def test_run_import_job_rest_bad_request( transport: str = "rest", request_type=migrationcenter.RunImportJobRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19448,7 +19438,7 @@ def test_run_import_job_rest_bad_request( def test_run_import_job_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19490,7 +19480,7 @@ def test_run_import_job_rest_flattened(): def test_run_import_job_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19505,7 +19495,7 @@ def test_run_import_job_rest_flattened_error(transport: str = "rest"): def test_run_import_job_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19518,7 +19508,7 @@ def test_run_import_job_rest_error(): ) def test_get_import_data_file_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19580,7 +19570,7 @@ def test_get_import_data_file_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_import_data_file._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19589,7 +19579,7 @@ def test_get_import_data_file_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_import_data_file._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19598,7 +19588,7 @@ def test_get_import_data_file_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19640,7 +19630,7 @@ def test_get_import_data_file_rest_required_fields( def test_get_import_data_file_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_import_data_file._get_unset_required_fields({}) @@ -19650,7 +19640,7 @@ def test_get_import_data_file_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_import_data_file_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -19708,7 +19698,7 @@ def test_get_import_data_file_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetImportDataFileRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19732,7 +19722,7 @@ def test_get_import_data_file_rest_bad_request( def test_get_import_data_file_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19776,7 +19766,7 @@ def test_get_import_data_file_rest_flattened(): def test_get_import_data_file_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19791,7 +19781,7 @@ def test_get_import_data_file_rest_flattened_error(transport: str = "rest"): def test_get_import_data_file_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19804,7 +19794,7 @@ def test_get_import_data_file_rest_error(): ) def test_list_import_data_files_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19857,7 +19847,7 @@ def test_list_import_data_files_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_import_data_files._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19866,7 +19856,7 @@ def test_list_import_data_files_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_import_data_files._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -19884,7 +19874,7 @@ def test_list_import_data_files_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19926,7 +19916,7 @@ def test_list_import_data_files_rest_required_fields( def test_list_import_data_files_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_import_data_files._get_unset_required_fields({}) @@ -19946,7 +19936,7 @@ def test_list_import_data_files_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_import_data_files_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -20004,7 +19994,7 @@ def test_list_import_data_files_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListImportDataFilesRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20026,7 +20016,7 @@ def test_list_import_data_files_rest_bad_request( def test_list_import_data_files_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20070,7 +20060,7 @@ def test_list_import_data_files_rest_flattened(): def test_list_import_data_files_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20085,7 +20075,7 @@ def test_list_import_data_files_rest_flattened_error(transport: str = "rest"): def test_list_import_data_files_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20157,7 +20147,7 @@ def test_list_import_data_files_rest_pager(transport: str = "rest"): ) def test_create_import_data_file_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20286,7 +20276,7 @@ def test_create_import_data_file_rest_required_fields( assert "importDataFileId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_import_data_file._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -20298,7 +20288,7 @@ def test_create_import_data_file_rest_required_fields( jsonified_request["importDataFileId"] = "import_data_file_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_import_data_file._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -20316,7 +20306,7 @@ def test_create_import_data_file_rest_required_fields( assert jsonified_request["importDataFileId"] == "import_data_file_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -20362,7 +20352,7 @@ def test_create_import_data_file_rest_required_fields( def test_create_import_data_file_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_import_data_file._get_unset_required_fields({}) @@ -20386,7 +20376,7 @@ def test_create_import_data_file_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_import_data_file_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -20446,7 +20436,7 @@ def test_create_import_data_file_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreateImportDataFileRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20468,7 +20458,7 @@ def test_create_import_data_file_rest_bad_request( def test_create_import_data_file_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20512,7 +20502,7 @@ def test_create_import_data_file_rest_flattened(): def test_create_import_data_file_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20529,7 +20519,7 @@ def test_create_import_data_file_rest_flattened_error(transport: str = "rest"): def test_create_import_data_file_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20542,7 +20532,7 @@ def test_create_import_data_file_rest_error(): ) def test_delete_import_data_file_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20590,7 +20580,7 @@ def test_delete_import_data_file_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_import_data_file._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -20599,7 +20589,7 @@ def test_delete_import_data_file_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_import_data_file._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -20610,7 +20600,7 @@ def test_delete_import_data_file_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -20649,7 +20639,7 @@ def test_delete_import_data_file_rest_required_fields( def test_delete_import_data_file_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_import_data_file._get_unset_required_fields({}) @@ -20659,7 +20649,7 @@ def test_delete_import_data_file_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_import_data_file_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -20719,7 +20709,7 @@ def test_delete_import_data_file_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteImportDataFileRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20743,7 +20733,7 @@ def test_delete_import_data_file_rest_bad_request( def test_delete_import_data_file_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20785,7 +20775,7 @@ def test_delete_import_data_file_rest_flattened(): def test_delete_import_data_file_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20800,7 +20790,7 @@ def test_delete_import_data_file_rest_flattened_error(transport: str = "rest"): def test_delete_import_data_file_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20813,7 +20803,7 @@ def test_delete_import_data_file_rest_error(): ) def test_list_groups_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20866,7 +20856,7 @@ def test_list_groups_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_groups._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -20875,7 +20865,7 @@ def test_list_groups_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_groups._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -20893,7 +20883,7 @@ def test_list_groups_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -20935,7 +20925,7 @@ def test_list_groups_rest_required_fields( def test_list_groups_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_groups._get_unset_required_fields({}) @@ -20955,7 +20945,7 @@ def test_list_groups_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_groups_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -21013,7 +21003,7 @@ def test_list_groups_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListGroupsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21035,7 +21025,7 @@ def test_list_groups_rest_bad_request( def test_list_groups_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21076,7 +21066,7 @@ def test_list_groups_rest_flattened(): def test_list_groups_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21091,7 +21081,7 @@ def test_list_groups_rest_flattened_error(transport: str = "rest"): def test_list_groups_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21161,7 +21151,7 @@ def test_list_groups_rest_pager(transport: str = "rest"): ) def test_get_group_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21214,7 +21204,7 @@ def test_get_group_rest_required_fields(request_type=migrationcenter.GetGroupReq # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -21223,7 +21213,7 @@ def test_get_group_rest_required_fields(request_type=migrationcenter.GetGroupReq jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -21232,7 +21222,7 @@ def test_get_group_rest_required_fields(request_type=migrationcenter.GetGroupReq assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -21274,7 +21264,7 @@ def test_get_group_rest_required_fields(request_type=migrationcenter.GetGroupReq def test_get_group_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_group._get_unset_required_fields({}) @@ -21284,7 +21274,7 @@ def test_get_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_group_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -21342,7 +21332,7 @@ def test_get_group_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetGroupRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21364,7 +21354,7 @@ def test_get_group_rest_bad_request( def test_get_group_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21405,7 +21395,7 @@ def test_get_group_rest_flattened(): def test_get_group_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21420,7 +21410,7 @@ def test_get_group_rest_flattened_error(transport: str = "rest"): def test_get_group_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21433,7 +21423,7 @@ def test_get_group_rest_error(): ) def test_create_group_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21556,7 +21546,7 @@ def test_create_group_rest_required_fields( assert "groupId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -21568,7 +21558,7 @@ def test_create_group_rest_required_fields( jsonified_request["groupId"] = "group_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_group._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -21586,7 +21576,7 @@ def test_create_group_rest_required_fields( assert jsonified_request["groupId"] == "group_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -21632,7 +21622,7 @@ def test_create_group_rest_required_fields( def test_create_group_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_group._get_unset_required_fields({}) @@ -21656,7 +21646,7 @@ def test_create_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_group_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -21716,7 +21706,7 @@ def test_create_group_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreateGroupRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21738,7 +21728,7 @@ def test_create_group_rest_bad_request( def test_create_group_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21779,7 +21769,7 @@ def test_create_group_rest_flattened(): def test_create_group_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21796,7 +21786,7 @@ def test_create_group_rest_flattened_error(transport: str = "rest"): def test_create_group_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21809,7 +21799,7 @@ def test_create_group_rest_error(): ) def test_update_group_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21931,14 +21921,14 @@ def test_update_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_group._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -21952,7 +21942,7 @@ def test_update_group_rest_required_fields( # verify required fields with non-default values are left alone client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -21992,7 +21982,7 @@ def test_update_group_rest_required_fields( def test_update_group_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_group._get_unset_required_fields({}) @@ -22015,7 +22005,7 @@ def test_update_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_group_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -22075,7 +22065,7 @@ def test_update_group_rest_bad_request( transport: str = "rest", request_type=migrationcenter.UpdateGroupRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22099,7 +22089,7 @@ def test_update_group_rest_bad_request( def test_update_group_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22142,7 +22132,7 @@ def test_update_group_rest_flattened(): def test_update_group_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22158,7 +22148,7 @@ def test_update_group_rest_flattened_error(transport: str = "rest"): def test_update_group_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22171,7 +22161,7 @@ def test_update_group_rest_error(): ) def test_delete_group_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22217,7 +22207,7 @@ def test_delete_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22226,7 +22216,7 @@ def test_delete_group_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_group._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -22237,7 +22227,7 @@ def test_delete_group_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -22276,7 +22266,7 @@ def test_delete_group_rest_required_fields( def test_delete_group_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_group._get_unset_required_fields({}) @@ -22286,7 +22276,7 @@ def test_delete_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_group_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -22346,7 +22336,7 @@ def test_delete_group_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteGroupRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22368,7 +22358,7 @@ def test_delete_group_rest_bad_request( def test_delete_group_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22407,7 +22397,7 @@ def test_delete_group_rest_flattened(): def test_delete_group_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22422,7 +22412,7 @@ def test_delete_group_rest_flattened_error(transport: str = "rest"): def test_delete_group_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22435,7 +22425,7 @@ def test_delete_group_rest_error(): ) def test_add_assets_to_group_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22481,7 +22471,7 @@ def test_add_assets_to_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).add_assets_to_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22490,7 +22480,7 @@ def test_add_assets_to_group_rest_required_fields( jsonified_request["group"] = "group_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).add_assets_to_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22499,7 +22489,7 @@ def test_add_assets_to_group_rest_required_fields( assert jsonified_request["group"] == "group_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -22539,7 +22529,7 @@ def test_add_assets_to_group_rest_required_fields( def test_add_assets_to_group_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.add_assets_to_group._get_unset_required_fields({}) @@ -22557,7 +22547,7 @@ def test_add_assets_to_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_add_assets_to_group_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -22617,7 +22607,7 @@ def test_add_assets_to_group_rest_bad_request( transport: str = "rest", request_type=migrationcenter.AddAssetsToGroupRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22639,7 +22629,7 @@ def test_add_assets_to_group_rest_bad_request( def test_add_assets_to_group_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22679,7 +22669,7 @@ def test_add_assets_to_group_rest_flattened(): def test_add_assets_to_group_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22694,7 +22684,7 @@ def test_add_assets_to_group_rest_flattened_error(transport: str = "rest"): def test_add_assets_to_group_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22707,7 +22697,7 @@ def test_add_assets_to_group_rest_error(): ) def test_remove_assets_from_group_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22753,7 +22743,7 @@ def test_remove_assets_from_group_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).remove_assets_from_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22762,7 +22752,7 @@ def test_remove_assets_from_group_rest_required_fields( jsonified_request["group"] = "group_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).remove_assets_from_group._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22771,7 +22761,7 @@ def test_remove_assets_from_group_rest_required_fields( assert jsonified_request["group"] == "group_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -22811,7 +22801,7 @@ def test_remove_assets_from_group_rest_required_fields( def test_remove_assets_from_group_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.remove_assets_from_group._get_unset_required_fields({}) @@ -22829,7 +22819,7 @@ def test_remove_assets_from_group_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_remove_assets_from_group_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -22889,7 +22879,7 @@ def test_remove_assets_from_group_rest_bad_request( transport: str = "rest", request_type=migrationcenter.RemoveAssetsFromGroupRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22911,7 +22901,7 @@ def test_remove_assets_from_group_rest_bad_request( def test_remove_assets_from_group_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22951,7 +22941,7 @@ def test_remove_assets_from_group_rest_flattened(): def test_remove_assets_from_group_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22966,7 +22956,7 @@ def test_remove_assets_from_group_rest_flattened_error(transport: str = "rest"): def test_remove_assets_from_group_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22979,7 +22969,7 @@ def test_remove_assets_from_group_rest_error(): ) def test_list_error_frames_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23032,7 +23022,7 @@ def test_list_error_frames_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_error_frames._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23041,7 +23031,7 @@ def test_list_error_frames_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_error_frames._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -23058,7 +23048,7 @@ def test_list_error_frames_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23100,7 +23090,7 @@ def test_list_error_frames_rest_required_fields( def test_list_error_frames_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_error_frames._get_unset_required_fields({}) @@ -23119,7 +23109,7 @@ def test_list_error_frames_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_error_frames_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -23177,7 +23167,7 @@ def test_list_error_frames_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListErrorFramesRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23199,7 +23189,7 @@ def test_list_error_frames_rest_bad_request( def test_list_error_frames_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23243,7 +23233,7 @@ def test_list_error_frames_rest_flattened(): def test_list_error_frames_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23258,7 +23248,7 @@ def test_list_error_frames_rest_flattened_error(transport: str = "rest"): def test_list_error_frames_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23330,7 +23320,7 @@ def test_list_error_frames_rest_pager(transport: str = "rest"): ) def test_get_error_frame_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23383,7 +23373,7 @@ def test_get_error_frame_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_error_frame._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23392,7 +23382,7 @@ def test_get_error_frame_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_error_frame._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("view",)) @@ -23403,7 +23393,7 @@ def test_get_error_frame_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23445,7 +23435,7 @@ def test_get_error_frame_rest_required_fields( def test_get_error_frame_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_error_frame._get_unset_required_fields({}) @@ -23455,7 +23445,7 @@ def test_get_error_frame_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_error_frame_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -23513,7 +23503,7 @@ def test_get_error_frame_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetErrorFrameRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23537,7 +23527,7 @@ def test_get_error_frame_rest_bad_request( def test_get_error_frame_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23581,7 +23571,7 @@ def test_get_error_frame_rest_flattened(): def test_get_error_frame_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23596,7 +23586,7 @@ def test_get_error_frame_rest_flattened_error(transport: str = "rest"): def test_get_error_frame_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23609,7 +23599,7 @@ def test_get_error_frame_rest_error(): ) def test_list_sources_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23662,7 +23652,7 @@ def test_list_sources_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_sources._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23671,7 +23661,7 @@ def test_list_sources_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_sources._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -23689,7 +23679,7 @@ def test_list_sources_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23731,7 +23721,7 @@ def test_list_sources_rest_required_fields( def test_list_sources_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_sources._get_unset_required_fields({}) @@ -23751,7 +23741,7 @@ def test_list_sources_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_sources_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -23809,7 +23799,7 @@ def test_list_sources_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListSourcesRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23831,7 +23821,7 @@ def test_list_sources_rest_bad_request( def test_list_sources_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23872,7 +23862,7 @@ def test_list_sources_rest_flattened(): def test_list_sources_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23887,7 +23877,7 @@ def test_list_sources_rest_flattened_error(transport: str = "rest"): def test_list_sources_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23957,7 +23947,7 @@ def test_list_sources_rest_pager(transport: str = "rest"): ) def test_get_source_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24022,7 +24012,7 @@ def test_get_source_rest_required_fields(request_type=migrationcenter.GetSourceR # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_source._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24031,7 +24021,7 @@ def test_get_source_rest_required_fields(request_type=migrationcenter.GetSourceR jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_source._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24040,7 +24030,7 @@ def test_get_source_rest_required_fields(request_type=migrationcenter.GetSourceR assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -24082,7 +24072,7 @@ def test_get_source_rest_required_fields(request_type=migrationcenter.GetSourceR def test_get_source_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_source._get_unset_required_fields({}) @@ -24092,7 +24082,7 @@ def test_get_source_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_source_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -24150,7 +24140,7 @@ def test_get_source_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetSourceRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24172,7 +24162,7 @@ def test_get_source_rest_bad_request( def test_get_source_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24213,7 +24203,7 @@ def test_get_source_rest_flattened(): def test_get_source_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24228,7 +24218,7 @@ def test_get_source_rest_flattened_error(transport: str = "rest"): def test_get_source_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -24241,7 +24231,7 @@ def test_get_source_rest_error(): ) def test_create_source_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24369,7 +24359,7 @@ def test_create_source_rest_required_fields( assert "sourceId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_source._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24381,7 +24371,7 @@ def test_create_source_rest_required_fields( jsonified_request["sourceId"] = "source_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_source._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -24399,7 +24389,7 @@ def test_create_source_rest_required_fields( assert jsonified_request["sourceId"] == "source_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -24445,7 +24435,7 @@ def test_create_source_rest_required_fields( def test_create_source_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_source._get_unset_required_fields({}) @@ -24469,7 +24459,7 @@ def test_create_source_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_source_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -24529,7 +24519,7 @@ def test_create_source_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreateSourceRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24551,7 +24541,7 @@ def test_create_source_rest_bad_request( def test_create_source_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24592,7 +24582,7 @@ def test_create_source_rest_flattened(): def test_create_source_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24609,7 +24599,7 @@ def test_create_source_rest_flattened_error(transport: str = "rest"): def test_create_source_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -24622,7 +24612,7 @@ def test_create_source_rest_error(): ) def test_update_source_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24749,14 +24739,14 @@ def test_update_source_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_source._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_source._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -24770,7 +24760,7 @@ def test_update_source_rest_required_fields( # verify required fields with non-default values are left alone client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -24810,7 +24800,7 @@ def test_update_source_rest_required_fields( def test_update_source_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_source._get_unset_required_fields({}) @@ -24833,7 +24823,7 @@ def test_update_source_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_source_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -24893,7 +24883,7 @@ def test_update_source_rest_bad_request( transport: str = "rest", request_type=migrationcenter.UpdateSourceRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24917,7 +24907,7 @@ def test_update_source_rest_bad_request( def test_update_source_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24960,7 +24950,7 @@ def test_update_source_rest_flattened(): def test_update_source_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24976,7 +24966,7 @@ def test_update_source_rest_flattened_error(transport: str = "rest"): def test_update_source_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -24989,7 +24979,7 @@ def test_update_source_rest_error(): ) def test_delete_source_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25035,7 +25025,7 @@ def test_delete_source_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_source._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25044,7 +25034,7 @@ def test_delete_source_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_source._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -25055,7 +25045,7 @@ def test_delete_source_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -25094,7 +25084,7 @@ def test_delete_source_rest_required_fields( def test_delete_source_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_source._get_unset_required_fields({}) @@ -25104,7 +25094,7 @@ def test_delete_source_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_source_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -25164,7 +25154,7 @@ def test_delete_source_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteSourceRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25186,7 +25176,7 @@ def test_delete_source_rest_bad_request( def test_delete_source_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25225,7 +25215,7 @@ def test_delete_source_rest_flattened(): def test_delete_source_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25240,7 +25230,7 @@ def test_delete_source_rest_flattened_error(transport: str = "rest"): def test_delete_source_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -25253,7 +25243,7 @@ def test_delete_source_rest_error(): ) def test_list_preference_sets_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25306,7 +25296,7 @@ def test_list_preference_sets_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_preference_sets._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25315,7 +25305,7 @@ def test_list_preference_sets_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_preference_sets._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -25332,7 +25322,7 @@ def test_list_preference_sets_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -25374,7 +25364,7 @@ def test_list_preference_sets_rest_required_fields( def test_list_preference_sets_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_preference_sets._get_unset_required_fields({}) @@ -25393,7 +25383,7 @@ def test_list_preference_sets_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_preference_sets_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -25451,7 +25441,7 @@ def test_list_preference_sets_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListPreferenceSetsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25473,7 +25463,7 @@ def test_list_preference_sets_rest_bad_request( def test_list_preference_sets_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25515,7 +25505,7 @@ def test_list_preference_sets_rest_flattened(): def test_list_preference_sets_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25530,7 +25520,7 @@ def test_list_preference_sets_rest_flattened_error(transport: str = "rest"): def test_list_preference_sets_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25600,7 +25590,7 @@ def test_list_preference_sets_rest_pager(transport: str = "rest"): ) def test_get_preference_set_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25655,7 +25645,7 @@ def test_get_preference_set_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_preference_set._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25664,7 +25654,7 @@ def test_get_preference_set_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_preference_set._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25673,7 +25663,7 @@ def test_get_preference_set_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -25715,7 +25705,7 @@ def test_get_preference_set_rest_required_fields( def test_get_preference_set_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_preference_set._get_unset_required_fields({}) @@ -25725,7 +25715,7 @@ def test_get_preference_set_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_preference_set_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -25783,7 +25773,7 @@ def test_get_preference_set_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetPreferenceSetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25805,7 +25795,7 @@ def test_get_preference_set_rest_bad_request( def test_get_preference_set_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25849,7 +25839,7 @@ def test_get_preference_set_rest_flattened(): def test_get_preference_set_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25864,7 +25854,7 @@ def test_get_preference_set_rest_flattened_error(transport: str = "rest"): def test_get_preference_set_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -25877,7 +25867,7 @@ def test_get_preference_set_rest_error(): ) def test_create_preference_set_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26030,7 +26020,7 @@ def test_create_preference_set_rest_required_fields( assert "preferenceSetId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_preference_set._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26042,7 +26032,7 @@ def test_create_preference_set_rest_required_fields( jsonified_request["preferenceSetId"] = "preference_set_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_preference_set._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -26060,7 +26050,7 @@ def test_create_preference_set_rest_required_fields( assert jsonified_request["preferenceSetId"] == "preference_set_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26106,7 +26096,7 @@ def test_create_preference_set_rest_required_fields( def test_create_preference_set_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_preference_set._get_unset_required_fields({}) @@ -26130,7 +26120,7 @@ def test_create_preference_set_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_preference_set_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -26190,7 +26180,7 @@ def test_create_preference_set_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreatePreferenceSetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26212,7 +26202,7 @@ def test_create_preference_set_rest_bad_request( def test_create_preference_set_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26254,7 +26244,7 @@ def test_create_preference_set_rest_flattened(): def test_create_preference_set_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26271,7 +26261,7 @@ def test_create_preference_set_rest_flattened_error(transport: str = "rest"): def test_create_preference_set_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26284,7 +26274,7 @@ def test_create_preference_set_rest_error(): ) def test_update_preference_set_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26438,14 +26428,14 @@ def test_update_preference_set_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_preference_set._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_preference_set._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -26459,7 +26449,7 @@ def test_update_preference_set_rest_required_fields( # verify required fields with non-default values are left alone client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26499,7 +26489,7 @@ def test_update_preference_set_rest_required_fields( def test_update_preference_set_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_preference_set._get_unset_required_fields({}) @@ -26522,7 +26512,7 @@ def test_update_preference_set_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_preference_set_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -26582,7 +26572,7 @@ def test_update_preference_set_rest_bad_request( transport: str = "rest", request_type=migrationcenter.UpdatePreferenceSetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26608,7 +26598,7 @@ def test_update_preference_set_rest_bad_request( def test_update_preference_set_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26653,7 +26643,7 @@ def test_update_preference_set_rest_flattened(): def test_update_preference_set_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26669,7 +26659,7 @@ def test_update_preference_set_rest_flattened_error(transport: str = "rest"): def test_update_preference_set_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26682,7 +26672,7 @@ def test_update_preference_set_rest_error(): ) def test_delete_preference_set_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26728,7 +26718,7 @@ def test_delete_preference_set_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_preference_set._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26737,7 +26727,7 @@ def test_delete_preference_set_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_preference_set._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -26748,7 +26738,7 @@ def test_delete_preference_set_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26787,7 +26777,7 @@ def test_delete_preference_set_rest_required_fields( def test_delete_preference_set_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_preference_set._get_unset_required_fields({}) @@ -26797,7 +26787,7 @@ def test_delete_preference_set_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_preference_set_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -26857,7 +26847,7 @@ def test_delete_preference_set_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeletePreferenceSetRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26879,7 +26869,7 @@ def test_delete_preference_set_rest_bad_request( def test_delete_preference_set_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26921,7 +26911,7 @@ def test_delete_preference_set_rest_flattened(): def test_delete_preference_set_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26936,7 +26926,7 @@ def test_delete_preference_set_rest_flattened_error(transport: str = "rest"): def test_delete_preference_set_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26949,7 +26939,7 @@ def test_delete_preference_set_rest_error(): ) def test_get_settings_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27002,7 +26992,7 @@ def test_get_settings_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_settings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -27011,7 +27001,7 @@ def test_get_settings_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_settings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -27020,7 +27010,7 @@ def test_get_settings_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -27062,7 +27052,7 @@ def test_get_settings_rest_required_fields( def test_get_settings_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_settings._get_unset_required_fields({}) @@ -27072,7 +27062,7 @@ def test_get_settings_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_settings_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -27130,7 +27120,7 @@ def test_get_settings_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetSettingsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27152,7 +27142,7 @@ def test_get_settings_rest_bad_request( def test_get_settings_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27193,7 +27183,7 @@ def test_get_settings_rest_flattened(): def test_get_settings_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27208,7 +27198,7 @@ def test_get_settings_rest_flattened_error(transport: str = "rest"): def test_get_settings_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -27221,7 +27211,7 @@ def test_get_settings_rest_error(): ) def test_update_settings_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27337,14 +27327,14 @@ def test_update_settings_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_settings._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_settings._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -27358,7 +27348,7 @@ def test_update_settings_rest_required_fields( # verify required fields with non-default values are left alone client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -27398,7 +27388,7 @@ def test_update_settings_rest_required_fields( def test_update_settings_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_settings._get_unset_required_fields({}) @@ -27421,7 +27411,7 @@ def test_update_settings_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_settings_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -27481,7 +27471,7 @@ def test_update_settings_rest_bad_request( transport: str = "rest", request_type=migrationcenter.UpdateSettingsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27503,7 +27493,7 @@ def test_update_settings_rest_bad_request( def test_update_settings_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27546,7 +27536,7 @@ def test_update_settings_rest_flattened(): def test_update_settings_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27562,7 +27552,7 @@ def test_update_settings_rest_flattened_error(transport: str = "rest"): def test_update_settings_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -27575,7 +27565,7 @@ def test_update_settings_rest_error(): ) def test_create_report_config_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27700,7 +27690,7 @@ def test_create_report_config_rest_required_fields( assert "reportConfigId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_report_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -27712,7 +27702,7 @@ def test_create_report_config_rest_required_fields( jsonified_request["reportConfigId"] = "report_config_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_report_config._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -27730,7 +27720,7 @@ def test_create_report_config_rest_required_fields( assert jsonified_request["reportConfigId"] == "report_config_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -27776,7 +27766,7 @@ def test_create_report_config_rest_required_fields( def test_create_report_config_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_report_config._get_unset_required_fields({}) @@ -27800,7 +27790,7 @@ def test_create_report_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_report_config_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -27860,7 +27850,7 @@ def test_create_report_config_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreateReportConfigRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27882,7 +27872,7 @@ def test_create_report_config_rest_bad_request( def test_create_report_config_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27924,7 +27914,7 @@ def test_create_report_config_rest_flattened(): def test_create_report_config_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27941,7 +27931,7 @@ def test_create_report_config_rest_flattened_error(transport: str = "rest"): def test_create_report_config_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -27954,7 +27944,7 @@ def test_create_report_config_rest_error(): ) def test_get_report_config_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28009,7 +27999,7 @@ def test_get_report_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_report_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28018,7 +28008,7 @@ def test_get_report_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_report_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28027,7 +28017,7 @@ def test_get_report_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -28069,7 +28059,7 @@ def test_get_report_config_rest_required_fields( def test_get_report_config_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_report_config._get_unset_required_fields({}) @@ -28079,7 +28069,7 @@ def test_get_report_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_report_config_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -28137,7 +28127,7 @@ def test_get_report_config_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetReportConfigRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28159,7 +28149,7 @@ def test_get_report_config_rest_bad_request( def test_get_report_config_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28203,7 +28193,7 @@ def test_get_report_config_rest_flattened(): def test_get_report_config_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28218,7 +28208,7 @@ def test_get_report_config_rest_flattened_error(transport: str = "rest"): def test_get_report_config_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -28231,7 +28221,7 @@ def test_get_report_config_rest_error(): ) def test_list_report_configs_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28284,7 +28274,7 @@ def test_list_report_configs_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_report_configs._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28293,7 +28283,7 @@ def test_list_report_configs_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_report_configs._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -28311,7 +28301,7 @@ def test_list_report_configs_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -28353,7 +28343,7 @@ def test_list_report_configs_rest_required_fields( def test_list_report_configs_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_report_configs._get_unset_required_fields({}) @@ -28373,7 +28363,7 @@ def test_list_report_configs_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_report_configs_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -28431,7 +28421,7 @@ def test_list_report_configs_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListReportConfigsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28453,7 +28443,7 @@ def test_list_report_configs_rest_bad_request( def test_list_report_configs_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28495,7 +28485,7 @@ def test_list_report_configs_rest_flattened(): def test_list_report_configs_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28510,7 +28500,7 @@ def test_list_report_configs_rest_flattened_error(transport: str = "rest"): def test_list_report_configs_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28580,7 +28570,7 @@ def test_list_report_configs_rest_pager(transport: str = "rest"): ) def test_delete_report_config_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28626,7 +28616,7 @@ def test_delete_report_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_report_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28635,7 +28625,7 @@ def test_delete_report_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_report_config._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -28651,7 +28641,7 @@ def test_delete_report_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -28690,7 +28680,7 @@ def test_delete_report_config_rest_required_fields( def test_delete_report_config_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_report_config._get_unset_required_fields({}) @@ -28708,7 +28698,7 @@ def test_delete_report_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_report_config_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -28768,7 +28758,7 @@ def test_delete_report_config_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteReportConfigRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28790,7 +28780,7 @@ def test_delete_report_config_rest_bad_request( def test_delete_report_config_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28832,7 +28822,7 @@ def test_delete_report_config_rest_flattened(): def test_delete_report_config_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28847,7 +28837,7 @@ def test_delete_report_config_rest_flattened_error(transport: str = "rest"): def test_delete_report_config_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -28860,7 +28850,7 @@ def test_delete_report_config_rest_error(): ) def test_create_report_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29103,7 +29093,7 @@ def test_create_report_rest_required_fields( assert "reportId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_report._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -29115,7 +29105,7 @@ def test_create_report_rest_required_fields( jsonified_request["reportId"] = "report_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_report._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -29133,7 +29123,7 @@ def test_create_report_rest_required_fields( assert jsonified_request["reportId"] == "report_id_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -29179,7 +29169,7 @@ def test_create_report_rest_required_fields( def test_create_report_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_report._get_unset_required_fields({}) @@ -29203,7 +29193,7 @@ def test_create_report_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_report_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -29263,7 +29253,7 @@ def test_create_report_rest_bad_request( transport: str = "rest", request_type=migrationcenter.CreateReportRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29287,7 +29277,7 @@ def test_create_report_rest_bad_request( def test_create_report_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29331,7 +29321,7 @@ def test_create_report_rest_flattened(): def test_create_report_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29348,7 +29338,7 @@ def test_create_report_rest_flattened_error(transport: str = "rest"): def test_create_report_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -29361,7 +29351,7 @@ def test_create_report_rest_error(): ) def test_get_report_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29420,7 +29410,7 @@ def test_get_report_rest_required_fields(request_type=migrationcenter.GetReportR # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_report._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -29429,7 +29419,7 @@ def test_get_report_rest_required_fields(request_type=migrationcenter.GetReportR jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_report._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("view",)) @@ -29440,7 +29430,7 @@ def test_get_report_rest_required_fields(request_type=migrationcenter.GetReportR assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -29482,7 +29472,7 @@ def test_get_report_rest_required_fields(request_type=migrationcenter.GetReportR def test_get_report_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_report._get_unset_required_fields({}) @@ -29492,7 +29482,7 @@ def test_get_report_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_report_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -29550,7 +29540,7 @@ def test_get_report_rest_bad_request( transport: str = "rest", request_type=migrationcenter.GetReportRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29574,7 +29564,7 @@ def test_get_report_rest_bad_request( def test_get_report_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29618,7 +29608,7 @@ def test_get_report_rest_flattened(): def test_get_report_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29633,7 +29623,7 @@ def test_get_report_rest_flattened_error(transport: str = "rest"): def test_get_report_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -29646,7 +29636,7 @@ def test_get_report_rest_error(): ) def test_list_reports_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29701,7 +29691,7 @@ def test_list_reports_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_reports._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -29710,7 +29700,7 @@ def test_list_reports_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_reports._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -29729,7 +29719,7 @@ def test_list_reports_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -29771,7 +29761,7 @@ def test_list_reports_rest_required_fields( def test_list_reports_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_reports._get_unset_required_fields({}) @@ -29792,7 +29782,7 @@ def test_list_reports_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_reports_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -29850,7 +29840,7 @@ def test_list_reports_rest_bad_request( transport: str = "rest", request_type=migrationcenter.ListReportsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29874,7 +29864,7 @@ def test_list_reports_rest_bad_request( def test_list_reports_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29918,7 +29908,7 @@ def test_list_reports_rest_flattened(): def test_list_reports_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29933,7 +29923,7 @@ def test_list_reports_rest_flattened_error(transport: str = "rest"): def test_list_reports_rest_pager(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30005,7 +29995,7 @@ def test_list_reports_rest_pager(transport: str = "rest"): ) def test_delete_report_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30053,7 +30043,7 @@ def test_delete_report_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_report._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -30062,7 +30052,7 @@ def test_delete_report_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_report._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("request_id",)) @@ -30073,7 +30063,7 @@ def test_delete_report_rest_required_fields( assert jsonified_request["name"] == "name_value" client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -30112,7 +30102,7 @@ def test_delete_report_rest_required_fields( def test_delete_report_rest_unset_required_fields(): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_report._get_unset_required_fields({}) @@ -30122,7 +30112,7 @@ def test_delete_report_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_report_rest_interceptors(null_interceptor): transport = transports.MigrationCenterRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.MigrationCenterRestInterceptor(), @@ -30182,7 +30172,7 @@ def test_delete_report_rest_bad_request( transport: str = "rest", request_type=migrationcenter.DeleteReportRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30206,7 +30196,7 @@ def test_delete_report_rest_bad_request( def test_delete_report_rest_flattened(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30248,7 +30238,7 @@ def test_delete_report_rest_flattened(): def test_delete_report_rest_flattened_error(transport: str = "rest"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30263,24 +30253,24 @@ def test_delete_report_rest_flattened_error(transport: str = "rest"): def test_delete_report_rest_error(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.MigrationCenterGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.MigrationCenterGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MigrationCenterClient( @@ -30290,7 +30280,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.MigrationCenterGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -30305,13 +30295,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = MigrationCenterClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.MigrationCenterGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MigrationCenterClient( @@ -30323,7 +30312,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.MigrationCenterGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = MigrationCenterClient(transport=transport) assert client.transport is transport @@ -30332,13 +30321,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.MigrationCenterGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.MigrationCenterGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -30355,7 +30344,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -30369,7 +30358,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = MigrationCenterClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -30377,7 +30366,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -30389,7 +30378,7 @@ def test_migration_center_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.MigrationCenterTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -30401,7 +30390,7 @@ def test_migration_center_base_transport(): ) as Transport: Transport.return_value = None transport = transports.MigrationCenterTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -30491,7 +30480,7 @@ def test_migration_center_base_transport_with_credentials_file(): "google.cloud.migrationcenter_v1.services.migration_center.transports.MigrationCenterTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.MigrationCenterTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -30510,7 +30499,7 @@ def test_migration_center_base_transport_with_adc(): "google.cloud.migrationcenter_v1.services.migration_center.transports.MigrationCenterTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.MigrationCenterTransport() adc.assert_called_once() @@ -30518,7 +30507,7 @@ def test_migration_center_base_transport_with_adc(): def test_migration_center_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) MigrationCenterClient() adc.assert_called_once_with( scopes=None, @@ -30538,7 +30527,7 @@ def test_migration_center_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -30585,7 +30574,7 @@ def test_migration_center_transport_create_channel(transport_class, grpc_helpers ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -30613,7 +30602,7 @@ def test_migration_center_transport_create_channel(transport_class, grpc_helpers ], ) def test_migration_center_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -30651,7 +30640,7 @@ def test_migration_center_grpc_transport_client_cert_source_for_mtls(transport_c def test_migration_center_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -30663,7 +30652,7 @@ def test_migration_center_http_transport_client_cert_source_for_mtls(): def test_migration_center_rest_lro_client(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -30688,7 +30677,7 @@ def test_migration_center_rest_lro_client(): ) def test_migration_center_host_no_port(transport_name): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="migrationcenter.googleapis.com" ), @@ -30711,7 +30700,7 @@ def test_migration_center_host_no_port(transport_name): ) def test_migration_center_host_with_port(transport_name): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="migrationcenter.googleapis.com:8000" ), @@ -30731,8 +30720,8 @@ def test_migration_center_host_with_port(transport_name): ], ) def test_migration_center_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = MigrationCenterClient( credentials=creds1, transport=transport_name, @@ -30937,7 +30926,7 @@ def test_migration_center_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -31015,7 +31004,7 @@ def test_migration_center_transport_channel_mtls_with_adc(transport_class): def test_migration_center_grpc_lro_client(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -31032,7 +31021,7 @@ def test_migration_center_grpc_lro_client(): def test_migration_center_grpc_lro_async_client(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -31431,7 +31420,7 @@ def test_client_with_default_client_info(): transports.MigrationCenterTransport, "_prep_wrapped_messages" ) as prep: client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -31441,7 +31430,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = MigrationCenterClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -31450,7 +31439,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -31465,7 +31454,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31495,7 +31484,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -31523,7 +31512,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31551,7 +31540,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -31579,7 +31568,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31609,7 +31598,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -31637,7 +31626,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31667,7 +31656,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -31695,7 +31684,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31725,7 +31714,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -31753,7 +31742,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31783,7 +31772,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -31809,7 +31798,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31834,7 +31823,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31858,7 +31847,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -31887,7 +31876,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -31914,7 +31903,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -31932,7 +31921,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -31948,7 +31937,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31973,7 +31962,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31997,7 +31986,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32026,7 +32015,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32053,7 +32042,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -32071,7 +32060,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -32087,7 +32076,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32112,7 +32101,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32138,7 +32127,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32167,7 +32156,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32196,7 +32185,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -32214,7 +32203,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -32232,7 +32221,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32257,7 +32246,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32283,7 +32272,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32312,7 +32301,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32341,7 +32330,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -32359,7 +32348,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -32377,7 +32366,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32402,7 +32391,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32428,7 +32417,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32457,7 +32446,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32486,7 +32475,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -32504,7 +32493,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -32522,7 +32511,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32547,7 +32536,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32572,9 +32561,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): - client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + client = MigrationCenterClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -32602,7 +32589,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32631,7 +32618,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -32649,7 +32636,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = MigrationCenterAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -32673,7 +32660,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -32690,7 +32677,7 @@ def test_client_ctx(): ] for transport in transports: client = MigrationCenterClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard/gapic_version.py b/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard/gapic_version.py +++ b/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/gapic_version.py b/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/gapic_version.py index d5b133eaf7fe..360a0d13ebdd 100644 --- a/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/gapic_version.py +++ b/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/services/dashboards_service/client.py b/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/services/dashboards_service/client.py index 7b8a28a62325..6c74eff88e5a 100644 --- a/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/services/dashboards_service/client.py +++ b/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/services/dashboards_service/client.py @@ -403,6 +403,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -421,6 +422,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -495,17 +497,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = DashboardsServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = DashboardsServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring-dashboards/samples/generated_samples/snippet_metadata_google.monitoring.dashboard.v1.json b/packages/google-cloud-monitoring-dashboards/samples/generated_samples/snippet_metadata_google.monitoring.dashboard.v1.json index d9055bc8fedc..8f0a9068e1ea 100644 --- a/packages/google-cloud-monitoring-dashboards/samples/generated_samples/snippet_metadata_google.monitoring.dashboard.v1.json +++ b/packages/google-cloud-monitoring-dashboards/samples/generated_samples/snippet_metadata_google.monitoring.dashboard.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-monitoring-dashboards", - "version": "2.14.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-monitoring-dashboards/setup.py b/packages/google-cloud-monitoring-dashboards/setup.py index 27a5d570f178..b5f4c969ad03 100644 --- a/packages/google-cloud-monitoring-dashboards/setup.py +++ b/packages/google-cloud-monitoring-dashboards/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-monitoring-dashboards/testing/constraints-3.7.txt b/packages/google-cloud-monitoring-dashboards/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-monitoring-dashboards/testing/constraints-3.7.txt +++ b/packages/google-cloud-monitoring-dashboards/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-monitoring-dashboards/tests/unit/gapic/monitoring_dashboard_v1/test_dashboards_service.py b/packages/google-cloud-monitoring-dashboards/tests/unit/gapic/monitoring_dashboard_v1/test_dashboards_service.py index 4dd42ddbf317..5791915f65d1 100644 --- a/packages/google-cloud-monitoring-dashboards/tests/unit/gapic/monitoring_dashboard_v1/test_dashboards_service.py +++ b/packages/google-cloud-monitoring-dashboards/tests/unit/gapic/monitoring_dashboard_v1/test_dashboards_service.py @@ -95,18 +95,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -342,7 +330,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -369,42 +357,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -417,7 +412,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_dashboards_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -471,7 +466,7 @@ def test_dashboards_service_client_service_account_always_use_jwt( def test_dashboards_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -534,9 +529,7 @@ def test_dashboards_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(DashboardsServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -955,20 +948,20 @@ def test_dashboards_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -980,13 +973,11 @@ def test_dashboards_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -1002,8 +993,7 @@ def test_dashboards_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1161,8 +1151,8 @@ def test_dashboards_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1196,7 +1186,7 @@ def test_dashboards_service_client_create_channel_credentials_file( ) def test_create_dashboard(request_type, transport: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1230,7 +1220,7 @@ def test_create_dashboard_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1248,7 +1238,7 @@ async def test_create_dashboard_async( request_type=dashboards_service.CreateDashboardRequest, ): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1287,7 +1277,7 @@ async def test_create_dashboard_async_from_dict(): def test_create_dashboard_field_headers(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1317,7 +1307,7 @@ def test_create_dashboard_field_headers(): @pytest.mark.asyncio async def test_create_dashboard_field_headers_async(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1353,7 +1343,7 @@ async def test_create_dashboard_field_headers_async(): ) def test_list_dashboards(request_type, transport: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1383,7 +1373,7 @@ def test_list_dashboards_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1401,7 +1391,7 @@ async def test_list_dashboards_async( request_type=dashboards_service.ListDashboardsRequest, ): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1436,7 +1426,7 @@ async def test_list_dashboards_async_from_dict(): def test_list_dashboards_field_headers(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1466,7 +1456,7 @@ def test_list_dashboards_field_headers(): @pytest.mark.asyncio async def test_list_dashboards_field_headers_async(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1497,7 +1487,7 @@ async def test_list_dashboards_field_headers_async(): def test_list_dashboards_pager(transport_name: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1547,7 +1537,7 @@ def test_list_dashboards_pager(transport_name: str = "grpc"): def test_list_dashboards_pages(transport_name: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1589,7 +1579,7 @@ def test_list_dashboards_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_dashboards_async_pager(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1639,7 +1629,7 @@ async def test_list_dashboards_async_pager(): @pytest.mark.asyncio async def test_list_dashboards_async_pages(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1694,7 +1684,7 @@ async def test_list_dashboards_async_pages(): ) def test_get_dashboard(request_type, transport: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1728,7 +1718,7 @@ def test_get_dashboard_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1745,7 +1735,7 @@ async def test_get_dashboard_async( transport: str = "grpc_asyncio", request_type=dashboards_service.GetDashboardRequest ): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1784,7 +1774,7 @@ async def test_get_dashboard_async_from_dict(): def test_get_dashboard_field_headers(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1814,7 +1804,7 @@ def test_get_dashboard_field_headers(): @pytest.mark.asyncio async def test_get_dashboard_field_headers_async(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1850,7 +1840,7 @@ async def test_get_dashboard_field_headers_async(): ) def test_delete_dashboard(request_type, transport: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1877,7 +1867,7 @@ def test_delete_dashboard_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1895,7 +1885,7 @@ async def test_delete_dashboard_async( request_type=dashboards_service.DeleteDashboardRequest, ): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1925,7 +1915,7 @@ async def test_delete_dashboard_async_from_dict(): def test_delete_dashboard_field_headers(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1955,7 +1945,7 @@ def test_delete_dashboard_field_headers(): @pytest.mark.asyncio async def test_delete_dashboard_field_headers_async(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1991,7 +1981,7 @@ async def test_delete_dashboard_field_headers_async(): ) def test_update_dashboard(request_type, transport: str = "grpc"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2025,7 +2015,7 @@ def test_update_dashboard_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2043,7 +2033,7 @@ async def test_update_dashboard_async( request_type=dashboards_service.UpdateDashboardRequest, ): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2082,7 +2072,7 @@ async def test_update_dashboard_async_from_dict(): def test_update_dashboard_field_headers(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2112,7 +2102,7 @@ def test_update_dashboard_field_headers(): @pytest.mark.asyncio async def test_update_dashboard_field_headers_async(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2148,7 +2138,7 @@ async def test_update_dashboard_field_headers_async(): ) def test_create_dashboard_rest(request_type): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2403,7 +2393,7 @@ def test_create_dashboard_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_dashboard._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2412,7 +2402,7 @@ def test_create_dashboard_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_dashboard._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("validate_only",)) @@ -2423,7 +2413,7 @@ def test_create_dashboard_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2466,7 +2456,7 @@ def test_create_dashboard_rest_required_fields( def test_create_dashboard_rest_unset_required_fields(): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_dashboard._get_unset_required_fields({}) @@ -2484,7 +2474,7 @@ def test_create_dashboard_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_dashboard_rest_interceptors(null_interceptor): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.DashboardsServiceRestInterceptor(), @@ -2540,7 +2530,7 @@ def test_create_dashboard_rest_bad_request( transport: str = "rest", request_type=dashboards_service.CreateDashboardRequest ): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2562,7 +2552,7 @@ def test_create_dashboard_rest_bad_request( def test_create_dashboard_rest_error(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2575,7 +2565,7 @@ def test_create_dashboard_rest_error(): ) def test_list_dashboards_rest(request_type): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2626,7 +2616,7 @@ def test_list_dashboards_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_dashboards._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2635,7 +2625,7 @@ def test_list_dashboards_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_dashboards._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -2651,7 +2641,7 @@ def test_list_dashboards_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2693,7 +2683,7 @@ def test_list_dashboards_rest_required_fields( def test_list_dashboards_rest_unset_required_fields(): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_dashboards._get_unset_required_fields({}) @@ -2711,7 +2701,7 @@ def test_list_dashboards_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_dashboards_rest_interceptors(null_interceptor): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.DashboardsServiceRestInterceptor(), @@ -2769,7 +2759,7 @@ def test_list_dashboards_rest_bad_request( transport: str = "rest", request_type=dashboards_service.ListDashboardsRequest ): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2791,7 +2781,7 @@ def test_list_dashboards_rest_bad_request( def test_list_dashboards_rest_pager(transport: str = "rest"): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2861,7 +2851,7 @@ def test_list_dashboards_rest_pager(transport: str = "rest"): ) def test_get_dashboard_rest(request_type): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -2916,7 +2906,7 @@ def test_get_dashboard_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_dashboard._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2925,7 +2915,7 @@ def test_get_dashboard_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_dashboard._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -2934,7 +2924,7 @@ def test_get_dashboard_rest_required_fields( assert jsonified_request["name"] == "name_value" client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -2976,7 +2966,7 @@ def test_get_dashboard_rest_required_fields( def test_get_dashboard_rest_unset_required_fields(): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_dashboard._get_unset_required_fields({}) @@ -2986,7 +2976,7 @@ def test_get_dashboard_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_dashboard_rest_interceptors(null_interceptor): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.DashboardsServiceRestInterceptor(), @@ -3042,7 +3032,7 @@ def test_get_dashboard_rest_bad_request( transport: str = "rest", request_type=dashboards_service.GetDashboardRequest ): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3064,7 +3054,7 @@ def test_get_dashboard_rest_bad_request( def test_get_dashboard_rest_error(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3077,7 +3067,7 @@ def test_get_dashboard_rest_error(): ) def test_delete_dashboard_rest(request_type): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3123,7 +3113,7 @@ def test_delete_dashboard_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_dashboard._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3132,7 +3122,7 @@ def test_delete_dashboard_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_dashboard._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -3141,7 +3131,7 @@ def test_delete_dashboard_rest_required_fields( assert jsonified_request["name"] == "name_value" client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3180,7 +3170,7 @@ def test_delete_dashboard_rest_required_fields( def test_delete_dashboard_rest_unset_required_fields(): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_dashboard._get_unset_required_fields({}) @@ -3190,7 +3180,7 @@ def test_delete_dashboard_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_dashboard_rest_interceptors(null_interceptor): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.DashboardsServiceRestInterceptor(), @@ -3240,7 +3230,7 @@ def test_delete_dashboard_rest_bad_request( transport: str = "rest", request_type=dashboards_service.DeleteDashboardRequest ): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3262,7 +3252,7 @@ def test_delete_dashboard_rest_bad_request( def test_delete_dashboard_rest_error(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3275,7 +3265,7 @@ def test_delete_dashboard_rest_error(): ) def test_update_dashboard_rest(request_type): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -3529,14 +3519,14 @@ def test_update_dashboard_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_dashboard._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_dashboard._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("validate_only",)) @@ -3545,7 +3535,7 @@ def test_update_dashboard_rest_required_fields( # verify required fields with non-default values are left alone client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -3588,7 +3578,7 @@ def test_update_dashboard_rest_required_fields( def test_update_dashboard_rest_unset_required_fields(): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_dashboard._get_unset_required_fields({}) @@ -3598,7 +3588,7 @@ def test_update_dashboard_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_dashboard_rest_interceptors(null_interceptor): transport = transports.DashboardsServiceRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.DashboardsServiceRestInterceptor(), @@ -3654,7 +3644,7 @@ def test_update_dashboard_rest_bad_request( transport: str = "rest", request_type=dashboards_service.UpdateDashboardRequest ): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3676,24 +3666,24 @@ def test_update_dashboard_rest_bad_request( def test_update_dashboard_rest_error(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.DashboardsServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.DashboardsServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = DashboardsServiceClient( @@ -3703,7 +3693,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.DashboardsServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3718,13 +3708,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = DashboardsServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.DashboardsServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = DashboardsServiceClient( @@ -3736,7 +3725,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.DashboardsServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = DashboardsServiceClient(transport=transport) assert client.transport is transport @@ -3745,13 +3734,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.DashboardsServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.DashboardsServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3768,7 +3757,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3782,7 +3771,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = DashboardsServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3790,7 +3779,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3802,7 +3791,7 @@ def test_dashboards_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.DashboardsServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3814,7 +3803,7 @@ def test_dashboards_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.DashboardsServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3850,7 +3839,7 @@ def test_dashboards_service_base_transport_with_credentials_file(): "google.cloud.monitoring_dashboard_v1.services.dashboards_service.transports.DashboardsServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.DashboardsServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3874,7 +3863,7 @@ def test_dashboards_service_base_transport_with_adc(): "google.cloud.monitoring_dashboard_v1.services.dashboards_service.transports.DashboardsServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.DashboardsServiceTransport() adc.assert_called_once() @@ -3882,7 +3871,7 @@ def test_dashboards_service_base_transport_with_adc(): def test_dashboards_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) DashboardsServiceClient() adc.assert_called_once_with( scopes=None, @@ -3907,7 +3896,7 @@ def test_dashboards_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -3959,7 +3948,7 @@ def test_dashboards_service_transport_create_channel(transport_class, grpc_helpe ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -3992,7 +3981,7 @@ def test_dashboards_service_transport_create_channel(transport_class, grpc_helpe ], ) def test_dashboards_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4030,7 +4019,7 @@ def test_dashboards_service_grpc_transport_client_cert_source_for_mtls(transport def test_dashboards_service_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -4050,7 +4039,7 @@ def test_dashboards_service_http_transport_client_cert_source_for_mtls(): ) def test_dashboards_service_host_no_port(transport_name): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -4073,7 +4062,7 @@ def test_dashboards_service_host_no_port(transport_name): ) def test_dashboards_service_host_with_port(transport_name): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -4093,8 +4082,8 @@ def test_dashboards_service_host_with_port(transport_name): ], ) def test_dashboards_service_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = DashboardsServiceClient( credentials=creds1, transport=transport_name, @@ -4170,7 +4159,7 @@ def test_dashboards_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4402,7 +4391,7 @@ def test_client_with_default_client_info(): transports.DashboardsServiceTransport, "_prep_wrapped_messages" ) as prep: client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4412,7 +4401,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = DashboardsServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4421,7 +4410,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = DashboardsServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4440,7 +4429,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4457,7 +4446,7 @@ def test_client_ctx(): ] for transport in transports: client = DashboardsServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope/gapic_version.py b/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope/gapic_version.py index 1aa1253ea3ab..360a0d13ebdd 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope/gapic_version.py +++ b/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.6.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/gapic_version.py b/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/gapic_version.py index 1aa1253ea3ab..360a0d13ebdd 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/gapic_version.py +++ b/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.6.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py b/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py index 220ee8cc7b16..13aefb7d4bc1 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py +++ b/packages/google-cloud-monitoring-metrics-scopes/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py @@ -399,6 +399,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -417,6 +418,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -491,17 +493,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = MetricsScopesClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = MetricsScopesClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring-metrics-scopes/samples/generated_samples/snippet_metadata_google.monitoring.metricsscope.v1.json b/packages/google-cloud-monitoring-metrics-scopes/samples/generated_samples/snippet_metadata_google.monitoring.metricsscope.v1.json index 2559441cae25..0cc0413d2cdf 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/samples/generated_samples/snippet_metadata_google.monitoring.metricsscope.v1.json +++ b/packages/google-cloud-monitoring-metrics-scopes/samples/generated_samples/snippet_metadata_google.monitoring.metricsscope.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-monitoring-metrics-scopes", - "version": "1.6.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-monitoring-metrics-scopes/setup.py b/packages/google-cloud-monitoring-metrics-scopes/setup.py index d93410e781e7..47f899ded58e 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/setup.py +++ b/packages/google-cloud-monitoring-metrics-scopes/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-monitoring-metrics-scopes/testing/constraints-3.7.txt b/packages/google-cloud-monitoring-metrics-scopes/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/testing/constraints-3.7.txt +++ b/packages/google-cloud-monitoring-metrics-scopes/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-monitoring-metrics-scopes/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py b/packages/google-cloud-monitoring-metrics-scopes/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py index d2918345d637..24d5dc5a34fc 100644 --- a/packages/google-cloud-monitoring-metrics-scopes/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py +++ b/packages/google-cloud-monitoring-metrics-scopes/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py @@ -83,18 +83,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -316,7 +304,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -343,42 +331,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -388,7 +383,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_metrics_scopes_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -434,7 +429,7 @@ def test_metrics_scopes_client_service_account_always_use_jwt( ], ) def test_metrics_scopes_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -491,9 +486,7 @@ def test_metrics_scopes_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(MetricsScopesClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -890,20 +883,20 @@ def test_metrics_scopes_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -915,13 +908,11 @@ def test_metrics_scopes_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -937,8 +928,7 @@ def test_metrics_scopes_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1089,8 +1079,8 @@ def test_metrics_scopes_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1124,7 +1114,7 @@ def test_metrics_scopes_client_create_channel_credentials_file( ) def test_get_metrics_scope(request_type, transport: str = "grpc"): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1156,7 +1146,7 @@ def test_get_metrics_scope_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1175,7 +1165,7 @@ async def test_get_metrics_scope_async( transport: str = "grpc_asyncio", request_type=metrics_scopes.GetMetricsScopeRequest ): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1212,7 +1202,7 @@ async def test_get_metrics_scope_async_from_dict(): def test_get_metrics_scope_field_headers(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1244,7 +1234,7 @@ def test_get_metrics_scope_field_headers(): @pytest.mark.asyncio async def test_get_metrics_scope_field_headers_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1277,7 +1267,7 @@ async def test_get_metrics_scope_field_headers_async(): def test_get_metrics_scope_flattened(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1303,7 +1293,7 @@ def test_get_metrics_scope_flattened(): def test_get_metrics_scope_flattened_error(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1318,7 +1308,7 @@ def test_get_metrics_scope_flattened_error(): @pytest.mark.asyncio async def test_get_metrics_scope_flattened_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1349,7 +1339,7 @@ async def test_get_metrics_scope_flattened_async(): @pytest.mark.asyncio async def test_get_metrics_scope_flattened_error_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1372,7 +1362,7 @@ def test_list_metrics_scopes_by_monitored_project( request_type, transport: str = "grpc" ): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1403,7 +1393,7 @@ def test_list_metrics_scopes_by_monitored_project_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1423,7 +1413,7 @@ async def test_list_metrics_scopes_by_monitored_project_async( request_type=metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, ): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1466,7 +1456,7 @@ async def test_list_metrics_scopes_by_monitored_project_async_from_dict(): ) def test_create_monitored_project(request_type, transport: str = "grpc"): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1495,7 +1485,7 @@ def test_create_monitored_project_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1515,7 +1505,7 @@ async def test_create_monitored_project_async( request_type=metrics_scopes.CreateMonitoredProjectRequest, ): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1549,7 +1539,7 @@ async def test_create_monitored_project_async_from_dict(): def test_create_monitored_project_field_headers(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1581,7 +1571,7 @@ def test_create_monitored_project_field_headers(): @pytest.mark.asyncio async def test_create_monitored_project_field_headers_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1614,7 +1604,7 @@ async def test_create_monitored_project_field_headers_async(): def test_create_monitored_project_flattened(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1644,7 +1634,7 @@ def test_create_monitored_project_flattened(): def test_create_monitored_project_flattened_error(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1660,7 +1650,7 @@ def test_create_monitored_project_flattened_error(): @pytest.mark.asyncio async def test_create_monitored_project_flattened_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1695,7 +1685,7 @@ async def test_create_monitored_project_flattened_async(): @pytest.mark.asyncio async def test_create_monitored_project_flattened_error_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1717,7 +1707,7 @@ async def test_create_monitored_project_flattened_error_async(): ) def test_delete_monitored_project(request_type, transport: str = "grpc"): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1746,7 +1736,7 @@ def test_delete_monitored_project_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1766,7 +1756,7 @@ async def test_delete_monitored_project_async( request_type=metrics_scopes.DeleteMonitoredProjectRequest, ): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1800,7 +1790,7 @@ async def test_delete_monitored_project_async_from_dict(): def test_delete_monitored_project_field_headers(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1832,7 +1822,7 @@ def test_delete_monitored_project_field_headers(): @pytest.mark.asyncio async def test_delete_monitored_project_field_headers_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1865,7 +1855,7 @@ async def test_delete_monitored_project_field_headers_async(): def test_delete_monitored_project_flattened(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1891,7 +1881,7 @@ def test_delete_monitored_project_flattened(): def test_delete_monitored_project_flattened_error(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1906,7 +1896,7 @@ def test_delete_monitored_project_flattened_error(): @pytest.mark.asyncio async def test_delete_monitored_project_flattened_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1937,7 +1927,7 @@ async def test_delete_monitored_project_flattened_async(): @pytest.mark.asyncio async def test_delete_monitored_project_flattened_error_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1952,17 +1942,17 @@ async def test_delete_monitored_project_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.MetricsScopesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.MetricsScopesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MetricsScopesClient( @@ -1972,7 +1962,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.MetricsScopesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -1987,13 +1977,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = MetricsScopesClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.MetricsScopesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MetricsScopesClient( @@ -2005,7 +1994,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.MetricsScopesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = MetricsScopesClient(transport=transport) assert client.transport is transport @@ -2014,13 +2003,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.MetricsScopesGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.MetricsScopesGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2036,7 +2025,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2049,7 +2038,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = MetricsScopesClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2057,7 +2046,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2069,7 +2058,7 @@ def test_metrics_scopes_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.MetricsScopesTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2081,7 +2070,7 @@ def test_metrics_scopes_base_transport(): ) as Transport: Transport.return_value = None transport = transports.MetricsScopesTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2121,7 +2110,7 @@ def test_metrics_scopes_base_transport_with_credentials_file(): "google.cloud.monitoring_metrics_scope_v1.services.metrics_scopes.transports.MetricsScopesTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.MetricsScopesTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2145,7 +2134,7 @@ def test_metrics_scopes_base_transport_with_adc(): "google.cloud.monitoring_metrics_scope_v1.services.metrics_scopes.transports.MetricsScopesTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.MetricsScopesTransport() adc.assert_called_once() @@ -2153,7 +2142,7 @@ def test_metrics_scopes_base_transport_with_adc(): def test_metrics_scopes_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) MetricsScopesClient() adc.assert_called_once_with( scopes=None, @@ -2178,7 +2167,7 @@ def test_metrics_scopes_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2229,7 +2218,7 @@ def test_metrics_scopes_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2262,7 +2251,7 @@ def test_metrics_scopes_transport_create_channel(transport_class, grpc_helpers): ], ) def test_metrics_scopes_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2308,7 +2297,7 @@ def test_metrics_scopes_grpc_transport_client_cert_source_for_mtls(transport_cla ) def test_metrics_scopes_host_no_port(transport_name): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -2326,7 +2315,7 @@ def test_metrics_scopes_host_no_port(transport_name): ) def test_metrics_scopes_host_with_port(transport_name): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -2383,7 +2372,7 @@ def test_metrics_scopes_transport_channel_mtls_with_client_cert_source(transport mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2461,7 +2450,7 @@ def test_metrics_scopes_transport_channel_mtls_with_adc(transport_class): def test_metrics_scopes_grpc_lro_client(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -2478,7 +2467,7 @@ def test_metrics_scopes_grpc_lro_client(): def test_metrics_scopes_grpc_lro_async_client(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -2648,7 +2637,7 @@ def test_client_with_default_client_info(): transports.MetricsScopesTransport, "_prep_wrapped_messages" ) as prep: client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2658,7 +2647,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = MetricsScopesClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2667,7 +2656,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = MetricsScopesAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -2685,7 +2674,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -2701,7 +2690,7 @@ def test_client_ctx(): ] for transport in transports: client = MetricsScopesClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring/gapic_version.py b/packages/google-cloud-monitoring/google/cloud/monitoring/gapic_version.py index 897a8fc0d7c8..360a0d13ebdd 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring/gapic_version.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.19.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic_version.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic_version.py index 897a8fc0d7c8..360a0d13ebdd 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic_version.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.19.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/alert_policy_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/alert_policy_service/client.py index db9bc91788a1..b8073d1d41df 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/alert_policy_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/alert_policy_service/client.py @@ -412,6 +412,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -430,6 +431,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -504,17 +506,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = AlertPolicyServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = AlertPolicyServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/group_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/group_service/client.py index b8a3e3b911a5..e431bd38bc7d 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/group_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/group_service/client.py @@ -389,6 +389,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -407,6 +408,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -481,17 +483,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = GroupServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = GroupServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/metric_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/metric_service/client.py index e6335fbda4a3..294e66fc9940 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/metric_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/metric_service/client.py @@ -404,6 +404,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -422,6 +423,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -496,17 +498,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = MetricServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = MetricServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/notification_channel_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/notification_channel_service/client.py index 64c6fa255398..48254ca11c97 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/notification_channel_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/notification_channel_service/client.py @@ -411,6 +411,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -429,6 +430,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -505,17 +507,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = NotificationChannelServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = NotificationChannelServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/query_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/query_service/client.py index 02165d784367..ef3c434c7409 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/query_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/query_service/client.py @@ -359,6 +359,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -377,6 +378,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -451,17 +453,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = QueryServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = QueryServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/service_monitoring_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/service_monitoring_service/client.py index b798a1372822..bea244ba5dbd 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/service_monitoring_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/service_monitoring_service/client.py @@ -406,6 +406,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -424,6 +425,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -500,17 +502,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = ServiceMonitoringServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = ServiceMonitoringServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/snooze_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/snooze_service/client.py index 3e4f5a6479cb..e6a10cd3bc36 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/snooze_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/snooze_service/client.py @@ -401,6 +401,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -419,6 +420,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -493,17 +495,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = SnoozeServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = SnoozeServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/uptime_check_service/client.py b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/uptime_check_service/client.py index 4b2851e72d9e..0cef4ee6c3d5 100644 --- a/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/uptime_check_service/client.py +++ b/packages/google-cloud-monitoring/google/cloud/monitoring_v3/services/uptime_check_service/client.py @@ -389,6 +389,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -407,6 +408,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -481,17 +483,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = UptimeCheckServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = UptimeCheckServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-monitoring/samples/generated_samples/snippet_metadata_google.monitoring.v3.json b/packages/google-cloud-monitoring/samples/generated_samples/snippet_metadata_google.monitoring.v3.json index 415fab28d91d..04888a5ff523 100644 --- a/packages/google-cloud-monitoring/samples/generated_samples/snippet_metadata_google.monitoring.v3.json +++ b/packages/google-cloud-monitoring/samples/generated_samples/snippet_metadata_google.monitoring.v3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-monitoring", - "version": "2.19.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-monitoring/setup.py b/packages/google-cloud-monitoring/setup.py index e4660535147d..d7b8920e6cb9 100644 --- a/packages/google-cloud-monitoring/setup.py +++ b/packages/google-cloud-monitoring/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-monitoring/testing/constraints-3.7.txt b/packages/google-cloud-monitoring/testing/constraints-3.7.txt index 81d760774d47..e53595007ad5 100644 --- a/packages/google-cloud-monitoring/testing/constraints-3.7.txt +++ b/packages/google-cloud-monitoring/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 pandas==0.23.2 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_alert_policy_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_alert_policy_service.py index 790524a9c65d..64b6ac297051 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_alert_policy_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_alert_policy_service.py @@ -83,18 +83,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -333,7 +321,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -360,42 +348,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -407,7 +402,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_alert_policy_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -455,7 +450,7 @@ def test_alert_policy_service_client_service_account_always_use_jwt( def test_alert_policy_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -512,9 +507,7 @@ def test_alert_policy_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(AlertPolicyServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -921,20 +914,20 @@ def test_alert_policy_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -946,13 +939,11 @@ def test_alert_policy_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -968,8 +959,7 @@ def test_alert_policy_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1120,8 +1110,8 @@ def test_alert_policy_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1154,7 +1144,7 @@ def test_alert_policy_service_client_create_channel_credentials_file( ) def test_list_alert_policies(request_type, transport: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1188,7 +1178,7 @@ def test_list_alert_policies_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1207,7 +1197,7 @@ async def test_list_alert_policies_async( transport: str = "grpc_asyncio", request_type=alert_service.ListAlertPoliciesRequest ): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1246,7 +1236,7 @@ async def test_list_alert_policies_async_from_dict(): def test_list_alert_policies_field_headers(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1278,7 +1268,7 @@ def test_list_alert_policies_field_headers(): @pytest.mark.asyncio async def test_list_alert_policies_field_headers_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1311,7 +1301,7 @@ async def test_list_alert_policies_field_headers_async(): def test_list_alert_policies_flattened(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1337,7 +1327,7 @@ def test_list_alert_policies_flattened(): def test_list_alert_policies_flattened_error(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1352,7 +1342,7 @@ def test_list_alert_policies_flattened_error(): @pytest.mark.asyncio async def test_list_alert_policies_flattened_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1383,7 +1373,7 @@ async def test_list_alert_policies_flattened_async(): @pytest.mark.asyncio async def test_list_alert_policies_flattened_error_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1397,7 +1387,7 @@ async def test_list_alert_policies_flattened_error_async(): def test_list_alert_policies_pager(transport_name: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1449,7 +1439,7 @@ def test_list_alert_policies_pager(transport_name: str = "grpc"): def test_list_alert_policies_pages(transport_name: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1493,7 +1483,7 @@ def test_list_alert_policies_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_alert_policies_async_pager(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1545,7 +1535,7 @@ async def test_list_alert_policies_async_pager(): @pytest.mark.asyncio async def test_list_alert_policies_async_pages(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1602,7 +1592,7 @@ async def test_list_alert_policies_async_pages(): ) def test_get_alert_policy(request_type, transport: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1640,7 +1630,7 @@ def test_get_alert_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1657,7 +1647,7 @@ async def test_get_alert_policy_async( transport: str = "grpc_asyncio", request_type=alert_service.GetAlertPolicyRequest ): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1700,7 +1690,7 @@ async def test_get_alert_policy_async_from_dict(): def test_get_alert_policy_field_headers(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1730,7 +1720,7 @@ def test_get_alert_policy_field_headers(): @pytest.mark.asyncio async def test_get_alert_policy_field_headers_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1759,7 +1749,7 @@ async def test_get_alert_policy_field_headers_async(): def test_get_alert_policy_flattened(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1783,7 +1773,7 @@ def test_get_alert_policy_flattened(): def test_get_alert_policy_flattened_error(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1798,7 +1788,7 @@ def test_get_alert_policy_flattened_error(): @pytest.mark.asyncio async def test_get_alert_policy_flattened_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1825,7 +1815,7 @@ async def test_get_alert_policy_flattened_async(): @pytest.mark.asyncio async def test_get_alert_policy_flattened_error_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1846,7 +1836,7 @@ async def test_get_alert_policy_flattened_error_async(): ) def test_create_alert_policy(request_type, transport: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1886,7 +1876,7 @@ def test_create_alert_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1905,7 +1895,7 @@ async def test_create_alert_policy_async( transport: str = "grpc_asyncio", request_type=alert_service.CreateAlertPolicyRequest ): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1950,7 +1940,7 @@ async def test_create_alert_policy_async_from_dict(): def test_create_alert_policy_field_headers(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1982,7 +1972,7 @@ def test_create_alert_policy_field_headers(): @pytest.mark.asyncio async def test_create_alert_policy_field_headers_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2013,7 +2003,7 @@ async def test_create_alert_policy_field_headers_async(): def test_create_alert_policy_flattened(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2043,7 +2033,7 @@ def test_create_alert_policy_flattened(): def test_create_alert_policy_flattened_error(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2059,7 +2049,7 @@ def test_create_alert_policy_flattened_error(): @pytest.mark.asyncio async def test_create_alert_policy_flattened_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2092,7 +2082,7 @@ async def test_create_alert_policy_flattened_async(): @pytest.mark.asyncio async def test_create_alert_policy_flattened_error_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2114,7 +2104,7 @@ async def test_create_alert_policy_flattened_error_async(): ) def test_delete_alert_policy(request_type, transport: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2143,7 +2133,7 @@ def test_delete_alert_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2162,7 +2152,7 @@ async def test_delete_alert_policy_async( transport: str = "grpc_asyncio", request_type=alert_service.DeleteAlertPolicyRequest ): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2194,7 +2184,7 @@ async def test_delete_alert_policy_async_from_dict(): def test_delete_alert_policy_field_headers(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2226,7 +2216,7 @@ def test_delete_alert_policy_field_headers(): @pytest.mark.asyncio async def test_delete_alert_policy_field_headers_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2257,7 +2247,7 @@ async def test_delete_alert_policy_field_headers_async(): def test_delete_alert_policy_flattened(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2283,7 +2273,7 @@ def test_delete_alert_policy_flattened(): def test_delete_alert_policy_flattened_error(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2298,7 +2288,7 @@ def test_delete_alert_policy_flattened_error(): @pytest.mark.asyncio async def test_delete_alert_policy_flattened_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2327,7 +2317,7 @@ async def test_delete_alert_policy_flattened_async(): @pytest.mark.asyncio async def test_delete_alert_policy_flattened_error_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2348,7 +2338,7 @@ async def test_delete_alert_policy_flattened_error_async(): ) def test_update_alert_policy(request_type, transport: str = "grpc"): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2388,7 +2378,7 @@ def test_update_alert_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2407,7 +2397,7 @@ async def test_update_alert_policy_async( transport: str = "grpc_asyncio", request_type=alert_service.UpdateAlertPolicyRequest ): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2452,7 +2442,7 @@ async def test_update_alert_policy_async_from_dict(): def test_update_alert_policy_field_headers(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2484,7 +2474,7 @@ def test_update_alert_policy_field_headers(): @pytest.mark.asyncio async def test_update_alert_policy_field_headers_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2515,7 +2505,7 @@ async def test_update_alert_policy_field_headers_async(): def test_update_alert_policy_flattened(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2545,7 +2535,7 @@ def test_update_alert_policy_flattened(): def test_update_alert_policy_flattened_error(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2561,7 +2551,7 @@ def test_update_alert_policy_flattened_error(): @pytest.mark.asyncio async def test_update_alert_policy_flattened_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2594,7 +2584,7 @@ async def test_update_alert_policy_flattened_async(): @pytest.mark.asyncio async def test_update_alert_policy_flattened_error_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2610,17 +2600,17 @@ async def test_update_alert_policy_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.AlertPolicyServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.AlertPolicyServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AlertPolicyServiceClient( @@ -2630,7 +2620,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.AlertPolicyServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2645,13 +2635,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = AlertPolicyServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.AlertPolicyServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = AlertPolicyServiceClient( @@ -2663,7 +2652,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.AlertPolicyServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = AlertPolicyServiceClient(transport=transport) assert client.transport is transport @@ -2672,13 +2661,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.AlertPolicyServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.AlertPolicyServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2694,7 +2683,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2707,7 +2696,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = AlertPolicyServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2715,7 +2704,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2727,7 +2716,7 @@ def test_alert_policy_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.AlertPolicyServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2739,7 +2728,7 @@ def test_alert_policy_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.AlertPolicyServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2775,7 +2764,7 @@ def test_alert_policy_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.alert_policy_service.transports.AlertPolicyServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AlertPolicyServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2798,7 +2787,7 @@ def test_alert_policy_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.alert_policy_service.transports.AlertPolicyServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.AlertPolicyServiceTransport() adc.assert_called_once() @@ -2806,7 +2795,7 @@ def test_alert_policy_service_base_transport_with_adc(): def test_alert_policy_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) AlertPolicyServiceClient() adc.assert_called_once_with( scopes=None, @@ -2830,7 +2819,7 @@ def test_alert_policy_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2880,7 +2869,7 @@ def test_alert_policy_service_transport_create_channel(transport_class, grpc_hel ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2914,7 +2903,7 @@ def test_alert_policy_service_transport_create_channel(transport_class, grpc_hel def test_alert_policy_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2960,7 +2949,7 @@ def test_alert_policy_service_grpc_transport_client_cert_source_for_mtls( ) def test_alert_policy_service_host_no_port(transport_name): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -2978,7 +2967,7 @@ def test_alert_policy_service_host_no_port(transport_name): ) def test_alert_policy_service_host_with_port(transport_name): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -3037,7 +3026,7 @@ def test_alert_policy_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -3276,7 +3265,7 @@ def test_client_with_default_client_info(): transports.AlertPolicyServiceTransport, "_prep_wrapped_messages" ) as prep: client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3286,7 +3275,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = AlertPolicyServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3295,7 +3284,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = AlertPolicyServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -3313,7 +3302,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -3329,7 +3318,7 @@ def test_client_ctx(): ] for transport in transports: client = AlertPolicyServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_group_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_group_service.py index 40fe2f8773bf..713c6cee3008 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_group_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_group_service.py @@ -77,18 +77,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -299,7 +287,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -326,42 +314,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -371,7 +366,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_group_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -417,7 +412,7 @@ def test_group_service_client_service_account_always_use_jwt( ], ) def test_group_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -474,9 +469,7 @@ def test_group_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(GroupServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -867,20 +860,20 @@ def test_group_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -892,13 +885,11 @@ def test_group_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -914,8 +905,7 @@ def test_group_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1064,8 +1054,8 @@ def test_group_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1098,7 +1088,7 @@ def test_group_service_client_create_channel_credentials_file( ) def test_list_groups(request_type, transport: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1128,7 +1118,7 @@ def test_list_groups_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1145,7 +1135,7 @@ async def test_list_groups_async( transport: str = "grpc_asyncio", request_type=group_service.ListGroupsRequest ): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1180,7 +1170,7 @@ async def test_list_groups_async_from_dict(): def test_list_groups_field_headers(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1210,7 +1200,7 @@ def test_list_groups_field_headers(): @pytest.mark.asyncio async def test_list_groups_field_headers_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1241,7 +1231,7 @@ async def test_list_groups_field_headers_async(): def test_list_groups_flattened(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1265,7 +1255,7 @@ def test_list_groups_flattened(): def test_list_groups_flattened_error(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1280,7 +1270,7 @@ def test_list_groups_flattened_error(): @pytest.mark.asyncio async def test_list_groups_flattened_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1309,7 +1299,7 @@ async def test_list_groups_flattened_async(): @pytest.mark.asyncio async def test_list_groups_flattened_error_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1323,7 +1313,7 @@ async def test_list_groups_flattened_error_async(): def test_list_groups_pager(transport_name: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1373,7 +1363,7 @@ def test_list_groups_pager(transport_name: str = "grpc"): def test_list_groups_pages(transport_name: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1415,7 +1405,7 @@ def test_list_groups_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_groups_async_pager(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1465,7 +1455,7 @@ async def test_list_groups_async_pager(): @pytest.mark.asyncio async def test_list_groups_async_pages(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1520,7 +1510,7 @@ async def test_list_groups_async_pages(): ) def test_get_group(request_type, transport: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1558,7 +1548,7 @@ def test_get_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1575,7 +1565,7 @@ async def test_get_group_async( transport: str = "grpc_asyncio", request_type=group_service.GetGroupRequest ): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1618,7 +1608,7 @@ async def test_get_group_async_from_dict(): def test_get_group_field_headers(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1648,7 +1638,7 @@ def test_get_group_field_headers(): @pytest.mark.asyncio async def test_get_group_field_headers_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1677,7 +1667,7 @@ async def test_get_group_field_headers_async(): def test_get_group_flattened(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1701,7 +1691,7 @@ def test_get_group_flattened(): def test_get_group_flattened_error(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1716,7 +1706,7 @@ def test_get_group_flattened_error(): @pytest.mark.asyncio async def test_get_group_flattened_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1743,7 +1733,7 @@ async def test_get_group_flattened_async(): @pytest.mark.asyncio async def test_get_group_flattened_error_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1764,7 +1754,7 @@ async def test_get_group_flattened_error_async(): ) def test_create_group(request_type, transport: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1802,7 +1792,7 @@ def test_create_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1819,7 +1809,7 @@ async def test_create_group_async( transport: str = "grpc_asyncio", request_type=group_service.CreateGroupRequest ): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1862,7 +1852,7 @@ async def test_create_group_async_from_dict(): def test_create_group_field_headers(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1892,7 +1882,7 @@ def test_create_group_field_headers(): @pytest.mark.asyncio async def test_create_group_field_headers_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1921,7 +1911,7 @@ async def test_create_group_field_headers_async(): def test_create_group_flattened(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1949,7 +1939,7 @@ def test_create_group_flattened(): def test_create_group_flattened_error(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1965,7 +1955,7 @@ def test_create_group_flattened_error(): @pytest.mark.asyncio async def test_create_group_flattened_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1996,7 +1986,7 @@ async def test_create_group_flattened_async(): @pytest.mark.asyncio async def test_create_group_flattened_error_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2018,7 +2008,7 @@ async def test_create_group_flattened_error_async(): ) def test_update_group(request_type, transport: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2056,7 +2046,7 @@ def test_update_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2073,7 +2063,7 @@ async def test_update_group_async( transport: str = "grpc_asyncio", request_type=group_service.UpdateGroupRequest ): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2116,7 +2106,7 @@ async def test_update_group_async_from_dict(): def test_update_group_field_headers(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2146,7 +2136,7 @@ def test_update_group_field_headers(): @pytest.mark.asyncio async def test_update_group_field_headers_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2175,7 +2165,7 @@ async def test_update_group_field_headers_async(): def test_update_group_flattened(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2199,7 +2189,7 @@ def test_update_group_flattened(): def test_update_group_flattened_error(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2214,7 +2204,7 @@ def test_update_group_flattened_error(): @pytest.mark.asyncio async def test_update_group_flattened_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2241,7 +2231,7 @@ async def test_update_group_flattened_async(): @pytest.mark.asyncio async def test_update_group_flattened_error_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2262,7 +2252,7 @@ async def test_update_group_flattened_error_async(): ) def test_delete_group(request_type, transport: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2289,7 +2279,7 @@ def test_delete_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2306,7 +2296,7 @@ async def test_delete_group_async( transport: str = "grpc_asyncio", request_type=group_service.DeleteGroupRequest ): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2336,7 +2326,7 @@ async def test_delete_group_async_from_dict(): def test_delete_group_field_headers(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2366,7 +2356,7 @@ def test_delete_group_field_headers(): @pytest.mark.asyncio async def test_delete_group_field_headers_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2395,7 +2385,7 @@ async def test_delete_group_field_headers_async(): def test_delete_group_flattened(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2419,7 +2409,7 @@ def test_delete_group_flattened(): def test_delete_group_flattened_error(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2434,7 +2424,7 @@ def test_delete_group_flattened_error(): @pytest.mark.asyncio async def test_delete_group_flattened_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2461,7 +2451,7 @@ async def test_delete_group_flattened_async(): @pytest.mark.asyncio async def test_delete_group_flattened_error_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2482,7 +2472,7 @@ async def test_delete_group_flattened_error_async(): ) def test_list_group_members(request_type, transport: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2516,7 +2506,7 @@ def test_list_group_members_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2535,7 +2525,7 @@ async def test_list_group_members_async( transport: str = "grpc_asyncio", request_type=group_service.ListGroupMembersRequest ): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2574,7 +2564,7 @@ async def test_list_group_members_async_from_dict(): def test_list_group_members_field_headers(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2606,7 +2596,7 @@ def test_list_group_members_field_headers(): @pytest.mark.asyncio async def test_list_group_members_field_headers_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2639,7 +2629,7 @@ async def test_list_group_members_field_headers_async(): def test_list_group_members_flattened(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2665,7 +2655,7 @@ def test_list_group_members_flattened(): def test_list_group_members_flattened_error(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2680,7 +2670,7 @@ def test_list_group_members_flattened_error(): @pytest.mark.asyncio async def test_list_group_members_flattened_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2711,7 +2701,7 @@ async def test_list_group_members_flattened_async(): @pytest.mark.asyncio async def test_list_group_members_flattened_error_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2725,7 +2715,7 @@ async def test_list_group_members_flattened_error_async(): def test_list_group_members_pager(transport_name: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2779,7 +2769,7 @@ def test_list_group_members_pager(transport_name: str = "grpc"): def test_list_group_members_pages(transport_name: str = "grpc"): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2823,7 +2813,7 @@ def test_list_group_members_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_group_members_async_pager(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2877,7 +2867,7 @@ async def test_list_group_members_async_pager(): @pytest.mark.asyncio async def test_list_group_members_async_pages(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2928,17 +2918,17 @@ async def test_list_group_members_async_pages(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.GroupServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.GroupServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GroupServiceClient( @@ -2948,7 +2938,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.GroupServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2963,13 +2953,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = GroupServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.GroupServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = GroupServiceClient( @@ -2981,7 +2970,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.GroupServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = GroupServiceClient(transport=transport) assert client.transport is transport @@ -2990,13 +2979,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.GroupServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.GroupServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3012,7 +3001,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3025,7 +3014,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = GroupServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3033,7 +3022,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3045,7 +3034,7 @@ def test_group_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.GroupServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3057,7 +3046,7 @@ def test_group_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.GroupServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3094,7 +3083,7 @@ def test_group_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.group_service.transports.GroupServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.GroupServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3117,7 +3106,7 @@ def test_group_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.group_service.transports.GroupServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.GroupServiceTransport() adc.assert_called_once() @@ -3125,7 +3114,7 @@ def test_group_service_base_transport_with_adc(): def test_group_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) GroupServiceClient() adc.assert_called_once_with( scopes=None, @@ -3149,7 +3138,7 @@ def test_group_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -3199,7 +3188,7 @@ def test_group_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -3228,7 +3217,7 @@ def test_group_service_transport_create_channel(transport_class, grpc_helpers): [transports.GroupServiceGrpcTransport, transports.GroupServiceGrpcAsyncIOTransport], ) def test_group_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -3274,7 +3263,7 @@ def test_group_service_grpc_transport_client_cert_source_for_mtls(transport_clas ) def test_group_service_host_no_port(transport_name): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -3292,7 +3281,7 @@ def test_group_service_host_no_port(transport_name): ) def test_group_service_host_with_port(transport_name): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -3346,7 +3335,7 @@ def test_group_service_transport_channel_mtls_with_client_cert_source(transport_ mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -3552,7 +3541,7 @@ def test_client_with_default_client_info(): transports.GroupServiceTransport, "_prep_wrapped_messages" ) as prep: client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3562,7 +3551,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = GroupServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3571,7 +3560,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = GroupServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -3589,7 +3578,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -3605,7 +3594,7 @@ def test_client_ctx(): ] for transport in transports: client = GroupServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_metric_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_metric_service.py index 199d7d68af75..79ac265a0448 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_metric_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_metric_service.py @@ -83,18 +83,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -316,7 +304,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -343,42 +331,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -388,7 +383,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_metric_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -434,7 +429,7 @@ def test_metric_service_client_service_account_always_use_jwt( ], ) def test_metric_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -491,9 +486,7 @@ def test_metric_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(MetricServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -890,20 +883,20 @@ def test_metric_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -915,13 +908,11 @@ def test_metric_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -937,8 +928,7 @@ def test_metric_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1089,8 +1079,8 @@ def test_metric_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1124,7 +1114,7 @@ def test_metric_service_client_create_channel_credentials_file( ) def test_list_monitored_resource_descriptors(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1156,7 +1146,7 @@ def test_list_monitored_resource_descriptors_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1176,7 +1166,7 @@ async def test_list_monitored_resource_descriptors_async( request_type=metric_service.ListMonitoredResourceDescriptorsRequest, ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1213,7 +1203,7 @@ async def test_list_monitored_resource_descriptors_async_from_dict(): def test_list_monitored_resource_descriptors_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1245,7 +1235,7 @@ def test_list_monitored_resource_descriptors_field_headers(): @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1278,7 +1268,7 @@ async def test_list_monitored_resource_descriptors_field_headers_async(): def test_list_monitored_resource_descriptors_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1304,7 +1294,7 @@ def test_list_monitored_resource_descriptors_flattened(): def test_list_monitored_resource_descriptors_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1319,7 +1309,7 @@ def test_list_monitored_resource_descriptors_flattened_error(): @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1350,7 +1340,7 @@ async def test_list_monitored_resource_descriptors_flattened_async(): @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1364,7 +1354,7 @@ async def test_list_monitored_resource_descriptors_flattened_error_async(): def test_list_monitored_resource_descriptors_pager(transport_name: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1419,7 +1409,7 @@ def test_list_monitored_resource_descriptors_pager(transport_name: str = "grpc") def test_list_monitored_resource_descriptors_pages(transport_name: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1463,7 +1453,7 @@ def test_list_monitored_resource_descriptors_pages(transport_name: str = "grpc") @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_async_pager(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1518,7 +1508,7 @@ async def test_list_monitored_resource_descriptors_async_pager(): @pytest.mark.asyncio async def test_list_monitored_resource_descriptors_async_pages(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1575,7 +1565,7 @@ async def test_list_monitored_resource_descriptors_async_pages(): ) def test_get_monitored_resource_descriptor(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1615,7 +1605,7 @@ def test_get_monitored_resource_descriptor_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1635,7 +1625,7 @@ async def test_get_monitored_resource_descriptor_async( request_type=metric_service.GetMonitoredResourceDescriptorRequest, ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1680,7 +1670,7 @@ async def test_get_monitored_resource_descriptor_async_from_dict(): def test_get_monitored_resource_descriptor_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1712,7 +1702,7 @@ def test_get_monitored_resource_descriptor_field_headers(): @pytest.mark.asyncio async def test_get_monitored_resource_descriptor_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1745,7 +1735,7 @@ async def test_get_monitored_resource_descriptor_field_headers_async(): def test_get_monitored_resource_descriptor_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1771,7 +1761,7 @@ def test_get_monitored_resource_descriptor_flattened(): def test_get_monitored_resource_descriptor_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1786,7 +1776,7 @@ def test_get_monitored_resource_descriptor_flattened_error(): @pytest.mark.asyncio async def test_get_monitored_resource_descriptor_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1817,7 +1807,7 @@ async def test_get_monitored_resource_descriptor_flattened_async(): @pytest.mark.asyncio async def test_get_monitored_resource_descriptor_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1838,7 +1828,7 @@ async def test_get_monitored_resource_descriptor_flattened_error_async(): ) def test_list_metric_descriptors(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1870,7 +1860,7 @@ def test_list_metric_descriptors_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1890,7 +1880,7 @@ async def test_list_metric_descriptors_async( request_type=metric_service.ListMetricDescriptorsRequest, ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1927,7 +1917,7 @@ async def test_list_metric_descriptors_async_from_dict(): def test_list_metric_descriptors_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1959,7 +1949,7 @@ def test_list_metric_descriptors_field_headers(): @pytest.mark.asyncio async def test_list_metric_descriptors_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1992,7 +1982,7 @@ async def test_list_metric_descriptors_field_headers_async(): def test_list_metric_descriptors_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2018,7 +2008,7 @@ def test_list_metric_descriptors_flattened(): def test_list_metric_descriptors_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2033,7 +2023,7 @@ def test_list_metric_descriptors_flattened_error(): @pytest.mark.asyncio async def test_list_metric_descriptors_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2064,7 +2054,7 @@ async def test_list_metric_descriptors_flattened_async(): @pytest.mark.asyncio async def test_list_metric_descriptors_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2078,7 +2068,7 @@ async def test_list_metric_descriptors_flattened_error_async(): def test_list_metric_descriptors_pager(transport_name: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2130,7 +2120,7 @@ def test_list_metric_descriptors_pager(transport_name: str = "grpc"): def test_list_metric_descriptors_pages(transport_name: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2174,7 +2164,7 @@ def test_list_metric_descriptors_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_metric_descriptors_async_pager(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2226,7 +2216,7 @@ async def test_list_metric_descriptors_async_pager(): @pytest.mark.asyncio async def test_list_metric_descriptors_async_pages(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2283,7 +2273,7 @@ async def test_list_metric_descriptors_async_pages(): ) def test_get_metric_descriptor(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2331,7 +2321,7 @@ def test_get_metric_descriptor_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2351,7 +2341,7 @@ async def test_get_metric_descriptor_async( request_type=metric_service.GetMetricDescriptorRequest, ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2404,7 +2394,7 @@ async def test_get_metric_descriptor_async_from_dict(): def test_get_metric_descriptor_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2436,7 +2426,7 @@ def test_get_metric_descriptor_field_headers(): @pytest.mark.asyncio async def test_get_metric_descriptor_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2469,7 +2459,7 @@ async def test_get_metric_descriptor_field_headers_async(): def test_get_metric_descriptor_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2495,7 +2485,7 @@ def test_get_metric_descriptor_flattened(): def test_get_metric_descriptor_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2510,7 +2500,7 @@ def test_get_metric_descriptor_flattened_error(): @pytest.mark.asyncio async def test_get_metric_descriptor_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2541,7 +2531,7 @@ async def test_get_metric_descriptor_flattened_async(): @pytest.mark.asyncio async def test_get_metric_descriptor_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2562,7 +2552,7 @@ async def test_get_metric_descriptor_flattened_error_async(): ) def test_create_metric_descriptor(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2610,7 +2600,7 @@ def test_create_metric_descriptor_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2630,7 +2620,7 @@ async def test_create_metric_descriptor_async( request_type=metric_service.CreateMetricDescriptorRequest, ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2683,7 +2673,7 @@ async def test_create_metric_descriptor_async_from_dict(): def test_create_metric_descriptor_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2715,7 +2705,7 @@ def test_create_metric_descriptor_field_headers(): @pytest.mark.asyncio async def test_create_metric_descriptor_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2748,7 +2738,7 @@ async def test_create_metric_descriptor_field_headers_async(): def test_create_metric_descriptor_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2778,7 +2768,7 @@ def test_create_metric_descriptor_flattened(): def test_create_metric_descriptor_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2794,7 +2784,7 @@ def test_create_metric_descriptor_flattened_error(): @pytest.mark.asyncio async def test_create_metric_descriptor_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2829,7 +2819,7 @@ async def test_create_metric_descriptor_flattened_async(): @pytest.mark.asyncio async def test_create_metric_descriptor_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2851,7 +2841,7 @@ async def test_create_metric_descriptor_flattened_error_async(): ) def test_delete_metric_descriptor(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2880,7 +2870,7 @@ def test_delete_metric_descriptor_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2900,7 +2890,7 @@ async def test_delete_metric_descriptor_async( request_type=metric_service.DeleteMetricDescriptorRequest, ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2932,7 +2922,7 @@ async def test_delete_metric_descriptor_async_from_dict(): def test_delete_metric_descriptor_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2964,7 +2954,7 @@ def test_delete_metric_descriptor_field_headers(): @pytest.mark.asyncio async def test_delete_metric_descriptor_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2995,7 +2985,7 @@ async def test_delete_metric_descriptor_field_headers_async(): def test_delete_metric_descriptor_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3021,7 +3011,7 @@ def test_delete_metric_descriptor_flattened(): def test_delete_metric_descriptor_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3036,7 +3026,7 @@ def test_delete_metric_descriptor_flattened_error(): @pytest.mark.asyncio async def test_delete_metric_descriptor_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3065,7 +3055,7 @@ async def test_delete_metric_descriptor_flattened_async(): @pytest.mark.asyncio async def test_delete_metric_descriptor_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3086,7 +3076,7 @@ async def test_delete_metric_descriptor_flattened_error_async(): ) def test_list_time_series(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3118,7 +3108,7 @@ def test_list_time_series_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3135,7 +3125,7 @@ async def test_list_time_series_async( transport: str = "grpc_asyncio", request_type=metric_service.ListTimeSeriesRequest ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3172,7 +3162,7 @@ async def test_list_time_series_async_from_dict(): def test_list_time_series_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3202,7 +3192,7 @@ def test_list_time_series_field_headers(): @pytest.mark.asyncio async def test_list_time_series_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3233,7 +3223,7 @@ async def test_list_time_series_field_headers_async(): def test_list_time_series_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3269,7 +3259,7 @@ def test_list_time_series_flattened(): def test_list_time_series_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3287,7 +3277,7 @@ def test_list_time_series_flattened_error(): @pytest.mark.asyncio async def test_list_time_series_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3328,7 +3318,7 @@ async def test_list_time_series_flattened_async(): @pytest.mark.asyncio async def test_list_time_series_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3345,7 +3335,7 @@ async def test_list_time_series_flattened_error_async(): def test_list_time_series_pager(transport_name: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3395,7 +3385,7 @@ def test_list_time_series_pager(transport_name: str = "grpc"): def test_list_time_series_pages(transport_name: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3437,7 +3427,7 @@ def test_list_time_series_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_time_series_async_pager(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3487,7 +3477,7 @@ async def test_list_time_series_async_pager(): @pytest.mark.asyncio async def test_list_time_series_async_pages(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3542,7 +3532,7 @@ async def test_list_time_series_async_pages(): ) def test_create_time_series(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3571,7 +3561,7 @@ def test_create_time_series_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3590,7 +3580,7 @@ async def test_create_time_series_async( transport: str = "grpc_asyncio", request_type=metric_service.CreateTimeSeriesRequest ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3622,7 +3612,7 @@ async def test_create_time_series_async_from_dict(): def test_create_time_series_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3654,7 +3644,7 @@ def test_create_time_series_field_headers(): @pytest.mark.asyncio async def test_create_time_series_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3685,7 +3675,7 @@ async def test_create_time_series_field_headers_async(): def test_create_time_series_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3717,7 +3707,7 @@ def test_create_time_series_flattened(): def test_create_time_series_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3735,7 +3725,7 @@ def test_create_time_series_flattened_error(): @pytest.mark.asyncio async def test_create_time_series_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3770,7 +3760,7 @@ async def test_create_time_series_flattened_async(): @pytest.mark.asyncio async def test_create_time_series_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3794,7 +3784,7 @@ async def test_create_time_series_flattened_error_async(): ) def test_create_service_time_series(request_type, transport: str = "grpc"): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3823,7 +3813,7 @@ def test_create_service_time_series_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3842,7 +3832,7 @@ async def test_create_service_time_series_async( transport: str = "grpc_asyncio", request_type=metric_service.CreateTimeSeriesRequest ): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3874,7 +3864,7 @@ async def test_create_service_time_series_async_from_dict(): def test_create_service_time_series_field_headers(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3906,7 +3896,7 @@ def test_create_service_time_series_field_headers(): @pytest.mark.asyncio async def test_create_service_time_series_field_headers_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3937,7 +3927,7 @@ async def test_create_service_time_series_field_headers_async(): def test_create_service_time_series_flattened(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3969,7 +3959,7 @@ def test_create_service_time_series_flattened(): def test_create_service_time_series_flattened_error(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3987,7 +3977,7 @@ def test_create_service_time_series_flattened_error(): @pytest.mark.asyncio async def test_create_service_time_series_flattened_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4022,7 +4012,7 @@ async def test_create_service_time_series_flattened_async(): @pytest.mark.asyncio async def test_create_service_time_series_flattened_error_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4040,17 +4030,17 @@ async def test_create_service_time_series_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.MetricServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.MetricServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MetricServiceClient( @@ -4060,7 +4050,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.MetricServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -4075,13 +4065,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = MetricServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.MetricServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = MetricServiceClient( @@ -4093,7 +4082,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.MetricServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = MetricServiceClient(transport=transport) assert client.transport is transport @@ -4102,13 +4091,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.MetricServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.MetricServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4124,7 +4113,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4137,7 +4126,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = MetricServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4145,7 +4134,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4157,7 +4146,7 @@ def test_metric_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.MetricServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4169,7 +4158,7 @@ def test_metric_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.MetricServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4209,7 +4198,7 @@ def test_metric_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.metric_service.transports.MetricServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.MetricServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4233,7 +4222,7 @@ def test_metric_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.metric_service.transports.MetricServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.MetricServiceTransport() adc.assert_called_once() @@ -4241,7 +4230,7 @@ def test_metric_service_base_transport_with_adc(): def test_metric_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) MetricServiceClient() adc.assert_called_once_with( scopes=None, @@ -4266,7 +4255,7 @@ def test_metric_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4317,7 +4306,7 @@ def test_metric_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4350,7 +4339,7 @@ def test_metric_service_transport_create_channel(transport_class, grpc_helpers): ], ) def test_metric_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4396,7 +4385,7 @@ def test_metric_service_grpc_transport_client_cert_source_for_mtls(transport_cla ) def test_metric_service_host_no_port(transport_name): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -4414,7 +4403,7 @@ def test_metric_service_host_no_port(transport_name): ) def test_metric_service_host_with_port(transport_name): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -4471,7 +4460,7 @@ def test_metric_service_transport_channel_mtls_with_client_cert_source(transport mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4705,7 +4694,7 @@ def test_client_with_default_client_info(): transports.MetricServiceTransport, "_prep_wrapped_messages" ) as prep: client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4715,7 +4704,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = MetricServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4724,7 +4713,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = MetricServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4742,7 +4731,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4758,7 +4747,7 @@ def test_client_ctx(): ] for transport in transports: client = MetricServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py index 207666abfc55..2bb62b0f3e50 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py @@ -82,18 +82,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -344,7 +332,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -371,42 +359,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -418,7 +413,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_notification_channel_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -466,7 +461,7 @@ def test_notification_channel_service_client_service_account_always_use_jwt( def test_notification_channel_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -529,9 +524,7 @@ def test_notification_channel_service_client_client_options( with mock.patch.object( NotificationChannelServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -946,20 +939,20 @@ def test_notification_channel_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -971,13 +964,11 @@ def test_notification_channel_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -993,8 +984,7 @@ def test_notification_channel_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1149,8 +1139,8 @@ def test_notification_channel_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1183,7 +1173,7 @@ def test_notification_channel_service_client_create_channel_credentials_file( ) def test_list_notification_channel_descriptors(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1219,7 +1209,7 @@ def test_list_notification_channel_descriptors_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1241,7 +1231,7 @@ async def test_list_notification_channel_descriptors_async( request_type=notification_service.ListNotificationChannelDescriptorsRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1280,7 +1270,7 @@ async def test_list_notification_channel_descriptors_async_from_dict(): def test_list_notification_channel_descriptors_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1314,7 +1304,7 @@ def test_list_notification_channel_descriptors_field_headers(): @pytest.mark.asyncio async def test_list_notification_channel_descriptors_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1347,7 +1337,7 @@ async def test_list_notification_channel_descriptors_field_headers_async(): def test_list_notification_channel_descriptors_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1375,7 +1365,7 @@ def test_list_notification_channel_descriptors_flattened(): def test_list_notification_channel_descriptors_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1390,7 +1380,7 @@ def test_list_notification_channel_descriptors_flattened_error(): @pytest.mark.asyncio async def test_list_notification_channel_descriptors_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1423,7 +1413,7 @@ async def test_list_notification_channel_descriptors_flattened_async(): @pytest.mark.asyncio async def test_list_notification_channel_descriptors_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1437,7 +1427,7 @@ async def test_list_notification_channel_descriptors_flattened_error_async(): def test_list_notification_channel_descriptors_pager(transport_name: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1491,7 +1481,7 @@ def test_list_notification_channel_descriptors_pager(transport_name: str = "grpc def test_list_notification_channel_descriptors_pages(transport_name: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1535,7 +1525,7 @@ def test_list_notification_channel_descriptors_pages(transport_name: str = "grpc @pytest.mark.asyncio async def test_list_notification_channel_descriptors_async_pager(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1589,7 +1579,7 @@ async def test_list_notification_channel_descriptors_async_pager(): @pytest.mark.asyncio async def test_list_notification_channel_descriptors_async_pages(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1646,7 +1636,7 @@ async def test_list_notification_channel_descriptors_async_pages(): ) def test_get_notification_channel_descriptor(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1688,7 +1678,7 @@ def test_get_notification_channel_descriptor_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1708,7 +1698,7 @@ async def test_get_notification_channel_descriptor_async( request_type=notification_service.GetNotificationChannelDescriptorRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1755,7 +1745,7 @@ async def test_get_notification_channel_descriptor_async_from_dict(): def test_get_notification_channel_descriptor_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1787,7 +1777,7 @@ def test_get_notification_channel_descriptor_field_headers(): @pytest.mark.asyncio async def test_get_notification_channel_descriptor_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1820,7 +1810,7 @@ async def test_get_notification_channel_descriptor_field_headers_async(): def test_get_notification_channel_descriptor_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1846,7 +1836,7 @@ def test_get_notification_channel_descriptor_flattened(): def test_get_notification_channel_descriptor_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1861,7 +1851,7 @@ def test_get_notification_channel_descriptor_flattened_error(): @pytest.mark.asyncio async def test_get_notification_channel_descriptor_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1892,7 +1882,7 @@ async def test_get_notification_channel_descriptor_flattened_async(): @pytest.mark.asyncio async def test_get_notification_channel_descriptor_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1913,7 +1903,7 @@ async def test_get_notification_channel_descriptor_flattened_error_async(): ) def test_list_notification_channels(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1947,7 +1937,7 @@ def test_list_notification_channels_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1967,7 +1957,7 @@ async def test_list_notification_channels_async( request_type=notification_service.ListNotificationChannelsRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2006,7 +1996,7 @@ async def test_list_notification_channels_async_from_dict(): def test_list_notification_channels_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2038,7 +2028,7 @@ def test_list_notification_channels_field_headers(): @pytest.mark.asyncio async def test_list_notification_channels_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2071,7 +2061,7 @@ async def test_list_notification_channels_field_headers_async(): def test_list_notification_channels_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2097,7 +2087,7 @@ def test_list_notification_channels_flattened(): def test_list_notification_channels_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2112,7 +2102,7 @@ def test_list_notification_channels_flattened_error(): @pytest.mark.asyncio async def test_list_notification_channels_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2143,7 +2133,7 @@ async def test_list_notification_channels_flattened_async(): @pytest.mark.asyncio async def test_list_notification_channels_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2157,7 +2147,7 @@ async def test_list_notification_channels_flattened_error_async(): def test_list_notification_channels_pager(transport_name: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2209,7 +2199,7 @@ def test_list_notification_channels_pager(transport_name: str = "grpc"): def test_list_notification_channels_pages(transport_name: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2253,7 +2243,7 @@ def test_list_notification_channels_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_notification_channels_async_pager(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2305,7 +2295,7 @@ async def test_list_notification_channels_async_pager(): @pytest.mark.asyncio async def test_list_notification_channels_async_pages(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2362,7 +2352,7 @@ async def test_list_notification_channels_async_pages(): ) def test_get_notification_channel(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2405,7 +2395,7 @@ def test_get_notification_channel_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2425,7 +2415,7 @@ async def test_get_notification_channel_async( request_type=notification_service.GetNotificationChannelRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2473,7 +2463,7 @@ async def test_get_notification_channel_async_from_dict(): def test_get_notification_channel_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2505,7 +2495,7 @@ def test_get_notification_channel_field_headers(): @pytest.mark.asyncio async def test_get_notification_channel_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2538,7 +2528,7 @@ async def test_get_notification_channel_field_headers_async(): def test_get_notification_channel_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2564,7 +2554,7 @@ def test_get_notification_channel_flattened(): def test_get_notification_channel_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2579,7 +2569,7 @@ def test_get_notification_channel_flattened_error(): @pytest.mark.asyncio async def test_get_notification_channel_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2610,7 +2600,7 @@ async def test_get_notification_channel_flattened_async(): @pytest.mark.asyncio async def test_get_notification_channel_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2631,7 +2621,7 @@ async def test_get_notification_channel_flattened_error_async(): ) def test_create_notification_channel(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2674,7 +2664,7 @@ def test_create_notification_channel_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2694,7 +2684,7 @@ async def test_create_notification_channel_async( request_type=notification_service.CreateNotificationChannelRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2742,7 +2732,7 @@ async def test_create_notification_channel_async_from_dict(): def test_create_notification_channel_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2774,7 +2764,7 @@ def test_create_notification_channel_field_headers(): @pytest.mark.asyncio async def test_create_notification_channel_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2807,7 +2797,7 @@ async def test_create_notification_channel_field_headers_async(): def test_create_notification_channel_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2837,7 +2827,7 @@ def test_create_notification_channel_flattened(): def test_create_notification_channel_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2853,7 +2843,7 @@ def test_create_notification_channel_flattened_error(): @pytest.mark.asyncio async def test_create_notification_channel_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2888,7 +2878,7 @@ async def test_create_notification_channel_flattened_async(): @pytest.mark.asyncio async def test_create_notification_channel_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2910,7 +2900,7 @@ async def test_create_notification_channel_flattened_error_async(): ) def test_update_notification_channel(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2953,7 +2943,7 @@ def test_update_notification_channel_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2973,7 +2963,7 @@ async def test_update_notification_channel_async( request_type=notification_service.UpdateNotificationChannelRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3021,7 +3011,7 @@ async def test_update_notification_channel_async_from_dict(): def test_update_notification_channel_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3053,7 +3043,7 @@ def test_update_notification_channel_field_headers(): @pytest.mark.asyncio async def test_update_notification_channel_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3086,7 +3076,7 @@ async def test_update_notification_channel_field_headers_async(): def test_update_notification_channel_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3116,7 +3106,7 @@ def test_update_notification_channel_flattened(): def test_update_notification_channel_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3132,7 +3122,7 @@ def test_update_notification_channel_flattened_error(): @pytest.mark.asyncio async def test_update_notification_channel_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3167,7 +3157,7 @@ async def test_update_notification_channel_flattened_async(): @pytest.mark.asyncio async def test_update_notification_channel_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3189,7 +3179,7 @@ async def test_update_notification_channel_flattened_error_async(): ) def test_delete_notification_channel(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3218,7 +3208,7 @@ def test_delete_notification_channel_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3238,7 +3228,7 @@ async def test_delete_notification_channel_async( request_type=notification_service.DeleteNotificationChannelRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3270,7 +3260,7 @@ async def test_delete_notification_channel_async_from_dict(): def test_delete_notification_channel_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3302,7 +3292,7 @@ def test_delete_notification_channel_field_headers(): @pytest.mark.asyncio async def test_delete_notification_channel_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3333,7 +3323,7 @@ async def test_delete_notification_channel_field_headers_async(): def test_delete_notification_channel_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3363,7 +3353,7 @@ def test_delete_notification_channel_flattened(): def test_delete_notification_channel_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3379,7 +3369,7 @@ def test_delete_notification_channel_flattened_error(): @pytest.mark.asyncio async def test_delete_notification_channel_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3412,7 +3402,7 @@ async def test_delete_notification_channel_flattened_async(): @pytest.mark.asyncio async def test_delete_notification_channel_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3436,7 +3426,7 @@ def test_send_notification_channel_verification_code( request_type, transport: str = "grpc" ): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3468,7 +3458,7 @@ def test_send_notification_channel_verification_code_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3491,7 +3481,7 @@ async def test_send_notification_channel_verification_code_async( request_type=notification_service.SendNotificationChannelVerificationCodeRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3526,7 +3516,7 @@ async def test_send_notification_channel_verification_code_async_from_dict(): def test_send_notification_channel_verification_code_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3558,7 +3548,7 @@ def test_send_notification_channel_verification_code_field_headers(): @pytest.mark.asyncio async def test_send_notification_channel_verification_code_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3589,7 +3579,7 @@ async def test_send_notification_channel_verification_code_field_headers_async() def test_send_notification_channel_verification_code_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3615,7 +3605,7 @@ def test_send_notification_channel_verification_code_flattened(): def test_send_notification_channel_verification_code_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3630,7 +3620,7 @@ def test_send_notification_channel_verification_code_flattened_error(): @pytest.mark.asyncio async def test_send_notification_channel_verification_code_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3659,7 +3649,7 @@ async def test_send_notification_channel_verification_code_flattened_async(): @pytest.mark.asyncio async def test_send_notification_channel_verification_code_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3682,7 +3672,7 @@ def test_get_notification_channel_verification_code( request_type, transport: str = "grpc" ): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3721,7 +3711,7 @@ def test_get_notification_channel_verification_code_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3744,7 +3734,7 @@ async def test_get_notification_channel_verification_code_async( request_type=notification_service.GetNotificationChannelVerificationCodeRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3786,7 +3776,7 @@ async def test_get_notification_channel_verification_code_async_from_dict(): def test_get_notification_channel_verification_code_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3820,7 +3810,7 @@ def test_get_notification_channel_verification_code_field_headers(): @pytest.mark.asyncio async def test_get_notification_channel_verification_code_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3853,7 +3843,7 @@ async def test_get_notification_channel_verification_code_field_headers_async(): def test_get_notification_channel_verification_code_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3881,7 +3871,7 @@ def test_get_notification_channel_verification_code_flattened(): def test_get_notification_channel_verification_code_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3896,7 +3886,7 @@ def test_get_notification_channel_verification_code_flattened_error(): @pytest.mark.asyncio async def test_get_notification_channel_verification_code_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3929,7 +3919,7 @@ async def test_get_notification_channel_verification_code_flattened_async(): @pytest.mark.asyncio async def test_get_notification_channel_verification_code_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3950,7 +3940,7 @@ async def test_get_notification_channel_verification_code_flattened_error_async( ) def test_verify_notification_channel(request_type, transport: str = "grpc"): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3993,7 +3983,7 @@ def test_verify_notification_channel_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4013,7 +4003,7 @@ async def test_verify_notification_channel_async( request_type=notification_service.VerifyNotificationChannelRequest, ): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4061,7 +4051,7 @@ async def test_verify_notification_channel_async_from_dict(): def test_verify_notification_channel_field_headers(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4093,7 +4083,7 @@ def test_verify_notification_channel_field_headers(): @pytest.mark.asyncio async def test_verify_notification_channel_field_headers_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4126,7 +4116,7 @@ async def test_verify_notification_channel_field_headers_async(): def test_verify_notification_channel_flattened(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4156,7 +4146,7 @@ def test_verify_notification_channel_flattened(): def test_verify_notification_channel_flattened_error(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4172,7 +4162,7 @@ def test_verify_notification_channel_flattened_error(): @pytest.mark.asyncio async def test_verify_notification_channel_flattened_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4207,7 +4197,7 @@ async def test_verify_notification_channel_flattened_async(): @pytest.mark.asyncio async def test_verify_notification_channel_flattened_error_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4223,17 +4213,17 @@ async def test_verify_notification_channel_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.NotificationChannelServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.NotificationChannelServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = NotificationChannelServiceClient( @@ -4243,7 +4233,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.NotificationChannelServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -4258,13 +4248,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = NotificationChannelServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.NotificationChannelServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = NotificationChannelServiceClient( @@ -4276,7 +4265,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.NotificationChannelServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = NotificationChannelServiceClient(transport=transport) assert client.transport is transport @@ -4285,13 +4274,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.NotificationChannelServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.NotificationChannelServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4307,7 +4296,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4320,7 +4309,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = NotificationChannelServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4328,7 +4317,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4340,7 +4329,7 @@ def test_notification_channel_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.NotificationChannelServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4352,7 +4341,7 @@ def test_notification_channel_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.NotificationChannelServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4393,7 +4382,7 @@ def test_notification_channel_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.notification_channel_service.transports.NotificationChannelServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.NotificationChannelServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4416,7 +4405,7 @@ def test_notification_channel_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.notification_channel_service.transports.NotificationChannelServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.NotificationChannelServiceTransport() adc.assert_called_once() @@ -4424,7 +4413,7 @@ def test_notification_channel_service_base_transport_with_adc(): def test_notification_channel_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) NotificationChannelServiceClient() adc.assert_called_once_with( scopes=None, @@ -4448,7 +4437,7 @@ def test_notification_channel_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4500,7 +4489,7 @@ def test_notification_channel_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4534,7 +4523,7 @@ def test_notification_channel_service_transport_create_channel( def test_notification_channel_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4580,7 +4569,7 @@ def test_notification_channel_service_grpc_transport_client_cert_source_for_mtls ) def test_notification_channel_service_host_no_port(transport_name): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -4598,7 +4587,7 @@ def test_notification_channel_service_host_no_port(transport_name): ) def test_notification_channel_service_host_with_port(transport_name): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -4657,7 +4646,7 @@ def test_notification_channel_service_transport_channel_mtls_with_client_cert_so mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4903,7 +4892,7 @@ def test_client_with_default_client_info(): transports.NotificationChannelServiceTransport, "_prep_wrapped_messages" ) as prep: client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4913,7 +4902,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = NotificationChannelServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4922,7 +4911,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = NotificationChannelServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4940,7 +4929,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4956,7 +4945,7 @@ def test_client_ctx(): ] for transport in transports: client = NotificationChannelServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_query_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_query_service.py index 1b9991866ed5..99cf50ea589f 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_query_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_query_service.py @@ -72,18 +72,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -294,7 +282,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -321,42 +309,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -366,7 +361,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_query_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -412,7 +407,7 @@ def test_query_service_client_service_account_always_use_jwt( ], ) def test_query_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -469,9 +464,7 @@ def test_query_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(QueryServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -862,20 +855,20 @@ def test_query_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -887,13 +880,11 @@ def test_query_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -909,8 +900,7 @@ def test_query_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1059,8 +1049,8 @@ def test_query_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1093,7 +1083,7 @@ def test_query_service_client_create_channel_credentials_file( ) def test_query_time_series(request_type, transport: str = "grpc"): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1125,7 +1115,7 @@ def test_query_time_series_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1144,7 +1134,7 @@ async def test_query_time_series_async( transport: str = "grpc_asyncio", request_type=metric_service.QueryTimeSeriesRequest ): client = QueryServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1181,7 +1171,7 @@ async def test_query_time_series_async_from_dict(): def test_query_time_series_field_headers(): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1213,7 +1203,7 @@ def test_query_time_series_field_headers(): @pytest.mark.asyncio async def test_query_time_series_field_headers_async(): client = QueryServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1246,7 +1236,7 @@ async def test_query_time_series_field_headers_async(): def test_query_time_series_pager(transport_name: str = "grpc"): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1298,7 +1288,7 @@ def test_query_time_series_pager(transport_name: str = "grpc"): def test_query_time_series_pages(transport_name: str = "grpc"): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1342,7 +1332,7 @@ def test_query_time_series_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_query_time_series_async_pager(): client = QueryServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1394,7 +1384,7 @@ async def test_query_time_series_async_pager(): @pytest.mark.asyncio async def test_query_time_series_async_pages(): client = QueryServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1445,17 +1435,17 @@ async def test_query_time_series_async_pages(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.QueryServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.QueryServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = QueryServiceClient( @@ -1465,7 +1455,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.QueryServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -1480,13 +1470,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = QueryServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.QueryServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = QueryServiceClient( @@ -1498,7 +1487,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.QueryServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = QueryServiceClient(transport=transport) assert client.transport is transport @@ -1507,13 +1496,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.QueryServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.QueryServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -1529,7 +1518,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -1542,7 +1531,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = QueryServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -1550,7 +1539,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -1562,7 +1551,7 @@ def test_query_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.QueryServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -1574,7 +1563,7 @@ def test_query_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.QueryServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -1604,7 +1593,7 @@ def test_query_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.query_service.transports.QueryServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.QueryServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -1627,7 +1616,7 @@ def test_query_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.query_service.transports.QueryServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.QueryServiceTransport() adc.assert_called_once() @@ -1635,7 +1624,7 @@ def test_query_service_base_transport_with_adc(): def test_query_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) QueryServiceClient() adc.assert_called_once_with( scopes=None, @@ -1659,7 +1648,7 @@ def test_query_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -1709,7 +1698,7 @@ def test_query_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -1738,7 +1727,7 @@ def test_query_service_transport_create_channel(transport_class, grpc_helpers): [transports.QueryServiceGrpcTransport, transports.QueryServiceGrpcAsyncIOTransport], ) def test_query_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -1784,7 +1773,7 @@ def test_query_service_grpc_transport_client_cert_source_for_mtls(transport_clas ) def test_query_service_host_no_port(transport_name): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -1802,7 +1791,7 @@ def test_query_service_host_no_port(transport_name): ) def test_query_service_host_with_port(transport_name): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -1856,7 +1845,7 @@ def test_query_service_transport_channel_mtls_with_client_cert_source(transport_ mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2039,7 +2028,7 @@ def test_client_with_default_client_info(): transports.QueryServiceTransport, "_prep_wrapped_messages" ) as prep: client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2049,7 +2038,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = QueryServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2058,7 +2047,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = QueryServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -2076,7 +2065,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -2092,7 +2081,7 @@ def test_client_ctx(): ] for transport in transports: client = QueryServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_service_monitoring_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_service_monitoring_service.py index 4e86a8c9de63..67e5bb4696b1 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_service_monitoring_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_service_monitoring_service.py @@ -77,18 +77,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -335,7 +323,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -362,42 +350,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -409,7 +404,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_service_monitoring_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -457,7 +452,7 @@ def test_service_monitoring_service_client_service_account_always_use_jwt( def test_service_monitoring_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -520,9 +515,7 @@ def test_service_monitoring_service_client_client_options( with mock.patch.object( ServiceMonitoringServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -935,20 +928,20 @@ def test_service_monitoring_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -960,13 +953,11 @@ def test_service_monitoring_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -982,8 +973,7 @@ def test_service_monitoring_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1138,8 +1128,8 @@ def test_service_monitoring_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1172,7 +1162,7 @@ def test_service_monitoring_service_client_create_channel_credentials_file( ) def test_create_service(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1204,7 +1194,7 @@ def test_create_service_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1221,7 +1211,7 @@ async def test_create_service_async( transport: str = "grpc_asyncio", request_type=service_service.CreateServiceRequest ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1258,7 +1248,7 @@ async def test_create_service_async_from_dict(): def test_create_service_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1288,7 +1278,7 @@ def test_create_service_field_headers(): @pytest.mark.asyncio async def test_create_service_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1317,7 +1307,7 @@ async def test_create_service_field_headers_async(): def test_create_service_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1345,7 +1335,7 @@ def test_create_service_flattened(): def test_create_service_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1361,7 +1351,7 @@ def test_create_service_flattened_error(): @pytest.mark.asyncio async def test_create_service_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1392,7 +1382,7 @@ async def test_create_service_flattened_async(): @pytest.mark.asyncio async def test_create_service_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1414,7 +1404,7 @@ async def test_create_service_flattened_error_async(): ) def test_get_service(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1446,7 +1436,7 @@ def test_get_service_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1463,7 +1453,7 @@ async def test_get_service_async( transport: str = "grpc_asyncio", request_type=service_service.GetServiceRequest ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1500,7 +1490,7 @@ async def test_get_service_async_from_dict(): def test_get_service_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1530,7 +1520,7 @@ def test_get_service_field_headers(): @pytest.mark.asyncio async def test_get_service_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1559,7 +1549,7 @@ async def test_get_service_field_headers_async(): def test_get_service_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1583,7 +1573,7 @@ def test_get_service_flattened(): def test_get_service_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1598,7 +1588,7 @@ def test_get_service_flattened_error(): @pytest.mark.asyncio async def test_get_service_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1625,7 +1615,7 @@ async def test_get_service_flattened_async(): @pytest.mark.asyncio async def test_get_service_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1646,7 +1636,7 @@ async def test_get_service_flattened_error_async(): ) def test_list_services(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1676,7 +1666,7 @@ def test_list_services_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1693,7 +1683,7 @@ async def test_list_services_async( transport: str = "grpc_asyncio", request_type=service_service.ListServicesRequest ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1728,7 +1718,7 @@ async def test_list_services_async_from_dict(): def test_list_services_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1758,7 +1748,7 @@ def test_list_services_field_headers(): @pytest.mark.asyncio async def test_list_services_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1789,7 +1779,7 @@ async def test_list_services_field_headers_async(): def test_list_services_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1813,7 +1803,7 @@ def test_list_services_flattened(): def test_list_services_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1828,7 +1818,7 @@ def test_list_services_flattened_error(): @pytest.mark.asyncio async def test_list_services_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1857,7 +1847,7 @@ async def test_list_services_flattened_async(): @pytest.mark.asyncio async def test_list_services_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1871,7 +1861,7 @@ async def test_list_services_flattened_error_async(): def test_list_services_pager(transport_name: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1921,7 +1911,7 @@ def test_list_services_pager(transport_name: str = "grpc"): def test_list_services_pages(transport_name: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1963,7 +1953,7 @@ def test_list_services_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_services_async_pager(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2013,7 +2003,7 @@ async def test_list_services_async_pager(): @pytest.mark.asyncio async def test_list_services_async_pages(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2068,7 +2058,7 @@ async def test_list_services_async_pages(): ) def test_update_service(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2100,7 +2090,7 @@ def test_update_service_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2117,7 +2107,7 @@ async def test_update_service_async( transport: str = "grpc_asyncio", request_type=service_service.UpdateServiceRequest ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2154,7 +2144,7 @@ async def test_update_service_async_from_dict(): def test_update_service_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2184,7 +2174,7 @@ def test_update_service_field_headers(): @pytest.mark.asyncio async def test_update_service_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2213,7 +2203,7 @@ async def test_update_service_field_headers_async(): def test_update_service_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2237,7 +2227,7 @@ def test_update_service_flattened(): def test_update_service_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2252,7 +2242,7 @@ def test_update_service_flattened_error(): @pytest.mark.asyncio async def test_update_service_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2279,7 +2269,7 @@ async def test_update_service_flattened_async(): @pytest.mark.asyncio async def test_update_service_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2300,7 +2290,7 @@ async def test_update_service_flattened_error_async(): ) def test_delete_service(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2327,7 +2317,7 @@ def test_delete_service_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2344,7 +2334,7 @@ async def test_delete_service_async( transport: str = "grpc_asyncio", request_type=service_service.DeleteServiceRequest ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2374,7 +2364,7 @@ async def test_delete_service_async_from_dict(): def test_delete_service_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2404,7 +2394,7 @@ def test_delete_service_field_headers(): @pytest.mark.asyncio async def test_delete_service_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2433,7 +2423,7 @@ async def test_delete_service_field_headers_async(): def test_delete_service_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2457,7 +2447,7 @@ def test_delete_service_flattened(): def test_delete_service_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2472,7 +2462,7 @@ def test_delete_service_flattened_error(): @pytest.mark.asyncio async def test_delete_service_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2499,7 +2489,7 @@ async def test_delete_service_flattened_async(): @pytest.mark.asyncio async def test_delete_service_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2520,7 +2510,7 @@ async def test_delete_service_flattened_error_async(): ) def test_create_service_level_objective(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2557,7 +2547,7 @@ def test_create_service_level_objective_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2577,7 +2567,7 @@ async def test_create_service_level_objective_async( request_type=service_service.CreateServiceLevelObjectiveRequest, ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2618,7 +2608,7 @@ async def test_create_service_level_objective_async_from_dict(): def test_create_service_level_objective_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2650,7 +2640,7 @@ def test_create_service_level_objective_field_headers(): @pytest.mark.asyncio async def test_create_service_level_objective_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2683,7 +2673,7 @@ async def test_create_service_level_objective_field_headers_async(): def test_create_service_level_objective_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2713,7 +2703,7 @@ def test_create_service_level_objective_flattened(): def test_create_service_level_objective_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2729,7 +2719,7 @@ def test_create_service_level_objective_flattened_error(): @pytest.mark.asyncio async def test_create_service_level_objective_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2764,7 +2754,7 @@ async def test_create_service_level_objective_flattened_async(): @pytest.mark.asyncio async def test_create_service_level_objective_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2786,7 +2776,7 @@ async def test_create_service_level_objective_flattened_error_async(): ) def test_get_service_level_objective(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2823,7 +2813,7 @@ def test_get_service_level_objective_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2843,7 +2833,7 @@ async def test_get_service_level_objective_async( request_type=service_service.GetServiceLevelObjectiveRequest, ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2884,7 +2874,7 @@ async def test_get_service_level_objective_async_from_dict(): def test_get_service_level_objective_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2916,7 +2906,7 @@ def test_get_service_level_objective_field_headers(): @pytest.mark.asyncio async def test_get_service_level_objective_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2949,7 +2939,7 @@ async def test_get_service_level_objective_field_headers_async(): def test_get_service_level_objective_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2975,7 +2965,7 @@ def test_get_service_level_objective_flattened(): def test_get_service_level_objective_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2990,7 +2980,7 @@ def test_get_service_level_objective_flattened_error(): @pytest.mark.asyncio async def test_get_service_level_objective_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3021,7 +3011,7 @@ async def test_get_service_level_objective_flattened_async(): @pytest.mark.asyncio async def test_get_service_level_objective_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3042,7 +3032,7 @@ async def test_get_service_level_objective_flattened_error_async(): ) def test_list_service_level_objectives(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3074,7 +3064,7 @@ def test_list_service_level_objectives_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3094,7 +3084,7 @@ async def test_list_service_level_objectives_async( request_type=service_service.ListServiceLevelObjectivesRequest, ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3131,7 +3121,7 @@ async def test_list_service_level_objectives_async_from_dict(): def test_list_service_level_objectives_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3163,7 +3153,7 @@ def test_list_service_level_objectives_field_headers(): @pytest.mark.asyncio async def test_list_service_level_objectives_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3196,7 +3186,7 @@ async def test_list_service_level_objectives_field_headers_async(): def test_list_service_level_objectives_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3222,7 +3212,7 @@ def test_list_service_level_objectives_flattened(): def test_list_service_level_objectives_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3237,7 +3227,7 @@ def test_list_service_level_objectives_flattened_error(): @pytest.mark.asyncio async def test_list_service_level_objectives_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3268,7 +3258,7 @@ async def test_list_service_level_objectives_flattened_async(): @pytest.mark.asyncio async def test_list_service_level_objectives_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3282,7 +3272,7 @@ async def test_list_service_level_objectives_flattened_error_async(): def test_list_service_level_objectives_pager(transport_name: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3334,7 +3324,7 @@ def test_list_service_level_objectives_pager(transport_name: str = "grpc"): def test_list_service_level_objectives_pages(transport_name: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3378,7 +3368,7 @@ def test_list_service_level_objectives_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_service_level_objectives_async_pager(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3430,7 +3420,7 @@ async def test_list_service_level_objectives_async_pager(): @pytest.mark.asyncio async def test_list_service_level_objectives_async_pages(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3487,7 +3477,7 @@ async def test_list_service_level_objectives_async_pages(): ) def test_update_service_level_objective(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3524,7 +3514,7 @@ def test_update_service_level_objective_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3544,7 +3534,7 @@ async def test_update_service_level_objective_async( request_type=service_service.UpdateServiceLevelObjectiveRequest, ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3585,7 +3575,7 @@ async def test_update_service_level_objective_async_from_dict(): def test_update_service_level_objective_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3617,7 +3607,7 @@ def test_update_service_level_objective_field_headers(): @pytest.mark.asyncio async def test_update_service_level_objective_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3650,7 +3640,7 @@ async def test_update_service_level_objective_field_headers_async(): def test_update_service_level_objective_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3676,7 +3666,7 @@ def test_update_service_level_objective_flattened(): def test_update_service_level_objective_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3691,7 +3681,7 @@ def test_update_service_level_objective_flattened_error(): @pytest.mark.asyncio async def test_update_service_level_objective_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3722,7 +3712,7 @@ async def test_update_service_level_objective_flattened_async(): @pytest.mark.asyncio async def test_update_service_level_objective_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3743,7 +3733,7 @@ async def test_update_service_level_objective_flattened_error_async(): ) def test_delete_service_level_objective(request_type, transport: str = "grpc"): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3772,7 +3762,7 @@ def test_delete_service_level_objective_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3792,7 +3782,7 @@ async def test_delete_service_level_objective_async( request_type=service_service.DeleteServiceLevelObjectiveRequest, ): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3824,7 +3814,7 @@ async def test_delete_service_level_objective_async_from_dict(): def test_delete_service_level_objective_field_headers(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3856,7 +3846,7 @@ def test_delete_service_level_objective_field_headers(): @pytest.mark.asyncio async def test_delete_service_level_objective_field_headers_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3887,7 +3877,7 @@ async def test_delete_service_level_objective_field_headers_async(): def test_delete_service_level_objective_flattened(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3913,7 +3903,7 @@ def test_delete_service_level_objective_flattened(): def test_delete_service_level_objective_flattened_error(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3928,7 +3918,7 @@ def test_delete_service_level_objective_flattened_error(): @pytest.mark.asyncio async def test_delete_service_level_objective_flattened_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3957,7 +3947,7 @@ async def test_delete_service_level_objective_flattened_async(): @pytest.mark.asyncio async def test_delete_service_level_objective_flattened_error_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3972,17 +3962,17 @@ async def test_delete_service_level_objective_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ServiceMonitoringServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.ServiceMonitoringServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = ServiceMonitoringServiceClient( @@ -3992,7 +3982,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.ServiceMonitoringServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -4007,13 +3997,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = ServiceMonitoringServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.ServiceMonitoringServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = ServiceMonitoringServiceClient( @@ -4025,7 +4014,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.ServiceMonitoringServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = ServiceMonitoringServiceClient(transport=transport) assert client.transport is transport @@ -4034,13 +4023,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.ServiceMonitoringServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.ServiceMonitoringServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -4056,7 +4045,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -4069,7 +4058,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = ServiceMonitoringServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -4077,7 +4066,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -4089,7 +4078,7 @@ def test_service_monitoring_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.ServiceMonitoringServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -4101,7 +4090,7 @@ def test_service_monitoring_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.ServiceMonitoringServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4142,7 +4131,7 @@ def test_service_monitoring_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.service_monitoring_service.transports.ServiceMonitoringServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ServiceMonitoringServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4165,7 +4154,7 @@ def test_service_monitoring_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.service_monitoring_service.transports.ServiceMonitoringServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.ServiceMonitoringServiceTransport() adc.assert_called_once() @@ -4173,7 +4162,7 @@ def test_service_monitoring_service_base_transport_with_adc(): def test_service_monitoring_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) ServiceMonitoringServiceClient() adc.assert_called_once_with( scopes=None, @@ -4197,7 +4186,7 @@ def test_service_monitoring_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4249,7 +4238,7 @@ def test_service_monitoring_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4283,7 +4272,7 @@ def test_service_monitoring_service_transport_create_channel( def test_service_monitoring_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4329,7 +4318,7 @@ def test_service_monitoring_service_grpc_transport_client_cert_source_for_mtls( ) def test_service_monitoring_service_host_no_port(transport_name): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -4347,7 +4336,7 @@ def test_service_monitoring_service_host_no_port(transport_name): ) def test_service_monitoring_service_host_with_port(transport_name): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -4406,7 +4395,7 @@ def test_service_monitoring_service_transport_channel_mtls_with_client_cert_sour mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4643,7 +4632,7 @@ def test_client_with_default_client_info(): transports.ServiceMonitoringServiceTransport, "_prep_wrapped_messages" ) as prep: client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4653,7 +4642,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = ServiceMonitoringServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4662,7 +4651,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = ServiceMonitoringServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4680,7 +4669,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4696,7 +4685,7 @@ def test_client_ctx(): ] for transport in transports: client = ServiceMonitoringServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_snooze_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_snooze_service.py index 98579aadea77..4ce7f7e3d6d1 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_snooze_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_snooze_service.py @@ -77,18 +77,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -310,7 +298,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -337,42 +325,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -382,7 +377,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_snooze_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -428,7 +423,7 @@ def test_snooze_service_client_service_account_always_use_jwt( ], ) def test_snooze_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -485,9 +480,7 @@ def test_snooze_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(SnoozeServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -884,20 +877,20 @@ def test_snooze_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -909,13 +902,11 @@ def test_snooze_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -931,8 +922,7 @@ def test_snooze_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1083,8 +1073,8 @@ def test_snooze_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1117,7 +1107,7 @@ def test_snooze_service_client_create_channel_credentials_file( ) def test_create_snooze(request_type, transport: str = "grpc"): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1149,7 +1139,7 @@ def test_create_snooze_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1166,7 +1156,7 @@ async def test_create_snooze_async( transport: str = "grpc_asyncio", request_type=snooze_service.CreateSnoozeRequest ): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1203,7 +1193,7 @@ async def test_create_snooze_async_from_dict(): def test_create_snooze_field_headers(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1233,7 +1223,7 @@ def test_create_snooze_field_headers(): @pytest.mark.asyncio async def test_create_snooze_field_headers_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1262,7 +1252,7 @@ async def test_create_snooze_field_headers_async(): def test_create_snooze_flattened(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1290,7 +1280,7 @@ def test_create_snooze_flattened(): def test_create_snooze_flattened_error(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1306,7 +1296,7 @@ def test_create_snooze_flattened_error(): @pytest.mark.asyncio async def test_create_snooze_flattened_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1337,7 +1327,7 @@ async def test_create_snooze_flattened_async(): @pytest.mark.asyncio async def test_create_snooze_flattened_error_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1359,7 +1349,7 @@ async def test_create_snooze_flattened_error_async(): ) def test_list_snoozes(request_type, transport: str = "grpc"): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1389,7 +1379,7 @@ def test_list_snoozes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1406,7 +1396,7 @@ async def test_list_snoozes_async( transport: str = "grpc_asyncio", request_type=snooze_service.ListSnoozesRequest ): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1441,7 +1431,7 @@ async def test_list_snoozes_async_from_dict(): def test_list_snoozes_field_headers(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1471,7 +1461,7 @@ def test_list_snoozes_field_headers(): @pytest.mark.asyncio async def test_list_snoozes_field_headers_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1502,7 +1492,7 @@ async def test_list_snoozes_field_headers_async(): def test_list_snoozes_flattened(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1526,7 +1516,7 @@ def test_list_snoozes_flattened(): def test_list_snoozes_flattened_error(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1541,7 +1531,7 @@ def test_list_snoozes_flattened_error(): @pytest.mark.asyncio async def test_list_snoozes_flattened_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1570,7 +1560,7 @@ async def test_list_snoozes_flattened_async(): @pytest.mark.asyncio async def test_list_snoozes_flattened_error_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1584,7 +1574,7 @@ async def test_list_snoozes_flattened_error_async(): def test_list_snoozes_pager(transport_name: str = "grpc"): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1634,7 +1624,7 @@ def test_list_snoozes_pager(transport_name: str = "grpc"): def test_list_snoozes_pages(transport_name: str = "grpc"): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1676,7 +1666,7 @@ def test_list_snoozes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_snoozes_async_pager(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1726,7 +1716,7 @@ async def test_list_snoozes_async_pager(): @pytest.mark.asyncio async def test_list_snoozes_async_pages(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1781,7 +1771,7 @@ async def test_list_snoozes_async_pages(): ) def test_get_snooze(request_type, transport: str = "grpc"): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1813,7 +1803,7 @@ def test_get_snooze_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1830,7 +1820,7 @@ async def test_get_snooze_async( transport: str = "grpc_asyncio", request_type=snooze_service.GetSnoozeRequest ): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1867,7 +1857,7 @@ async def test_get_snooze_async_from_dict(): def test_get_snooze_field_headers(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1897,7 +1887,7 @@ def test_get_snooze_field_headers(): @pytest.mark.asyncio async def test_get_snooze_field_headers_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1926,7 +1916,7 @@ async def test_get_snooze_field_headers_async(): def test_get_snooze_flattened(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1950,7 +1940,7 @@ def test_get_snooze_flattened(): def test_get_snooze_flattened_error(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1965,7 +1955,7 @@ def test_get_snooze_flattened_error(): @pytest.mark.asyncio async def test_get_snooze_flattened_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1992,7 +1982,7 @@ async def test_get_snooze_flattened_async(): @pytest.mark.asyncio async def test_get_snooze_flattened_error_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2013,7 +2003,7 @@ async def test_get_snooze_flattened_error_async(): ) def test_update_snooze(request_type, transport: str = "grpc"): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2045,7 +2035,7 @@ def test_update_snooze_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2062,7 +2052,7 @@ async def test_update_snooze_async( transport: str = "grpc_asyncio", request_type=snooze_service.UpdateSnoozeRequest ): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2099,7 +2089,7 @@ async def test_update_snooze_async_from_dict(): def test_update_snooze_field_headers(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2129,7 +2119,7 @@ def test_update_snooze_field_headers(): @pytest.mark.asyncio async def test_update_snooze_field_headers_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2158,7 +2148,7 @@ async def test_update_snooze_field_headers_async(): def test_update_snooze_flattened(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2186,7 +2176,7 @@ def test_update_snooze_flattened(): def test_update_snooze_flattened_error(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2202,7 +2192,7 @@ def test_update_snooze_flattened_error(): @pytest.mark.asyncio async def test_update_snooze_flattened_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2233,7 +2223,7 @@ async def test_update_snooze_flattened_async(): @pytest.mark.asyncio async def test_update_snooze_flattened_error_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2249,17 +2239,17 @@ async def test_update_snooze_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.SnoozeServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.SnoozeServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = SnoozeServiceClient( @@ -2269,7 +2259,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.SnoozeServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2284,13 +2274,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = SnoozeServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.SnoozeServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = SnoozeServiceClient( @@ -2302,7 +2291,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.SnoozeServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = SnoozeServiceClient(transport=transport) assert client.transport is transport @@ -2311,13 +2300,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.SnoozeServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.SnoozeServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2333,7 +2322,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2346,7 +2335,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = SnoozeServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2354,7 +2343,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2366,7 +2355,7 @@ def test_snooze_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.SnoozeServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2378,7 +2367,7 @@ def test_snooze_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.SnoozeServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2413,7 +2402,7 @@ def test_snooze_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.snooze_service.transports.SnoozeServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.SnoozeServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2436,7 +2425,7 @@ def test_snooze_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.snooze_service.transports.SnoozeServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.SnoozeServiceTransport() adc.assert_called_once() @@ -2444,7 +2433,7 @@ def test_snooze_service_base_transport_with_adc(): def test_snooze_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) SnoozeServiceClient() adc.assert_called_once_with( scopes=None, @@ -2468,7 +2457,7 @@ def test_snooze_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2518,7 +2507,7 @@ def test_snooze_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2550,7 +2539,7 @@ def test_snooze_service_transport_create_channel(transport_class, grpc_helpers): ], ) def test_snooze_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2596,7 +2585,7 @@ def test_snooze_service_grpc_transport_client_cert_source_for_mtls(transport_cla ) def test_snooze_service_host_no_port(transport_name): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -2614,7 +2603,7 @@ def test_snooze_service_host_no_port(transport_name): ) def test_snooze_service_host_with_port(transport_name): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -2671,7 +2660,7 @@ def test_snooze_service_transport_channel_mtls_with_client_cert_source(transport mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2903,7 +2892,7 @@ def test_client_with_default_client_info(): transports.SnoozeServiceTransport, "_prep_wrapped_messages" ) as prep: client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2913,7 +2902,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = SnoozeServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -2922,7 +2911,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = SnoozeServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -2940,7 +2929,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -2956,7 +2945,7 @@ def test_client_ctx(): ] for transport in transports: client = SnoozeServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_uptime_check_service.py b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_uptime_check_service.py index 99ef08f6c86d..faf5a6fad3b9 100644 --- a/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_uptime_check_service.py +++ b/packages/google-cloud-monitoring/tests/unit/gapic/monitoring_v3/test_uptime_check_service.py @@ -75,18 +75,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -325,7 +313,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -352,42 +340,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -399,7 +394,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_uptime_check_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -447,7 +442,7 @@ def test_uptime_check_service_client_service_account_always_use_jwt( def test_uptime_check_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -504,9 +499,7 @@ def test_uptime_check_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(UptimeCheckServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -913,20 +906,20 @@ def test_uptime_check_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -938,13 +931,11 @@ def test_uptime_check_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -960,8 +951,7 @@ def test_uptime_check_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1112,8 +1102,8 @@ def test_uptime_check_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1146,7 +1136,7 @@ def test_uptime_check_service_client_create_channel_credentials_file( ) def test_list_uptime_check_configs(request_type, transport: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1180,7 +1170,7 @@ def test_list_uptime_check_configs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1200,7 +1190,7 @@ async def test_list_uptime_check_configs_async( request_type=uptime_service.ListUptimeCheckConfigsRequest, ): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1239,7 +1229,7 @@ async def test_list_uptime_check_configs_async_from_dict(): def test_list_uptime_check_configs_field_headers(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1271,7 +1261,7 @@ def test_list_uptime_check_configs_field_headers(): @pytest.mark.asyncio async def test_list_uptime_check_configs_field_headers_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1304,7 +1294,7 @@ async def test_list_uptime_check_configs_field_headers_async(): def test_list_uptime_check_configs_flattened(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1330,7 +1320,7 @@ def test_list_uptime_check_configs_flattened(): def test_list_uptime_check_configs_flattened_error(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1345,7 +1335,7 @@ def test_list_uptime_check_configs_flattened_error(): @pytest.mark.asyncio async def test_list_uptime_check_configs_flattened_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1376,7 +1366,7 @@ async def test_list_uptime_check_configs_flattened_async(): @pytest.mark.asyncio async def test_list_uptime_check_configs_flattened_error_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1390,7 +1380,7 @@ async def test_list_uptime_check_configs_flattened_error_async(): def test_list_uptime_check_configs_pager(transport_name: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1442,7 +1432,7 @@ def test_list_uptime_check_configs_pager(transport_name: str = "grpc"): def test_list_uptime_check_configs_pages(transport_name: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1486,7 +1476,7 @@ def test_list_uptime_check_configs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_uptime_check_configs_async_pager(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1538,7 +1528,7 @@ async def test_list_uptime_check_configs_async_pager(): @pytest.mark.asyncio async def test_list_uptime_check_configs_async_pages(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1595,7 +1585,7 @@ async def test_list_uptime_check_configs_async_pages(): ) def test_get_uptime_check_config(request_type, transport: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1637,7 +1627,7 @@ def test_get_uptime_check_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1657,7 +1647,7 @@ async def test_get_uptime_check_config_async( request_type=uptime_service.GetUptimeCheckConfigRequest, ): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1704,7 +1694,7 @@ async def test_get_uptime_check_config_async_from_dict(): def test_get_uptime_check_config_field_headers(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1736,7 +1726,7 @@ def test_get_uptime_check_config_field_headers(): @pytest.mark.asyncio async def test_get_uptime_check_config_field_headers_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1769,7 +1759,7 @@ async def test_get_uptime_check_config_field_headers_async(): def test_get_uptime_check_config_flattened(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1795,7 +1785,7 @@ def test_get_uptime_check_config_flattened(): def test_get_uptime_check_config_flattened_error(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1810,7 +1800,7 @@ def test_get_uptime_check_config_flattened_error(): @pytest.mark.asyncio async def test_get_uptime_check_config_flattened_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1841,7 +1831,7 @@ async def test_get_uptime_check_config_flattened_async(): @pytest.mark.asyncio async def test_get_uptime_check_config_flattened_error_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1862,7 +1852,7 @@ async def test_get_uptime_check_config_flattened_error_async(): ) def test_create_uptime_check_config(request_type, transport: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1904,7 +1894,7 @@ def test_create_uptime_check_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1924,7 +1914,7 @@ async def test_create_uptime_check_config_async( request_type=uptime_service.CreateUptimeCheckConfigRequest, ): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1971,7 +1961,7 @@ async def test_create_uptime_check_config_async_from_dict(): def test_create_uptime_check_config_field_headers(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2003,7 +1993,7 @@ def test_create_uptime_check_config_field_headers(): @pytest.mark.asyncio async def test_create_uptime_check_config_field_headers_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2036,7 +2026,7 @@ async def test_create_uptime_check_config_field_headers_async(): def test_create_uptime_check_config_flattened(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2066,7 +2056,7 @@ def test_create_uptime_check_config_flattened(): def test_create_uptime_check_config_flattened_error(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2082,7 +2072,7 @@ def test_create_uptime_check_config_flattened_error(): @pytest.mark.asyncio async def test_create_uptime_check_config_flattened_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2117,7 +2107,7 @@ async def test_create_uptime_check_config_flattened_async(): @pytest.mark.asyncio async def test_create_uptime_check_config_flattened_error_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2139,7 +2129,7 @@ async def test_create_uptime_check_config_flattened_error_async(): ) def test_update_uptime_check_config(request_type, transport: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2181,7 +2171,7 @@ def test_update_uptime_check_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2201,7 +2191,7 @@ async def test_update_uptime_check_config_async( request_type=uptime_service.UpdateUptimeCheckConfigRequest, ): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2248,7 +2238,7 @@ async def test_update_uptime_check_config_async_from_dict(): def test_update_uptime_check_config_field_headers(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2280,7 +2270,7 @@ def test_update_uptime_check_config_field_headers(): @pytest.mark.asyncio async def test_update_uptime_check_config_field_headers_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2313,7 +2303,7 @@ async def test_update_uptime_check_config_field_headers_async(): def test_update_uptime_check_config_flattened(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2339,7 +2329,7 @@ def test_update_uptime_check_config_flattened(): def test_update_uptime_check_config_flattened_error(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2354,7 +2344,7 @@ def test_update_uptime_check_config_flattened_error(): @pytest.mark.asyncio async def test_update_uptime_check_config_flattened_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2385,7 +2375,7 @@ async def test_update_uptime_check_config_flattened_async(): @pytest.mark.asyncio async def test_update_uptime_check_config_flattened_error_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2406,7 +2396,7 @@ async def test_update_uptime_check_config_flattened_error_async(): ) def test_delete_uptime_check_config(request_type, transport: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2435,7 +2425,7 @@ def test_delete_uptime_check_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2455,7 +2445,7 @@ async def test_delete_uptime_check_config_async( request_type=uptime_service.DeleteUptimeCheckConfigRequest, ): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2487,7 +2477,7 @@ async def test_delete_uptime_check_config_async_from_dict(): def test_delete_uptime_check_config_field_headers(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2519,7 +2509,7 @@ def test_delete_uptime_check_config_field_headers(): @pytest.mark.asyncio async def test_delete_uptime_check_config_field_headers_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2550,7 +2540,7 @@ async def test_delete_uptime_check_config_field_headers_async(): def test_delete_uptime_check_config_flattened(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2576,7 +2566,7 @@ def test_delete_uptime_check_config_flattened(): def test_delete_uptime_check_config_flattened_error(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2591,7 +2581,7 @@ def test_delete_uptime_check_config_flattened_error(): @pytest.mark.asyncio async def test_delete_uptime_check_config_flattened_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2620,7 +2610,7 @@ async def test_delete_uptime_check_config_flattened_async(): @pytest.mark.asyncio async def test_delete_uptime_check_config_flattened_error_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2641,7 +2631,7 @@ async def test_delete_uptime_check_config_flattened_error_async(): ) def test_list_uptime_check_ips(request_type, transport: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2673,7 +2663,7 @@ def test_list_uptime_check_ips_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2693,7 +2683,7 @@ async def test_list_uptime_check_ips_async( request_type=uptime_service.ListUptimeCheckIpsRequest, ): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2730,7 +2720,7 @@ async def test_list_uptime_check_ips_async_from_dict(): def test_list_uptime_check_ips_pager(transport_name: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2779,7 +2769,7 @@ def test_list_uptime_check_ips_pager(transport_name: str = "grpc"): def test_list_uptime_check_ips_pages(transport_name: str = "grpc"): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2823,7 +2813,7 @@ def test_list_uptime_check_ips_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_uptime_check_ips_async_pager(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2875,7 +2865,7 @@ async def test_list_uptime_check_ips_async_pager(): @pytest.mark.asyncio async def test_list_uptime_check_ips_async_pages(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2926,17 +2916,17 @@ async def test_list_uptime_check_ips_async_pages(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.UptimeCheckServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.UptimeCheckServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = UptimeCheckServiceClient( @@ -2946,7 +2936,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.UptimeCheckServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2961,13 +2951,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = UptimeCheckServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.UptimeCheckServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = UptimeCheckServiceClient( @@ -2979,7 +2968,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.UptimeCheckServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = UptimeCheckServiceClient(transport=transport) assert client.transport is transport @@ -2988,13 +2977,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.UptimeCheckServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.UptimeCheckServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3010,7 +2999,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3023,7 +3012,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = UptimeCheckServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3031,7 +3020,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3043,7 +3032,7 @@ def test_uptime_check_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.UptimeCheckServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3055,7 +3044,7 @@ def test_uptime_check_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.UptimeCheckServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -3092,7 +3081,7 @@ def test_uptime_check_service_base_transport_with_credentials_file(): "google.cloud.monitoring_v3.services.uptime_check_service.transports.UptimeCheckServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.UptimeCheckServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -3115,7 +3104,7 @@ def test_uptime_check_service_base_transport_with_adc(): "google.cloud.monitoring_v3.services.uptime_check_service.transports.UptimeCheckServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.UptimeCheckServiceTransport() adc.assert_called_once() @@ -3123,7 +3112,7 @@ def test_uptime_check_service_base_transport_with_adc(): def test_uptime_check_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) UptimeCheckServiceClient() adc.assert_called_once_with( scopes=None, @@ -3147,7 +3136,7 @@ def test_uptime_check_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -3197,7 +3186,7 @@ def test_uptime_check_service_transport_create_channel(transport_class, grpc_hel ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -3231,7 +3220,7 @@ def test_uptime_check_service_transport_create_channel(transport_class, grpc_hel def test_uptime_check_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -3277,7 +3266,7 @@ def test_uptime_check_service_grpc_transport_client_cert_source_for_mtls( ) def test_uptime_check_service_host_no_port(transport_name): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com" ), @@ -3295,7 +3284,7 @@ def test_uptime_check_service_host_no_port(transport_name): ) def test_uptime_check_service_host_with_port(transport_name): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="monitoring.googleapis.com:8000" ), @@ -3354,7 +3343,7 @@ def test_uptime_check_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -3565,7 +3554,7 @@ def test_client_with_default_client_info(): transports.UptimeCheckServiceTransport, "_prep_wrapped_messages" ) as prep: client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3575,7 +3564,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = UptimeCheckServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3584,7 +3573,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = UptimeCheckServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -3602,7 +3591,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -3618,7 +3607,7 @@ def test_client_ctx(): ] for transport in transports: client = UptimeCheckServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-netapp/google/cloud/netapp/gapic_version.py b/packages/google-cloud-netapp/google/cloud/netapp/gapic_version.py index 3d5b3af8dd99..360a0d13ebdd 100644 --- a/packages/google-cloud-netapp/google/cloud/netapp/gapic_version.py +++ b/packages/google-cloud-netapp/google/cloud/netapp/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.4" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-netapp/google/cloud/netapp_v1/gapic_version.py b/packages/google-cloud-netapp/google/cloud/netapp_v1/gapic_version.py index 3d5b3af8dd99..360a0d13ebdd 100644 --- a/packages/google-cloud-netapp/google/cloud/netapp_v1/gapic_version.py +++ b/packages/google-cloud-netapp/google/cloud/netapp_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.4" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/client.py b/packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/client.py index 258ba11e762d..abcdc3518171 100644 --- a/packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/client.py +++ b/packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/client.py @@ -605,6 +605,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -623,6 +624,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -697,17 +699,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = NetAppClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = NetAppClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-netapp/samples/generated_samples/snippet_metadata_google.cloud.netapp.v1.json b/packages/google-cloud-netapp/samples/generated_samples/snippet_metadata_google.cloud.netapp.v1.json index db5b91d382e0..3edfdb18757c 100644 --- a/packages/google-cloud-netapp/samples/generated_samples/snippet_metadata_google.cloud.netapp.v1.json +++ b/packages/google-cloud-netapp/samples/generated_samples/snippet_metadata_google.cloud.netapp.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-netapp", - "version": "0.3.4" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-netapp/setup.py b/packages/google-cloud-netapp/setup.py index 5dafcb2e7501..5613b21ddddf 100644 --- a/packages/google-cloud-netapp/setup.py +++ b/packages/google-cloud-netapp/setup.py @@ -40,6 +40,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", ] diff --git a/packages/google-cloud-netapp/testing/constraints-3.7.txt b/packages/google-cloud-netapp/testing/constraints-3.7.txt index 185f7d366c2f..2c74b9860b39 100644 --- a/packages/google-cloud-netapp/testing/constraints-3.7.txt +++ b/packages/google-cloud-netapp/testing/constraints-3.7.txt @@ -5,5 +5,6 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 diff --git a/packages/google-cloud-netapp/tests/unit/gapic/netapp_v1/test_net_app.py b/packages/google-cloud-netapp/tests/unit/gapic/netapp_v1/test_net_app.py index d77656569ffa..f7c61b51ebb8 100644 --- a/packages/google-cloud-netapp/tests/unit/gapic/netapp_v1/test_net_app.py +++ b/packages/google-cloud-netapp/tests/unit/gapic/netapp_v1/test_net_app.py @@ -108,18 +108,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -310,7 +298,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -337,42 +325,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -383,7 +378,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_net_app_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -433,7 +428,7 @@ def test_net_app_client_service_account_always_use_jwt(transport_class, transpor ], ) def test_net_app_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -490,9 +485,7 @@ def test_net_app_client_get_transport_class(): def test_net_app_client_client_options(client_class, transport_class, transport_name): # Check that if channel is provided we won't create a new one. with mock.patch.object(NetAppClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -883,20 +876,20 @@ def test_net_app_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -908,13 +901,11 @@ def test_net_app_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -930,8 +921,7 @@ def test_net_app_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1068,8 +1058,8 @@ def test_net_app_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1098,7 +1088,7 @@ def test_net_app_client_create_channel_credentials_file( ) def test_list_storage_pools(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1132,7 +1122,7 @@ def test_list_storage_pools_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1151,7 +1141,7 @@ async def test_list_storage_pools_async( transport: str = "grpc_asyncio", request_type=storage_pool.ListStoragePoolsRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1190,7 +1180,7 @@ async def test_list_storage_pools_async_from_dict(): def test_list_storage_pools_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1222,7 +1212,7 @@ def test_list_storage_pools_field_headers(): @pytest.mark.asyncio async def test_list_storage_pools_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1255,7 +1245,7 @@ async def test_list_storage_pools_field_headers_async(): def test_list_storage_pools_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1281,7 +1271,7 @@ def test_list_storage_pools_flattened(): def test_list_storage_pools_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1296,7 +1286,7 @@ def test_list_storage_pools_flattened_error(): @pytest.mark.asyncio async def test_list_storage_pools_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1327,7 +1317,7 @@ async def test_list_storage_pools_flattened_async(): @pytest.mark.asyncio async def test_list_storage_pools_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1341,7 +1331,7 @@ async def test_list_storage_pools_flattened_error_async(): def test_list_storage_pools_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1393,7 +1383,7 @@ def test_list_storage_pools_pager(transport_name: str = "grpc"): def test_list_storage_pools_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1437,7 +1427,7 @@ def test_list_storage_pools_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_storage_pools_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1489,7 +1479,7 @@ async def test_list_storage_pools_async_pager(): @pytest.mark.asyncio async def test_list_storage_pools_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1546,7 +1536,7 @@ async def test_list_storage_pools_async_pages(): ) def test_create_storage_pool(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1575,7 +1565,7 @@ def test_create_storage_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1595,7 +1585,7 @@ async def test_create_storage_pool_async( request_type=gcn_storage_pool.CreateStoragePoolRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1629,7 +1619,7 @@ async def test_create_storage_pool_async_from_dict(): def test_create_storage_pool_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1661,7 +1651,7 @@ def test_create_storage_pool_field_headers(): @pytest.mark.asyncio async def test_create_storage_pool_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1694,7 +1684,7 @@ async def test_create_storage_pool_field_headers_async(): def test_create_storage_pool_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1728,7 +1718,7 @@ def test_create_storage_pool_flattened(): def test_create_storage_pool_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1745,7 +1735,7 @@ def test_create_storage_pool_flattened_error(): @pytest.mark.asyncio async def test_create_storage_pool_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1784,7 +1774,7 @@ async def test_create_storage_pool_flattened_async(): @pytest.mark.asyncio async def test_create_storage_pool_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1807,7 +1797,7 @@ async def test_create_storage_pool_flattened_error_async(): ) def test_get_storage_pool(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1865,7 +1855,7 @@ def test_get_storage_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1882,7 +1872,7 @@ async def test_get_storage_pool_async( transport: str = "grpc_asyncio", request_type=storage_pool.GetStoragePoolRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1945,7 +1935,7 @@ async def test_get_storage_pool_async_from_dict(): def test_get_storage_pool_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1975,7 +1965,7 @@ def test_get_storage_pool_field_headers(): @pytest.mark.asyncio async def test_get_storage_pool_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2006,7 +1996,7 @@ async def test_get_storage_pool_field_headers_async(): def test_get_storage_pool_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2030,7 +2020,7 @@ def test_get_storage_pool_flattened(): def test_get_storage_pool_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2045,7 +2035,7 @@ def test_get_storage_pool_flattened_error(): @pytest.mark.asyncio async def test_get_storage_pool_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2074,7 +2064,7 @@ async def test_get_storage_pool_flattened_async(): @pytest.mark.asyncio async def test_get_storage_pool_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2095,7 +2085,7 @@ async def test_get_storage_pool_flattened_error_async(): ) def test_update_storage_pool(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2124,7 +2114,7 @@ def test_update_storage_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2144,7 +2134,7 @@ async def test_update_storage_pool_async( request_type=gcn_storage_pool.UpdateStoragePoolRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2178,7 +2168,7 @@ async def test_update_storage_pool_async_from_dict(): def test_update_storage_pool_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2210,7 +2200,7 @@ def test_update_storage_pool_field_headers(): @pytest.mark.asyncio async def test_update_storage_pool_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2243,7 +2233,7 @@ async def test_update_storage_pool_field_headers_async(): def test_update_storage_pool_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2273,7 +2263,7 @@ def test_update_storage_pool_flattened(): def test_update_storage_pool_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2289,7 +2279,7 @@ def test_update_storage_pool_flattened_error(): @pytest.mark.asyncio async def test_update_storage_pool_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2324,7 +2314,7 @@ async def test_update_storage_pool_flattened_async(): @pytest.mark.asyncio async def test_update_storage_pool_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2346,7 +2336,7 @@ async def test_update_storage_pool_flattened_error_async(): ) def test_delete_storage_pool(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2375,7 +2365,7 @@ def test_delete_storage_pool_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2394,7 +2384,7 @@ async def test_delete_storage_pool_async( transport: str = "grpc_asyncio", request_type=storage_pool.DeleteStoragePoolRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2428,7 +2418,7 @@ async def test_delete_storage_pool_async_from_dict(): def test_delete_storage_pool_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2460,7 +2450,7 @@ def test_delete_storage_pool_field_headers(): @pytest.mark.asyncio async def test_delete_storage_pool_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2493,7 +2483,7 @@ async def test_delete_storage_pool_field_headers_async(): def test_delete_storage_pool_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2519,7 +2509,7 @@ def test_delete_storage_pool_flattened(): def test_delete_storage_pool_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2534,7 +2524,7 @@ def test_delete_storage_pool_flattened_error(): @pytest.mark.asyncio async def test_delete_storage_pool_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2565,7 +2555,7 @@ async def test_delete_storage_pool_flattened_async(): @pytest.mark.asyncio async def test_delete_storage_pool_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2586,7 +2576,7 @@ async def test_delete_storage_pool_flattened_error_async(): ) def test_list_volumes(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2618,7 +2608,7 @@ def test_list_volumes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2635,7 +2625,7 @@ async def test_list_volumes_async( transport: str = "grpc_asyncio", request_type=volume.ListVolumesRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2672,7 +2662,7 @@ async def test_list_volumes_async_from_dict(): def test_list_volumes_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2702,7 +2692,7 @@ def test_list_volumes_field_headers(): @pytest.mark.asyncio async def test_list_volumes_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2733,7 +2723,7 @@ async def test_list_volumes_field_headers_async(): def test_list_volumes_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2757,7 +2747,7 @@ def test_list_volumes_flattened(): def test_list_volumes_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2772,7 +2762,7 @@ def test_list_volumes_flattened_error(): @pytest.mark.asyncio async def test_list_volumes_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2801,7 +2791,7 @@ async def test_list_volumes_flattened_async(): @pytest.mark.asyncio async def test_list_volumes_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2815,7 +2805,7 @@ async def test_list_volumes_flattened_error_async(): def test_list_volumes_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2865,7 +2855,7 @@ def test_list_volumes_pager(transport_name: str = "grpc"): def test_list_volumes_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2907,7 +2897,7 @@ def test_list_volumes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_volumes_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2957,7 +2947,7 @@ async def test_list_volumes_async_pager(): @pytest.mark.asyncio async def test_list_volumes_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3012,7 +3002,7 @@ async def test_list_volumes_async_pages(): ) def test_get_volume(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3088,7 +3078,7 @@ def test_get_volume_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3105,7 +3095,7 @@ async def test_get_volume_async( transport: str = "grpc_asyncio", request_type=volume.GetVolumeRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3186,7 +3176,7 @@ async def test_get_volume_async_from_dict(): def test_get_volume_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3216,7 +3206,7 @@ def test_get_volume_field_headers(): @pytest.mark.asyncio async def test_get_volume_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3245,7 +3235,7 @@ async def test_get_volume_field_headers_async(): def test_get_volume_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3269,7 +3259,7 @@ def test_get_volume_flattened(): def test_get_volume_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3284,7 +3274,7 @@ def test_get_volume_flattened_error(): @pytest.mark.asyncio async def test_get_volume_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3311,7 +3301,7 @@ async def test_get_volume_flattened_async(): @pytest.mark.asyncio async def test_get_volume_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3332,7 +3322,7 @@ async def test_get_volume_flattened_error_async(): ) def test_create_volume(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3359,7 +3349,7 @@ def test_create_volume_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3376,7 +3366,7 @@ async def test_create_volume_async( transport: str = "grpc_asyncio", request_type=gcn_volume.CreateVolumeRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3408,7 +3398,7 @@ async def test_create_volume_async_from_dict(): def test_create_volume_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3438,7 +3428,7 @@ def test_create_volume_field_headers(): @pytest.mark.asyncio async def test_create_volume_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3469,7 +3459,7 @@ async def test_create_volume_field_headers_async(): def test_create_volume_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3501,7 +3491,7 @@ def test_create_volume_flattened(): def test_create_volume_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3518,7 +3508,7 @@ def test_create_volume_flattened_error(): @pytest.mark.asyncio async def test_create_volume_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3555,7 +3545,7 @@ async def test_create_volume_flattened_async(): @pytest.mark.asyncio async def test_create_volume_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3578,7 +3568,7 @@ async def test_create_volume_flattened_error_async(): ) def test_update_volume(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3605,7 +3595,7 @@ def test_update_volume_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3622,7 +3612,7 @@ async def test_update_volume_async( transport: str = "grpc_asyncio", request_type=gcn_volume.UpdateVolumeRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3654,7 +3644,7 @@ async def test_update_volume_async_from_dict(): def test_update_volume_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3684,7 +3674,7 @@ def test_update_volume_field_headers(): @pytest.mark.asyncio async def test_update_volume_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3715,7 +3705,7 @@ async def test_update_volume_field_headers_async(): def test_update_volume_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3743,7 +3733,7 @@ def test_update_volume_flattened(): def test_update_volume_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3759,7 +3749,7 @@ def test_update_volume_flattened_error(): @pytest.mark.asyncio async def test_update_volume_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3792,7 +3782,7 @@ async def test_update_volume_flattened_async(): @pytest.mark.asyncio async def test_update_volume_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3814,7 +3804,7 @@ async def test_update_volume_flattened_error_async(): ) def test_delete_volume(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3841,7 +3831,7 @@ def test_delete_volume_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3858,7 +3848,7 @@ async def test_delete_volume_async( transport: str = "grpc_asyncio", request_type=volume.DeleteVolumeRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3890,7 +3880,7 @@ async def test_delete_volume_async_from_dict(): def test_delete_volume_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3920,7 +3910,7 @@ def test_delete_volume_field_headers(): @pytest.mark.asyncio async def test_delete_volume_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3951,7 +3941,7 @@ async def test_delete_volume_field_headers_async(): def test_delete_volume_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3975,7 +3965,7 @@ def test_delete_volume_flattened(): def test_delete_volume_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3990,7 +3980,7 @@ def test_delete_volume_flattened_error(): @pytest.mark.asyncio async def test_delete_volume_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4019,7 +4009,7 @@ async def test_delete_volume_flattened_async(): @pytest.mark.asyncio async def test_delete_volume_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4040,7 +4030,7 @@ async def test_delete_volume_flattened_error_async(): ) def test_revert_volume(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4067,7 +4057,7 @@ def test_revert_volume_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4084,7 +4074,7 @@ async def test_revert_volume_async( transport: str = "grpc_asyncio", request_type=volume.RevertVolumeRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4116,7 +4106,7 @@ async def test_revert_volume_async_from_dict(): def test_revert_volume_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4146,7 +4136,7 @@ def test_revert_volume_field_headers(): @pytest.mark.asyncio async def test_revert_volume_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4184,7 +4174,7 @@ async def test_revert_volume_field_headers_async(): ) def test_list_snapshots(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4216,7 +4206,7 @@ def test_list_snapshots_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4233,7 +4223,7 @@ async def test_list_snapshots_async( transport: str = "grpc_asyncio", request_type=snapshot.ListSnapshotsRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4270,7 +4260,7 @@ async def test_list_snapshots_async_from_dict(): def test_list_snapshots_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4300,7 +4290,7 @@ def test_list_snapshots_field_headers(): @pytest.mark.asyncio async def test_list_snapshots_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4331,7 +4321,7 @@ async def test_list_snapshots_field_headers_async(): def test_list_snapshots_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4355,7 +4345,7 @@ def test_list_snapshots_flattened(): def test_list_snapshots_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4370,7 +4360,7 @@ def test_list_snapshots_flattened_error(): @pytest.mark.asyncio async def test_list_snapshots_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4399,7 +4389,7 @@ async def test_list_snapshots_flattened_async(): @pytest.mark.asyncio async def test_list_snapshots_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4413,7 +4403,7 @@ async def test_list_snapshots_flattened_error_async(): def test_list_snapshots_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -4463,7 +4453,7 @@ def test_list_snapshots_pager(transport_name: str = "grpc"): def test_list_snapshots_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -4505,7 +4495,7 @@ def test_list_snapshots_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_snapshots_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4555,7 +4545,7 @@ async def test_list_snapshots_async_pager(): @pytest.mark.asyncio async def test_list_snapshots_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4610,7 +4600,7 @@ async def test_list_snapshots_async_pages(): ) def test_get_snapshot(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4648,7 +4638,7 @@ def test_get_snapshot_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4665,7 +4655,7 @@ async def test_get_snapshot_async( transport: str = "grpc_asyncio", request_type=snapshot.GetSnapshotRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4708,7 +4698,7 @@ async def test_get_snapshot_async_from_dict(): def test_get_snapshot_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4738,7 +4728,7 @@ def test_get_snapshot_field_headers(): @pytest.mark.asyncio async def test_get_snapshot_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4767,7 +4757,7 @@ async def test_get_snapshot_field_headers_async(): def test_get_snapshot_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4791,7 +4781,7 @@ def test_get_snapshot_flattened(): def test_get_snapshot_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4806,7 +4796,7 @@ def test_get_snapshot_flattened_error(): @pytest.mark.asyncio async def test_get_snapshot_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4833,7 +4823,7 @@ async def test_get_snapshot_flattened_async(): @pytest.mark.asyncio async def test_get_snapshot_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4854,7 +4844,7 @@ async def test_get_snapshot_flattened_error_async(): ) def test_create_snapshot(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4881,7 +4871,7 @@ def test_create_snapshot_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4898,7 +4888,7 @@ async def test_create_snapshot_async( transport: str = "grpc_asyncio", request_type=gcn_snapshot.CreateSnapshotRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4930,7 +4920,7 @@ async def test_create_snapshot_async_from_dict(): def test_create_snapshot_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4960,7 +4950,7 @@ def test_create_snapshot_field_headers(): @pytest.mark.asyncio async def test_create_snapshot_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4991,7 +4981,7 @@ async def test_create_snapshot_field_headers_async(): def test_create_snapshot_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5023,7 +5013,7 @@ def test_create_snapshot_flattened(): def test_create_snapshot_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5040,7 +5030,7 @@ def test_create_snapshot_flattened_error(): @pytest.mark.asyncio async def test_create_snapshot_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5077,7 +5067,7 @@ async def test_create_snapshot_flattened_async(): @pytest.mark.asyncio async def test_create_snapshot_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5100,7 +5090,7 @@ async def test_create_snapshot_flattened_error_async(): ) def test_delete_snapshot(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5127,7 +5117,7 @@ def test_delete_snapshot_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5144,7 +5134,7 @@ async def test_delete_snapshot_async( transport: str = "grpc_asyncio", request_type=snapshot.DeleteSnapshotRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5176,7 +5166,7 @@ async def test_delete_snapshot_async_from_dict(): def test_delete_snapshot_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5206,7 +5196,7 @@ def test_delete_snapshot_field_headers(): @pytest.mark.asyncio async def test_delete_snapshot_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5237,7 +5227,7 @@ async def test_delete_snapshot_field_headers_async(): def test_delete_snapshot_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5261,7 +5251,7 @@ def test_delete_snapshot_flattened(): def test_delete_snapshot_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5276,7 +5266,7 @@ def test_delete_snapshot_flattened_error(): @pytest.mark.asyncio async def test_delete_snapshot_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5305,7 +5295,7 @@ async def test_delete_snapshot_flattened_async(): @pytest.mark.asyncio async def test_delete_snapshot_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5326,7 +5316,7 @@ async def test_delete_snapshot_flattened_error_async(): ) def test_update_snapshot(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5353,7 +5343,7 @@ def test_update_snapshot_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5370,7 +5360,7 @@ async def test_update_snapshot_async( transport: str = "grpc_asyncio", request_type=gcn_snapshot.UpdateSnapshotRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5402,7 +5392,7 @@ async def test_update_snapshot_async_from_dict(): def test_update_snapshot_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5432,7 +5422,7 @@ def test_update_snapshot_field_headers(): @pytest.mark.asyncio async def test_update_snapshot_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5463,7 +5453,7 @@ async def test_update_snapshot_field_headers_async(): def test_update_snapshot_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5491,7 +5481,7 @@ def test_update_snapshot_flattened(): def test_update_snapshot_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5507,7 +5497,7 @@ def test_update_snapshot_flattened_error(): @pytest.mark.asyncio async def test_update_snapshot_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5540,7 +5530,7 @@ async def test_update_snapshot_flattened_async(): @pytest.mark.asyncio async def test_update_snapshot_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5562,7 +5552,7 @@ async def test_update_snapshot_flattened_error_async(): ) def test_list_active_directories(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5596,7 +5586,7 @@ def test_list_active_directories_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5616,7 +5606,7 @@ async def test_list_active_directories_async( request_type=active_directory.ListActiveDirectoriesRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5655,7 +5645,7 @@ async def test_list_active_directories_async_from_dict(): def test_list_active_directories_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5687,7 +5677,7 @@ def test_list_active_directories_field_headers(): @pytest.mark.asyncio async def test_list_active_directories_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5720,7 +5710,7 @@ async def test_list_active_directories_field_headers_async(): def test_list_active_directories_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5746,7 +5736,7 @@ def test_list_active_directories_flattened(): def test_list_active_directories_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5761,7 +5751,7 @@ def test_list_active_directories_flattened_error(): @pytest.mark.asyncio async def test_list_active_directories_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5792,7 +5782,7 @@ async def test_list_active_directories_flattened_async(): @pytest.mark.asyncio async def test_list_active_directories_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5806,7 +5796,7 @@ async def test_list_active_directories_flattened_error_async(): def test_list_active_directories_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5858,7 +5848,7 @@ def test_list_active_directories_pager(transport_name: str = "grpc"): def test_list_active_directories_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5902,7 +5892,7 @@ def test_list_active_directories_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_active_directories_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5954,7 +5944,7 @@ async def test_list_active_directories_async_pager(): @pytest.mark.asyncio async def test_list_active_directories_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6011,7 +6001,7 @@ async def test_list_active_directories_async_pages(): ) def test_get_active_directory(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6079,7 +6069,7 @@ def test_get_active_directory_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6099,7 +6089,7 @@ async def test_get_active_directory_async( request_type=active_directory.GetActiveDirectoryRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6172,7 +6162,7 @@ async def test_get_active_directory_async_from_dict(): def test_get_active_directory_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6204,7 +6194,7 @@ def test_get_active_directory_field_headers(): @pytest.mark.asyncio async def test_get_active_directory_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6237,7 +6227,7 @@ async def test_get_active_directory_field_headers_async(): def test_get_active_directory_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6263,7 +6253,7 @@ def test_get_active_directory_flattened(): def test_get_active_directory_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6278,7 +6268,7 @@ def test_get_active_directory_flattened_error(): @pytest.mark.asyncio async def test_get_active_directory_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6309,7 +6299,7 @@ async def test_get_active_directory_flattened_async(): @pytest.mark.asyncio async def test_get_active_directory_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6330,7 +6320,7 @@ async def test_get_active_directory_flattened_error_async(): ) def test_create_active_directory(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6359,7 +6349,7 @@ def test_create_active_directory_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6379,7 +6369,7 @@ async def test_create_active_directory_async( request_type=gcn_active_directory.CreateActiveDirectoryRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6413,7 +6403,7 @@ async def test_create_active_directory_async_from_dict(): def test_create_active_directory_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6445,7 +6435,7 @@ def test_create_active_directory_field_headers(): @pytest.mark.asyncio async def test_create_active_directory_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6478,7 +6468,7 @@ async def test_create_active_directory_field_headers_async(): def test_create_active_directory_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6512,7 +6502,7 @@ def test_create_active_directory_flattened(): def test_create_active_directory_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6529,7 +6519,7 @@ def test_create_active_directory_flattened_error(): @pytest.mark.asyncio async def test_create_active_directory_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6568,7 +6558,7 @@ async def test_create_active_directory_flattened_async(): @pytest.mark.asyncio async def test_create_active_directory_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6591,7 +6581,7 @@ async def test_create_active_directory_flattened_error_async(): ) def test_update_active_directory(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6620,7 +6610,7 @@ def test_update_active_directory_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6640,7 +6630,7 @@ async def test_update_active_directory_async( request_type=gcn_active_directory.UpdateActiveDirectoryRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6674,7 +6664,7 @@ async def test_update_active_directory_async_from_dict(): def test_update_active_directory_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6706,7 +6696,7 @@ def test_update_active_directory_field_headers(): @pytest.mark.asyncio async def test_update_active_directory_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6739,7 +6729,7 @@ async def test_update_active_directory_field_headers_async(): def test_update_active_directory_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6769,7 +6759,7 @@ def test_update_active_directory_flattened(): def test_update_active_directory_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6785,7 +6775,7 @@ def test_update_active_directory_flattened_error(): @pytest.mark.asyncio async def test_update_active_directory_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6820,7 +6810,7 @@ async def test_update_active_directory_flattened_async(): @pytest.mark.asyncio async def test_update_active_directory_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6842,7 +6832,7 @@ async def test_update_active_directory_flattened_error_async(): ) def test_delete_active_directory(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6871,7 +6861,7 @@ def test_delete_active_directory_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6891,7 +6881,7 @@ async def test_delete_active_directory_async( request_type=active_directory.DeleteActiveDirectoryRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6925,7 +6915,7 @@ async def test_delete_active_directory_async_from_dict(): def test_delete_active_directory_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6957,7 +6947,7 @@ def test_delete_active_directory_field_headers(): @pytest.mark.asyncio async def test_delete_active_directory_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6990,7 +6980,7 @@ async def test_delete_active_directory_field_headers_async(): def test_delete_active_directory_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7016,7 +7006,7 @@ def test_delete_active_directory_flattened(): def test_delete_active_directory_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7031,7 +7021,7 @@ def test_delete_active_directory_flattened_error(): @pytest.mark.asyncio async def test_delete_active_directory_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7062,7 +7052,7 @@ async def test_delete_active_directory_flattened_async(): @pytest.mark.asyncio async def test_delete_active_directory_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7083,7 +7073,7 @@ async def test_delete_active_directory_flattened_error_async(): ) def test_list_kms_configs(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7115,7 +7105,7 @@ def test_list_kms_configs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7132,7 +7122,7 @@ async def test_list_kms_configs_async( transport: str = "grpc_asyncio", request_type=kms.ListKmsConfigsRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7169,7 +7159,7 @@ async def test_list_kms_configs_async_from_dict(): def test_list_kms_configs_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7199,7 +7189,7 @@ def test_list_kms_configs_field_headers(): @pytest.mark.asyncio async def test_list_kms_configs_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7230,7 +7220,7 @@ async def test_list_kms_configs_field_headers_async(): def test_list_kms_configs_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7254,7 +7244,7 @@ def test_list_kms_configs_flattened(): def test_list_kms_configs_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7269,7 +7259,7 @@ def test_list_kms_configs_flattened_error(): @pytest.mark.asyncio async def test_list_kms_configs_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7298,7 +7288,7 @@ async def test_list_kms_configs_flattened_async(): @pytest.mark.asyncio async def test_list_kms_configs_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7312,7 +7302,7 @@ async def test_list_kms_configs_flattened_error_async(): def test_list_kms_configs_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -7362,7 +7352,7 @@ def test_list_kms_configs_pager(transport_name: str = "grpc"): def test_list_kms_configs_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -7404,7 +7394,7 @@ def test_list_kms_configs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_kms_configs_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7454,7 +7444,7 @@ async def test_list_kms_configs_async_pager(): @pytest.mark.asyncio async def test_list_kms_configs_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7509,7 +7499,7 @@ async def test_list_kms_configs_async_pages(): ) def test_create_kms_config(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7538,7 +7528,7 @@ def test_create_kms_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7557,7 +7547,7 @@ async def test_create_kms_config_async( transport: str = "grpc_asyncio", request_type=kms.CreateKmsConfigRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7591,7 +7581,7 @@ async def test_create_kms_config_async_from_dict(): def test_create_kms_config_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7623,7 +7613,7 @@ def test_create_kms_config_field_headers(): @pytest.mark.asyncio async def test_create_kms_config_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7656,7 +7646,7 @@ async def test_create_kms_config_field_headers_async(): def test_create_kms_config_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7690,7 +7680,7 @@ def test_create_kms_config_flattened(): def test_create_kms_config_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7707,7 +7697,7 @@ def test_create_kms_config_flattened_error(): @pytest.mark.asyncio async def test_create_kms_config_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7746,7 +7736,7 @@ async def test_create_kms_config_flattened_async(): @pytest.mark.asyncio async def test_create_kms_config_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7769,7 +7759,7 @@ async def test_create_kms_config_flattened_error_async(): ) def test_get_kms_config(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7811,7 +7801,7 @@ def test_get_kms_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7828,7 +7818,7 @@ async def test_get_kms_config_async( transport: str = "grpc_asyncio", request_type=kms.GetKmsConfigRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7875,7 +7865,7 @@ async def test_get_kms_config_async_from_dict(): def test_get_kms_config_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7905,7 +7895,7 @@ def test_get_kms_config_field_headers(): @pytest.mark.asyncio async def test_get_kms_config_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7934,7 +7924,7 @@ async def test_get_kms_config_field_headers_async(): def test_get_kms_config_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7958,7 +7948,7 @@ def test_get_kms_config_flattened(): def test_get_kms_config_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -7973,7 +7963,7 @@ def test_get_kms_config_flattened_error(): @pytest.mark.asyncio async def test_get_kms_config_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8000,7 +7990,7 @@ async def test_get_kms_config_flattened_async(): @pytest.mark.asyncio async def test_get_kms_config_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8021,7 +8011,7 @@ async def test_get_kms_config_flattened_error_async(): ) def test_update_kms_config(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8050,7 +8040,7 @@ def test_update_kms_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8069,7 +8059,7 @@ async def test_update_kms_config_async( transport: str = "grpc_asyncio", request_type=kms.UpdateKmsConfigRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8103,7 +8093,7 @@ async def test_update_kms_config_async_from_dict(): def test_update_kms_config_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8135,7 +8125,7 @@ def test_update_kms_config_field_headers(): @pytest.mark.asyncio async def test_update_kms_config_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8168,7 +8158,7 @@ async def test_update_kms_config_field_headers_async(): def test_update_kms_config_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8198,7 +8188,7 @@ def test_update_kms_config_flattened(): def test_update_kms_config_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8214,7 +8204,7 @@ def test_update_kms_config_flattened_error(): @pytest.mark.asyncio async def test_update_kms_config_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8249,7 +8239,7 @@ async def test_update_kms_config_flattened_async(): @pytest.mark.asyncio async def test_update_kms_config_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8271,7 +8261,7 @@ async def test_update_kms_config_flattened_error_async(): ) def test_encrypt_volumes(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8298,7 +8288,7 @@ def test_encrypt_volumes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8315,7 +8305,7 @@ async def test_encrypt_volumes_async( transport: str = "grpc_asyncio", request_type=kms.EncryptVolumesRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8347,7 +8337,7 @@ async def test_encrypt_volumes_async_from_dict(): def test_encrypt_volumes_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8377,7 +8367,7 @@ def test_encrypt_volumes_field_headers(): @pytest.mark.asyncio async def test_encrypt_volumes_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8415,7 +8405,7 @@ async def test_encrypt_volumes_field_headers_async(): ) def test_verify_kms_config(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8451,7 +8441,7 @@ def test_verify_kms_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8470,7 +8460,7 @@ async def test_verify_kms_config_async( transport: str = "grpc_asyncio", request_type=kms.VerifyKmsConfigRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8511,7 +8501,7 @@ async def test_verify_kms_config_async_from_dict(): def test_verify_kms_config_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8543,7 +8533,7 @@ def test_verify_kms_config_field_headers(): @pytest.mark.asyncio async def test_verify_kms_config_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8583,7 +8573,7 @@ async def test_verify_kms_config_field_headers_async(): ) def test_delete_kms_config(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8612,7 +8602,7 @@ def test_delete_kms_config_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8631,7 +8621,7 @@ async def test_delete_kms_config_async( transport: str = "grpc_asyncio", request_type=kms.DeleteKmsConfigRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8665,7 +8655,7 @@ async def test_delete_kms_config_async_from_dict(): def test_delete_kms_config_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8697,7 +8687,7 @@ def test_delete_kms_config_field_headers(): @pytest.mark.asyncio async def test_delete_kms_config_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8730,7 +8720,7 @@ async def test_delete_kms_config_field_headers_async(): def test_delete_kms_config_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8756,7 +8746,7 @@ def test_delete_kms_config_flattened(): def test_delete_kms_config_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8771,7 +8761,7 @@ def test_delete_kms_config_flattened_error(): @pytest.mark.asyncio async def test_delete_kms_config_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -8802,7 +8792,7 @@ async def test_delete_kms_config_flattened_async(): @pytest.mark.asyncio async def test_delete_kms_config_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -8823,7 +8813,7 @@ async def test_delete_kms_config_flattened_error_async(): ) def test_list_replications(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8857,7 +8847,7 @@ def test_list_replications_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8876,7 +8866,7 @@ async def test_list_replications_async( transport: str = "grpc_asyncio", request_type=replication.ListReplicationsRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8915,7 +8905,7 @@ async def test_list_replications_async_from_dict(): def test_list_replications_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8947,7 +8937,7 @@ def test_list_replications_field_headers(): @pytest.mark.asyncio async def test_list_replications_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8980,7 +8970,7 @@ async def test_list_replications_field_headers_async(): def test_list_replications_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9006,7 +8996,7 @@ def test_list_replications_flattened(): def test_list_replications_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9021,7 +9011,7 @@ def test_list_replications_flattened_error(): @pytest.mark.asyncio async def test_list_replications_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9052,7 +9042,7 @@ async def test_list_replications_flattened_async(): @pytest.mark.asyncio async def test_list_replications_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9066,7 +9056,7 @@ async def test_list_replications_flattened_error_async(): def test_list_replications_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -9118,7 +9108,7 @@ def test_list_replications_pager(transport_name: str = "grpc"): def test_list_replications_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -9162,7 +9152,7 @@ def test_list_replications_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_replications_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9214,7 +9204,7 @@ async def test_list_replications_async_pager(): @pytest.mark.asyncio async def test_list_replications_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9271,7 +9261,7 @@ async def test_list_replications_async_pages(): ) def test_get_replication(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9322,7 +9312,7 @@ def test_get_replication_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9339,7 +9329,7 @@ async def test_get_replication_async( transport: str = "grpc_asyncio", request_type=replication.GetReplicationRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9395,7 +9385,7 @@ async def test_get_replication_async_from_dict(): def test_get_replication_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9425,7 +9415,7 @@ def test_get_replication_field_headers(): @pytest.mark.asyncio async def test_get_replication_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9456,7 +9446,7 @@ async def test_get_replication_field_headers_async(): def test_get_replication_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9480,7 +9470,7 @@ def test_get_replication_flattened(): def test_get_replication_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9495,7 +9485,7 @@ def test_get_replication_flattened_error(): @pytest.mark.asyncio async def test_get_replication_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9524,7 +9514,7 @@ async def test_get_replication_flattened_async(): @pytest.mark.asyncio async def test_get_replication_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9545,7 +9535,7 @@ async def test_get_replication_flattened_error_async(): ) def test_create_replication(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9574,7 +9564,7 @@ def test_create_replication_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9594,7 +9584,7 @@ async def test_create_replication_async( request_type=gcn_replication.CreateReplicationRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9628,7 +9618,7 @@ async def test_create_replication_async_from_dict(): def test_create_replication_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9660,7 +9650,7 @@ def test_create_replication_field_headers(): @pytest.mark.asyncio async def test_create_replication_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9693,7 +9683,7 @@ async def test_create_replication_field_headers_async(): def test_create_replication_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9727,7 +9717,7 @@ def test_create_replication_flattened(): def test_create_replication_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9744,7 +9734,7 @@ def test_create_replication_flattened_error(): @pytest.mark.asyncio async def test_create_replication_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9783,7 +9773,7 @@ async def test_create_replication_flattened_async(): @pytest.mark.asyncio async def test_create_replication_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9806,7 +9796,7 @@ async def test_create_replication_flattened_error_async(): ) def test_delete_replication(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9835,7 +9825,7 @@ def test_delete_replication_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9854,7 +9844,7 @@ async def test_delete_replication_async( transport: str = "grpc_asyncio", request_type=replication.DeleteReplicationRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9888,7 +9878,7 @@ async def test_delete_replication_async_from_dict(): def test_delete_replication_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9920,7 +9910,7 @@ def test_delete_replication_field_headers(): @pytest.mark.asyncio async def test_delete_replication_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9953,7 +9943,7 @@ async def test_delete_replication_field_headers_async(): def test_delete_replication_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -9979,7 +9969,7 @@ def test_delete_replication_flattened(): def test_delete_replication_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -9994,7 +9984,7 @@ def test_delete_replication_flattened_error(): @pytest.mark.asyncio async def test_delete_replication_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10025,7 +10015,7 @@ async def test_delete_replication_flattened_async(): @pytest.mark.asyncio async def test_delete_replication_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10046,7 +10036,7 @@ async def test_delete_replication_flattened_error_async(): ) def test_update_replication(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10075,7 +10065,7 @@ def test_update_replication_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10095,7 +10085,7 @@ async def test_update_replication_async( request_type=gcn_replication.UpdateReplicationRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10129,7 +10119,7 @@ async def test_update_replication_async_from_dict(): def test_update_replication_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10161,7 +10151,7 @@ def test_update_replication_field_headers(): @pytest.mark.asyncio async def test_update_replication_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10194,7 +10184,7 @@ async def test_update_replication_field_headers_async(): def test_update_replication_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10224,7 +10214,7 @@ def test_update_replication_flattened(): def test_update_replication_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10240,7 +10230,7 @@ def test_update_replication_flattened_error(): @pytest.mark.asyncio async def test_update_replication_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10275,7 +10265,7 @@ async def test_update_replication_flattened_async(): @pytest.mark.asyncio async def test_update_replication_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10297,7 +10287,7 @@ async def test_update_replication_flattened_error_async(): ) def test_stop_replication(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10324,7 +10314,7 @@ def test_stop_replication_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10341,7 +10331,7 @@ async def test_stop_replication_async( transport: str = "grpc_asyncio", request_type=replication.StopReplicationRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10373,7 +10363,7 @@ async def test_stop_replication_async_from_dict(): def test_stop_replication_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10403,7 +10393,7 @@ def test_stop_replication_field_headers(): @pytest.mark.asyncio async def test_stop_replication_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10441,7 +10431,7 @@ async def test_stop_replication_field_headers_async(): ) def test_resume_replication(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10470,7 +10460,7 @@ def test_resume_replication_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10489,7 +10479,7 @@ async def test_resume_replication_async( transport: str = "grpc_asyncio", request_type=replication.ResumeReplicationRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10523,7 +10513,7 @@ async def test_resume_replication_async_from_dict(): def test_resume_replication_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10555,7 +10545,7 @@ def test_resume_replication_field_headers(): @pytest.mark.asyncio async def test_resume_replication_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10595,7 +10585,7 @@ async def test_resume_replication_field_headers_async(): ) def test_reverse_replication_direction(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10624,7 +10614,7 @@ def test_reverse_replication_direction_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10644,7 +10634,7 @@ async def test_reverse_replication_direction_async( request_type=replication.ReverseReplicationDirectionRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10678,7 +10668,7 @@ async def test_reverse_replication_direction_async_from_dict(): def test_reverse_replication_direction_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10710,7 +10700,7 @@ def test_reverse_replication_direction_field_headers(): @pytest.mark.asyncio async def test_reverse_replication_direction_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10750,7 +10740,7 @@ async def test_reverse_replication_direction_field_headers_async(): ) def test_create_backup_vault(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10779,7 +10769,7 @@ def test_create_backup_vault_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10799,7 +10789,7 @@ async def test_create_backup_vault_async( request_type=gcn_backup_vault.CreateBackupVaultRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10833,7 +10823,7 @@ async def test_create_backup_vault_async_from_dict(): def test_create_backup_vault_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10865,7 +10855,7 @@ def test_create_backup_vault_field_headers(): @pytest.mark.asyncio async def test_create_backup_vault_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -10898,7 +10888,7 @@ async def test_create_backup_vault_field_headers_async(): def test_create_backup_vault_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10932,7 +10922,7 @@ def test_create_backup_vault_flattened(): def test_create_backup_vault_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -10949,7 +10939,7 @@ def test_create_backup_vault_flattened_error(): @pytest.mark.asyncio async def test_create_backup_vault_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -10988,7 +10978,7 @@ async def test_create_backup_vault_flattened_async(): @pytest.mark.asyncio async def test_create_backup_vault_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11011,7 +11001,7 @@ async def test_create_backup_vault_flattened_error_async(): ) def test_get_backup_vault(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11045,7 +11035,7 @@ def test_get_backup_vault_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11062,7 +11052,7 @@ async def test_get_backup_vault_async( transport: str = "grpc_asyncio", request_type=backup_vault.GetBackupVaultRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11101,7 +11091,7 @@ async def test_get_backup_vault_async_from_dict(): def test_get_backup_vault_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11131,7 +11121,7 @@ def test_get_backup_vault_field_headers(): @pytest.mark.asyncio async def test_get_backup_vault_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11162,7 +11152,7 @@ async def test_get_backup_vault_field_headers_async(): def test_get_backup_vault_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11186,7 +11176,7 @@ def test_get_backup_vault_flattened(): def test_get_backup_vault_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11201,7 +11191,7 @@ def test_get_backup_vault_flattened_error(): @pytest.mark.asyncio async def test_get_backup_vault_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11230,7 +11220,7 @@ async def test_get_backup_vault_flattened_async(): @pytest.mark.asyncio async def test_get_backup_vault_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11251,7 +11241,7 @@ async def test_get_backup_vault_flattened_error_async(): ) def test_list_backup_vaults(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11285,7 +11275,7 @@ def test_list_backup_vaults_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11304,7 +11294,7 @@ async def test_list_backup_vaults_async( transport: str = "grpc_asyncio", request_type=backup_vault.ListBackupVaultsRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11343,7 +11333,7 @@ async def test_list_backup_vaults_async_from_dict(): def test_list_backup_vaults_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11375,7 +11365,7 @@ def test_list_backup_vaults_field_headers(): @pytest.mark.asyncio async def test_list_backup_vaults_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11408,7 +11398,7 @@ async def test_list_backup_vaults_field_headers_async(): def test_list_backup_vaults_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11434,7 +11424,7 @@ def test_list_backup_vaults_flattened(): def test_list_backup_vaults_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11449,7 +11439,7 @@ def test_list_backup_vaults_flattened_error(): @pytest.mark.asyncio async def test_list_backup_vaults_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11480,7 +11470,7 @@ async def test_list_backup_vaults_flattened_async(): @pytest.mark.asyncio async def test_list_backup_vaults_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11494,7 +11484,7 @@ async def test_list_backup_vaults_flattened_error_async(): def test_list_backup_vaults_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -11546,7 +11536,7 @@ def test_list_backup_vaults_pager(transport_name: str = "grpc"): def test_list_backup_vaults_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -11590,7 +11580,7 @@ def test_list_backup_vaults_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_backup_vaults_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11642,7 +11632,7 @@ async def test_list_backup_vaults_async_pager(): @pytest.mark.asyncio async def test_list_backup_vaults_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11699,7 +11689,7 @@ async def test_list_backup_vaults_async_pages(): ) def test_update_backup_vault(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11728,7 +11718,7 @@ def test_update_backup_vault_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11748,7 +11738,7 @@ async def test_update_backup_vault_async( request_type=gcn_backup_vault.UpdateBackupVaultRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11782,7 +11772,7 @@ async def test_update_backup_vault_async_from_dict(): def test_update_backup_vault_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11814,7 +11804,7 @@ def test_update_backup_vault_field_headers(): @pytest.mark.asyncio async def test_update_backup_vault_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -11847,7 +11837,7 @@ async def test_update_backup_vault_field_headers_async(): def test_update_backup_vault_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11877,7 +11867,7 @@ def test_update_backup_vault_flattened(): def test_update_backup_vault_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11893,7 +11883,7 @@ def test_update_backup_vault_flattened_error(): @pytest.mark.asyncio async def test_update_backup_vault_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11928,7 +11918,7 @@ async def test_update_backup_vault_flattened_async(): @pytest.mark.asyncio async def test_update_backup_vault_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -11950,7 +11940,7 @@ async def test_update_backup_vault_flattened_error_async(): ) def test_delete_backup_vault(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11979,7 +11969,7 @@ def test_delete_backup_vault_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11998,7 +11988,7 @@ async def test_delete_backup_vault_async( transport: str = "grpc_asyncio", request_type=backup_vault.DeleteBackupVaultRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12032,7 +12022,7 @@ async def test_delete_backup_vault_async_from_dict(): def test_delete_backup_vault_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12064,7 +12054,7 @@ def test_delete_backup_vault_field_headers(): @pytest.mark.asyncio async def test_delete_backup_vault_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12097,7 +12087,7 @@ async def test_delete_backup_vault_field_headers_async(): def test_delete_backup_vault_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12123,7 +12113,7 @@ def test_delete_backup_vault_flattened(): def test_delete_backup_vault_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12138,7 +12128,7 @@ def test_delete_backup_vault_flattened_error(): @pytest.mark.asyncio async def test_delete_backup_vault_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12169,7 +12159,7 @@ async def test_delete_backup_vault_flattened_async(): @pytest.mark.asyncio async def test_delete_backup_vault_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12190,7 +12180,7 @@ async def test_delete_backup_vault_flattened_error_async(): ) def test_create_backup(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12217,7 +12207,7 @@ def test_create_backup_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -12234,7 +12224,7 @@ async def test_create_backup_async( transport: str = "grpc_asyncio", request_type=gcn_backup.CreateBackupRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12266,7 +12256,7 @@ async def test_create_backup_async_from_dict(): def test_create_backup_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12296,7 +12286,7 @@ def test_create_backup_field_headers(): @pytest.mark.asyncio async def test_create_backup_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12327,7 +12317,7 @@ async def test_create_backup_field_headers_async(): def test_create_backup_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12359,7 +12349,7 @@ def test_create_backup_flattened(): def test_create_backup_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12376,7 +12366,7 @@ def test_create_backup_flattened_error(): @pytest.mark.asyncio async def test_create_backup_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12413,7 +12403,7 @@ async def test_create_backup_flattened_async(): @pytest.mark.asyncio async def test_create_backup_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12436,7 +12426,7 @@ async def test_create_backup_flattened_error_async(): ) def test_get_backup(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12480,7 +12470,7 @@ def test_get_backup_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -12497,7 +12487,7 @@ async def test_get_backup_async( transport: str = "grpc_asyncio", request_type=backup.GetBackupRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12546,7 +12536,7 @@ async def test_get_backup_async_from_dict(): def test_get_backup_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12576,7 +12566,7 @@ def test_get_backup_field_headers(): @pytest.mark.asyncio async def test_get_backup_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12605,7 +12595,7 @@ async def test_get_backup_field_headers_async(): def test_get_backup_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12629,7 +12619,7 @@ def test_get_backup_flattened(): def test_get_backup_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12644,7 +12634,7 @@ def test_get_backup_flattened_error(): @pytest.mark.asyncio async def test_get_backup_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12671,7 +12661,7 @@ async def test_get_backup_flattened_async(): @pytest.mark.asyncio async def test_get_backup_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12692,7 +12682,7 @@ async def test_get_backup_flattened_error_async(): ) def test_list_backups(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12724,7 +12714,7 @@ def test_list_backups_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -12741,7 +12731,7 @@ async def test_list_backups_async( transport: str = "grpc_asyncio", request_type=backup.ListBackupsRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12778,7 +12768,7 @@ async def test_list_backups_async_from_dict(): def test_list_backups_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12808,7 +12798,7 @@ def test_list_backups_field_headers(): @pytest.mark.asyncio async def test_list_backups_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -12839,7 +12829,7 @@ async def test_list_backups_field_headers_async(): def test_list_backups_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12863,7 +12853,7 @@ def test_list_backups_flattened(): def test_list_backups_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12878,7 +12868,7 @@ def test_list_backups_flattened_error(): @pytest.mark.asyncio async def test_list_backups_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -12907,7 +12897,7 @@ async def test_list_backups_flattened_async(): @pytest.mark.asyncio async def test_list_backups_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -12921,7 +12911,7 @@ async def test_list_backups_flattened_error_async(): def test_list_backups_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -12971,7 +12961,7 @@ def test_list_backups_pager(transport_name: str = "grpc"): def test_list_backups_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -13013,7 +13003,7 @@ def test_list_backups_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_backups_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13063,7 +13053,7 @@ async def test_list_backups_async_pager(): @pytest.mark.asyncio async def test_list_backups_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13118,7 +13108,7 @@ async def test_list_backups_async_pages(): ) def test_delete_backup(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13145,7 +13135,7 @@ def test_delete_backup_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13162,7 +13152,7 @@ async def test_delete_backup_async( transport: str = "grpc_asyncio", request_type=backup.DeleteBackupRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13194,7 +13184,7 @@ async def test_delete_backup_async_from_dict(): def test_delete_backup_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13224,7 +13214,7 @@ def test_delete_backup_field_headers(): @pytest.mark.asyncio async def test_delete_backup_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13255,7 +13245,7 @@ async def test_delete_backup_field_headers_async(): def test_delete_backup_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13279,7 +13269,7 @@ def test_delete_backup_flattened(): def test_delete_backup_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13294,7 +13284,7 @@ def test_delete_backup_flattened_error(): @pytest.mark.asyncio async def test_delete_backup_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13323,7 +13313,7 @@ async def test_delete_backup_flattened_async(): @pytest.mark.asyncio async def test_delete_backup_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13344,7 +13334,7 @@ async def test_delete_backup_flattened_error_async(): ) def test_update_backup(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13371,7 +13361,7 @@ def test_update_backup_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13388,7 +13378,7 @@ async def test_update_backup_async( transport: str = "grpc_asyncio", request_type=gcn_backup.UpdateBackupRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13420,7 +13410,7 @@ async def test_update_backup_async_from_dict(): def test_update_backup_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13450,7 +13440,7 @@ def test_update_backup_field_headers(): @pytest.mark.asyncio async def test_update_backup_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13481,7 +13471,7 @@ async def test_update_backup_field_headers_async(): def test_update_backup_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13509,7 +13499,7 @@ def test_update_backup_flattened(): def test_update_backup_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13525,7 +13515,7 @@ def test_update_backup_flattened_error(): @pytest.mark.asyncio async def test_update_backup_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13558,7 +13548,7 @@ async def test_update_backup_flattened_async(): @pytest.mark.asyncio async def test_update_backup_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13580,7 +13570,7 @@ async def test_update_backup_flattened_error_async(): ) def test_create_backup_policy(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13609,7 +13599,7 @@ def test_create_backup_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13629,7 +13619,7 @@ async def test_create_backup_policy_async( request_type=gcn_backup_policy.CreateBackupPolicyRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13663,7 +13653,7 @@ async def test_create_backup_policy_async_from_dict(): def test_create_backup_policy_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13695,7 +13685,7 @@ def test_create_backup_policy_field_headers(): @pytest.mark.asyncio async def test_create_backup_policy_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13728,7 +13718,7 @@ async def test_create_backup_policy_field_headers_async(): def test_create_backup_policy_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13762,7 +13752,7 @@ def test_create_backup_policy_flattened(): def test_create_backup_policy_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13779,7 +13769,7 @@ def test_create_backup_policy_flattened_error(): @pytest.mark.asyncio async def test_create_backup_policy_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -13818,7 +13808,7 @@ async def test_create_backup_policy_flattened_async(): @pytest.mark.asyncio async def test_create_backup_policy_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -13841,7 +13831,7 @@ async def test_create_backup_policy_flattened_error_async(): ) def test_get_backup_policy(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13887,7 +13877,7 @@ def test_get_backup_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -13906,7 +13896,7 @@ async def test_get_backup_policy_async( transport: str = "grpc_asyncio", request_type=backup_policy.GetBackupPolicyRequest ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13957,7 +13947,7 @@ async def test_get_backup_policy_async_from_dict(): def test_get_backup_policy_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -13989,7 +13979,7 @@ def test_get_backup_policy_field_headers(): @pytest.mark.asyncio async def test_get_backup_policy_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14022,7 +14012,7 @@ async def test_get_backup_policy_field_headers_async(): def test_get_backup_policy_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14048,7 +14038,7 @@ def test_get_backup_policy_flattened(): def test_get_backup_policy_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14063,7 +14053,7 @@ def test_get_backup_policy_flattened_error(): @pytest.mark.asyncio async def test_get_backup_policy_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14094,7 +14084,7 @@ async def test_get_backup_policy_flattened_async(): @pytest.mark.asyncio async def test_get_backup_policy_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14115,7 +14105,7 @@ async def test_get_backup_policy_flattened_error_async(): ) def test_list_backup_policies(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14149,7 +14139,7 @@ def test_list_backup_policies_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -14169,7 +14159,7 @@ async def test_list_backup_policies_async( request_type=backup_policy.ListBackupPoliciesRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14208,7 +14198,7 @@ async def test_list_backup_policies_async_from_dict(): def test_list_backup_policies_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14240,7 +14230,7 @@ def test_list_backup_policies_field_headers(): @pytest.mark.asyncio async def test_list_backup_policies_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14273,7 +14263,7 @@ async def test_list_backup_policies_field_headers_async(): def test_list_backup_policies_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14299,7 +14289,7 @@ def test_list_backup_policies_flattened(): def test_list_backup_policies_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14314,7 +14304,7 @@ def test_list_backup_policies_flattened_error(): @pytest.mark.asyncio async def test_list_backup_policies_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14345,7 +14335,7 @@ async def test_list_backup_policies_flattened_async(): @pytest.mark.asyncio async def test_list_backup_policies_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14359,7 +14349,7 @@ async def test_list_backup_policies_flattened_error_async(): def test_list_backup_policies_pager(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -14411,7 +14401,7 @@ def test_list_backup_policies_pager(transport_name: str = "grpc"): def test_list_backup_policies_pages(transport_name: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -14455,7 +14445,7 @@ def test_list_backup_policies_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_backup_policies_async_pager(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14507,7 +14497,7 @@ async def test_list_backup_policies_async_pager(): @pytest.mark.asyncio async def test_list_backup_policies_async_pages(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14564,7 +14554,7 @@ async def test_list_backup_policies_async_pages(): ) def test_update_backup_policy(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14593,7 +14583,7 @@ def test_update_backup_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -14613,7 +14603,7 @@ async def test_update_backup_policy_async( request_type=gcn_backup_policy.UpdateBackupPolicyRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14647,7 +14637,7 @@ async def test_update_backup_policy_async_from_dict(): def test_update_backup_policy_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14679,7 +14669,7 @@ def test_update_backup_policy_field_headers(): @pytest.mark.asyncio async def test_update_backup_policy_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14712,7 +14702,7 @@ async def test_update_backup_policy_field_headers_async(): def test_update_backup_policy_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14742,7 +14732,7 @@ def test_update_backup_policy_flattened(): def test_update_backup_policy_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14758,7 +14748,7 @@ def test_update_backup_policy_flattened_error(): @pytest.mark.asyncio async def test_update_backup_policy_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14793,7 +14783,7 @@ async def test_update_backup_policy_flattened_async(): @pytest.mark.asyncio async def test_update_backup_policy_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -14815,7 +14805,7 @@ async def test_update_backup_policy_flattened_error_async(): ) def test_delete_backup_policy(request_type, transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14844,7 +14834,7 @@ def test_delete_backup_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -14864,7 +14854,7 @@ async def test_delete_backup_policy_async( request_type=backup_policy.DeleteBackupPolicyRequest, ): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14898,7 +14888,7 @@ async def test_delete_backup_policy_async_from_dict(): def test_delete_backup_policy_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14930,7 +14920,7 @@ def test_delete_backup_policy_field_headers(): @pytest.mark.asyncio async def test_delete_backup_policy_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -14963,7 +14953,7 @@ async def test_delete_backup_policy_field_headers_async(): def test_delete_backup_policy_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -14989,7 +14979,7 @@ def test_delete_backup_policy_flattened(): def test_delete_backup_policy_flattened_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -15004,7 +14994,7 @@ def test_delete_backup_policy_flattened_error(): @pytest.mark.asyncio async def test_delete_backup_policy_flattened_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -15035,7 +15025,7 @@ async def test_delete_backup_policy_flattened_async(): @pytest.mark.asyncio async def test_delete_backup_policy_flattened_error_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -15056,7 +15046,7 @@ async def test_delete_backup_policy_flattened_error_async(): ) def test_list_storage_pools_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15109,7 +15099,7 @@ def test_list_storage_pools_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_storage_pools._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15118,7 +15108,7 @@ def test_list_storage_pools_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_storage_pools._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -15136,7 +15126,7 @@ def test_list_storage_pools_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15178,7 +15168,7 @@ def test_list_storage_pools_rest_required_fields( def test_list_storage_pools_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_storage_pools._get_unset_required_fields({}) @@ -15198,7 +15188,7 @@ def test_list_storage_pools_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_storage_pools_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -15254,7 +15244,7 @@ def test_list_storage_pools_rest_bad_request( transport: str = "rest", request_type=storage_pool.ListStoragePoolsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15276,7 +15266,7 @@ def test_list_storage_pools_rest_bad_request( def test_list_storage_pools_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15318,7 +15308,7 @@ def test_list_storage_pools_rest_flattened(): def test_list_storage_pools_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15333,7 +15323,7 @@ def test_list_storage_pools_rest_flattened_error(transport: str = "rest"): def test_list_storage_pools_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15403,7 +15393,7 @@ def test_list_storage_pools_rest_pager(transport: str = "rest"): ) def test_create_storage_pool_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15537,7 +15527,7 @@ def test_create_storage_pool_rest_required_fields( assert "storagePoolId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_storage_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15549,7 +15539,7 @@ def test_create_storage_pool_rest_required_fields( jsonified_request["storagePoolId"] = "storage_pool_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_storage_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("storage_pool_id",)) @@ -15562,7 +15552,7 @@ def test_create_storage_pool_rest_required_fields( assert jsonified_request["storagePoolId"] == "storage_pool_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15608,7 +15598,7 @@ def test_create_storage_pool_rest_required_fields( def test_create_storage_pool_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_storage_pool._get_unset_required_fields({}) @@ -15627,7 +15617,7 @@ def test_create_storage_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_storage_pool_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -15685,7 +15675,7 @@ def test_create_storage_pool_rest_bad_request( transport: str = "rest", request_type=gcn_storage_pool.CreateStoragePoolRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15707,7 +15697,7 @@ def test_create_storage_pool_rest_bad_request( def test_create_storage_pool_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15749,7 +15739,7 @@ def test_create_storage_pool_rest_flattened(): def test_create_storage_pool_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15766,7 +15756,7 @@ def test_create_storage_pool_rest_flattened_error(transport: str = "rest"): def test_create_storage_pool_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -15779,7 +15769,7 @@ def test_create_storage_pool_rest_error(): ) def test_get_storage_pool_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15858,7 +15848,7 @@ def test_get_storage_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_storage_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15867,7 +15857,7 @@ def test_get_storage_pool_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_storage_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -15876,7 +15866,7 @@ def test_get_storage_pool_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -15918,7 +15908,7 @@ def test_get_storage_pool_rest_required_fields( def test_get_storage_pool_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_storage_pool._get_unset_required_fields({}) @@ -15928,7 +15918,7 @@ def test_get_storage_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_storage_pool_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -15984,7 +15974,7 @@ def test_get_storage_pool_rest_bad_request( transport: str = "rest", request_type=storage_pool.GetStoragePoolRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16006,7 +15996,7 @@ def test_get_storage_pool_rest_bad_request( def test_get_storage_pool_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16050,7 +16040,7 @@ def test_get_storage_pool_rest_flattened(): def test_get_storage_pool_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16065,7 +16055,7 @@ def test_get_storage_pool_rest_flattened_error(transport: str = "rest"): def test_get_storage_pool_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16078,7 +16068,7 @@ def test_get_storage_pool_rest_error(): ) def test_update_storage_pool_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16213,14 +16203,14 @@ def test_update_storage_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_storage_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_storage_pool._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -16229,7 +16219,7 @@ def test_update_storage_pool_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16269,7 +16259,7 @@ def test_update_storage_pool_rest_required_fields( def test_update_storage_pool_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_storage_pool._get_unset_required_fields({}) @@ -16287,7 +16277,7 @@ def test_update_storage_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_storage_pool_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -16345,7 +16335,7 @@ def test_update_storage_pool_rest_bad_request( transport: str = "rest", request_type=gcn_storage_pool.UpdateStoragePoolRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16371,7 +16361,7 @@ def test_update_storage_pool_rest_bad_request( def test_update_storage_pool_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16416,7 +16406,7 @@ def test_update_storage_pool_rest_flattened(): def test_update_storage_pool_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16432,7 +16422,7 @@ def test_update_storage_pool_rest_flattened_error(transport: str = "rest"): def test_update_storage_pool_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16445,7 +16435,7 @@ def test_update_storage_pool_rest_error(): ) def test_delete_storage_pool_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16491,7 +16481,7 @@ def test_delete_storage_pool_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_storage_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16500,7 +16490,7 @@ def test_delete_storage_pool_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_storage_pool._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16509,7 +16499,7 @@ def test_delete_storage_pool_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16548,7 +16538,7 @@ def test_delete_storage_pool_rest_required_fields( def test_delete_storage_pool_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_storage_pool._get_unset_required_fields({}) @@ -16558,7 +16548,7 @@ def test_delete_storage_pool_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_storage_pool_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -16616,7 +16606,7 @@ def test_delete_storage_pool_rest_bad_request( transport: str = "rest", request_type=storage_pool.DeleteStoragePoolRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16638,7 +16628,7 @@ def test_delete_storage_pool_rest_bad_request( def test_delete_storage_pool_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16680,7 +16670,7 @@ def test_delete_storage_pool_rest_flattened(): def test_delete_storage_pool_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16695,7 +16685,7 @@ def test_delete_storage_pool_rest_flattened_error(transport: str = "rest"): def test_delete_storage_pool_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -16708,7 +16698,7 @@ def test_delete_storage_pool_rest_error(): ) def test_list_volumes_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16759,7 +16749,7 @@ def test_list_volumes_rest_required_fields(request_type=volume.ListVolumesReques # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_volumes._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -16768,7 +16758,7 @@ def test_list_volumes_rest_required_fields(request_type=volume.ListVolumesReques jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_volumes._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -16786,7 +16776,7 @@ def test_list_volumes_rest_required_fields(request_type=volume.ListVolumesReques assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -16828,7 +16818,7 @@ def test_list_volumes_rest_required_fields(request_type=volume.ListVolumesReques def test_list_volumes_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_volumes._get_unset_required_fields({}) @@ -16848,7 +16838,7 @@ def test_list_volumes_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_volumes_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -16902,7 +16892,7 @@ def test_list_volumes_rest_bad_request( transport: str = "rest", request_type=volume.ListVolumesRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16924,7 +16914,7 @@ def test_list_volumes_rest_bad_request( def test_list_volumes_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16965,7 +16955,7 @@ def test_list_volumes_rest_flattened(): def test_list_volumes_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16980,7 +16970,7 @@ def test_list_volumes_rest_flattened_error(transport: str = "rest"): def test_list_volumes_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17048,7 +17038,7 @@ def test_list_volumes_rest_pager(transport: str = "rest"): ) def test_get_volume_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17143,7 +17133,7 @@ def test_get_volume_rest_required_fields(request_type=volume.GetVolumeRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17152,7 +17142,7 @@ def test_get_volume_rest_required_fields(request_type=volume.GetVolumeRequest): jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17161,7 +17151,7 @@ def test_get_volume_rest_required_fields(request_type=volume.GetVolumeRequest): assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17203,7 +17193,7 @@ def test_get_volume_rest_required_fields(request_type=volume.GetVolumeRequest): def test_get_volume_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_volume._get_unset_required_fields({}) @@ -17213,7 +17203,7 @@ def test_get_volume_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_volume_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -17265,7 +17255,7 @@ def test_get_volume_rest_bad_request( transport: str = "rest", request_type=volume.GetVolumeRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17287,7 +17277,7 @@ def test_get_volume_rest_bad_request( def test_get_volume_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17328,7 +17318,7 @@ def test_get_volume_rest_flattened(): def test_get_volume_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17343,7 +17333,7 @@ def test_get_volume_rest_flattened_error(transport: str = "rest"): def test_get_volume_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17356,7 +17346,7 @@ def test_get_volume_rest_error(): ) def test_create_volume_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17557,7 +17547,7 @@ def test_create_volume_rest_required_fields( assert "volumeId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -17569,7 +17559,7 @@ def test_create_volume_rest_required_fields( jsonified_request["volumeId"] = "volume_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_volume._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("volume_id",)) @@ -17582,7 +17572,7 @@ def test_create_volume_rest_required_fields( assert jsonified_request["volumeId"] == "volume_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -17628,7 +17618,7 @@ def test_create_volume_rest_required_fields( def test_create_volume_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_volume._get_unset_required_fields({}) @@ -17647,7 +17637,7 @@ def test_create_volume_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_volume_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -17703,7 +17693,7 @@ def test_create_volume_rest_bad_request( transport: str = "rest", request_type=gcn_volume.CreateVolumeRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17725,7 +17715,7 @@ def test_create_volume_rest_bad_request( def test_create_volume_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17766,7 +17756,7 @@ def test_create_volume_rest_flattened(): def test_create_volume_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17783,7 +17773,7 @@ def test_create_volume_rest_flattened_error(transport: str = "rest"): def test_create_volume_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -17796,7 +17786,7 @@ def test_create_volume_rest_error(): ) def test_update_volume_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17996,14 +17986,14 @@ def test_update_volume_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_volume._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -18012,7 +18002,7 @@ def test_update_volume_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18052,7 +18042,7 @@ def test_update_volume_rest_required_fields( def test_update_volume_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_volume._get_unset_required_fields({}) @@ -18070,7 +18060,7 @@ def test_update_volume_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_volume_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -18126,7 +18116,7 @@ def test_update_volume_rest_bad_request( transport: str = "rest", request_type=gcn_volume.UpdateVolumeRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18150,7 +18140,7 @@ def test_update_volume_rest_bad_request( def test_update_volume_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18193,7 +18183,7 @@ def test_update_volume_rest_flattened(): def test_update_volume_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18209,7 +18199,7 @@ def test_update_volume_rest_flattened_error(transport: str = "rest"): def test_update_volume_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -18222,7 +18212,7 @@ def test_update_volume_rest_error(): ) def test_delete_volume_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18266,7 +18256,7 @@ def test_delete_volume_rest_required_fields(request_type=volume.DeleteVolumeRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -18275,7 +18265,7 @@ def test_delete_volume_rest_required_fields(request_type=volume.DeleteVolumeRequ jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_volume._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("force",)) @@ -18286,7 +18276,7 @@ def test_delete_volume_rest_required_fields(request_type=volume.DeleteVolumeRequ assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18325,7 +18315,7 @@ def test_delete_volume_rest_required_fields(request_type=volume.DeleteVolumeRequ def test_delete_volume_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_volume._get_unset_required_fields({}) @@ -18335,7 +18325,7 @@ def test_delete_volume_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_volume_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -18391,7 +18381,7 @@ def test_delete_volume_rest_bad_request( transport: str = "rest", request_type=volume.DeleteVolumeRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18413,7 +18403,7 @@ def test_delete_volume_rest_bad_request( def test_delete_volume_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18452,7 +18442,7 @@ def test_delete_volume_rest_flattened(): def test_delete_volume_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18467,7 +18457,7 @@ def test_delete_volume_rest_flattened_error(transport: str = "rest"): def test_delete_volume_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -18480,7 +18470,7 @@ def test_delete_volume_rest_error(): ) def test_revert_volume_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18525,7 +18515,7 @@ def test_revert_volume_rest_required_fields(request_type=volume.RevertVolumeRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).revert_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -18535,7 +18525,7 @@ def test_revert_volume_rest_required_fields(request_type=volume.RevertVolumeRequ jsonified_request["snapshotId"] = "snapshot_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).revert_volume._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -18546,7 +18536,7 @@ def test_revert_volume_rest_required_fields(request_type=volume.RevertVolumeRequ assert jsonified_request["snapshotId"] == "snapshot_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18586,7 +18576,7 @@ def test_revert_volume_rest_required_fields(request_type=volume.RevertVolumeRequ def test_revert_volume_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.revert_volume._get_unset_required_fields({}) @@ -18604,7 +18594,7 @@ def test_revert_volume_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_revert_volume_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -18660,7 +18650,7 @@ def test_revert_volume_rest_bad_request( transport: str = "rest", request_type=volume.RevertVolumeRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18682,7 +18672,7 @@ def test_revert_volume_rest_bad_request( def test_revert_volume_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -18695,7 +18685,7 @@ def test_revert_volume_rest_error(): ) def test_list_snapshots_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18748,7 +18738,7 @@ def test_list_snapshots_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_snapshots._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -18757,7 +18747,7 @@ def test_list_snapshots_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_snapshots._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -18775,7 +18765,7 @@ def test_list_snapshots_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -18817,7 +18807,7 @@ def test_list_snapshots_rest_required_fields( def test_list_snapshots_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_snapshots._get_unset_required_fields({}) @@ -18837,7 +18827,7 @@ def test_list_snapshots_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_snapshots_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -18891,7 +18881,7 @@ def test_list_snapshots_rest_bad_request( transport: str = "rest", request_type=snapshot.ListSnapshotsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18913,7 +18903,7 @@ def test_list_snapshots_rest_bad_request( def test_list_snapshots_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -18957,7 +18947,7 @@ def test_list_snapshots_rest_flattened(): def test_list_snapshots_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -18972,7 +18962,7 @@ def test_list_snapshots_rest_flattened_error(transport: str = "rest"): def test_list_snapshots_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19042,7 +19032,7 @@ def test_list_snapshots_rest_pager(transport: str = "rest"): ) def test_get_snapshot_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19101,7 +19091,7 @@ def test_get_snapshot_rest_required_fields(request_type=snapshot.GetSnapshotRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_snapshot._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19110,7 +19100,7 @@ def test_get_snapshot_rest_required_fields(request_type=snapshot.GetSnapshotRequ jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_snapshot._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19119,7 +19109,7 @@ def test_get_snapshot_rest_required_fields(request_type=snapshot.GetSnapshotRequ assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19161,7 +19151,7 @@ def test_get_snapshot_rest_required_fields(request_type=snapshot.GetSnapshotRequ def test_get_snapshot_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_snapshot._get_unset_required_fields({}) @@ -19171,7 +19161,7 @@ def test_get_snapshot_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_snapshot_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -19223,7 +19213,7 @@ def test_get_snapshot_rest_bad_request( transport: str = "rest", request_type=snapshot.GetSnapshotRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19247,7 +19237,7 @@ def test_get_snapshot_rest_bad_request( def test_get_snapshot_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19291,7 +19281,7 @@ def test_get_snapshot_rest_flattened(): def test_get_snapshot_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19306,7 +19296,7 @@ def test_get_snapshot_rest_flattened_error(transport: str = "rest"): def test_get_snapshot_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19319,7 +19309,7 @@ def test_get_snapshot_rest_error(): ) def test_create_snapshot_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19443,7 +19433,7 @@ def test_create_snapshot_rest_required_fields( assert "snapshotId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_snapshot._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19455,7 +19445,7 @@ def test_create_snapshot_rest_required_fields( jsonified_request["snapshotId"] = "snapshot_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_snapshot._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("snapshot_id",)) @@ -19468,7 +19458,7 @@ def test_create_snapshot_rest_required_fields( assert jsonified_request["snapshotId"] == "snapshot_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19514,7 +19504,7 @@ def test_create_snapshot_rest_required_fields( def test_create_snapshot_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_snapshot._get_unset_required_fields({}) @@ -19533,7 +19523,7 @@ def test_create_snapshot_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_snapshot_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -19591,7 +19581,7 @@ def test_create_snapshot_rest_bad_request( transport: str = "rest", request_type=gcn_snapshot.CreateSnapshotRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19613,7 +19603,7 @@ def test_create_snapshot_rest_bad_request( def test_create_snapshot_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19657,7 +19647,7 @@ def test_create_snapshot_rest_flattened(): def test_create_snapshot_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19674,7 +19664,7 @@ def test_create_snapshot_rest_flattened_error(transport: str = "rest"): def test_create_snapshot_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19687,7 +19677,7 @@ def test_create_snapshot_rest_error(): ) def test_delete_snapshot_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19735,7 +19725,7 @@ def test_delete_snapshot_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_snapshot._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19744,7 +19734,7 @@ def test_delete_snapshot_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_snapshot._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -19753,7 +19743,7 @@ def test_delete_snapshot_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -19792,7 +19782,7 @@ def test_delete_snapshot_rest_required_fields( def test_delete_snapshot_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_snapshot._get_unset_required_fields({}) @@ -19802,7 +19792,7 @@ def test_delete_snapshot_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_snapshot_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -19858,7 +19848,7 @@ def test_delete_snapshot_rest_bad_request( transport: str = "rest", request_type=snapshot.DeleteSnapshotRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19882,7 +19872,7 @@ def test_delete_snapshot_rest_bad_request( def test_delete_snapshot_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -19924,7 +19914,7 @@ def test_delete_snapshot_rest_flattened(): def test_delete_snapshot_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -19939,7 +19929,7 @@ def test_delete_snapshot_rest_flattened_error(transport: str = "rest"): def test_delete_snapshot_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19952,7 +19942,7 @@ def test_delete_snapshot_rest_error(): ) def test_update_snapshot_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20077,14 +20067,14 @@ def test_update_snapshot_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_snapshot._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_snapshot._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -20093,7 +20083,7 @@ def test_update_snapshot_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -20133,7 +20123,7 @@ def test_update_snapshot_rest_required_fields( def test_update_snapshot_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_snapshot._get_unset_required_fields({}) @@ -20151,7 +20141,7 @@ def test_update_snapshot_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_snapshot_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -20209,7 +20199,7 @@ def test_update_snapshot_rest_bad_request( transport: str = "rest", request_type=gcn_snapshot.UpdateSnapshotRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20235,7 +20225,7 @@ def test_update_snapshot_rest_bad_request( def test_update_snapshot_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20280,7 +20270,7 @@ def test_update_snapshot_rest_flattened(): def test_update_snapshot_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20296,7 +20286,7 @@ def test_update_snapshot_rest_flattened_error(transport: str = "rest"): def test_update_snapshot_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20309,7 +20299,7 @@ def test_update_snapshot_rest_error(): ) def test_list_active_directories_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20362,7 +20352,7 @@ def test_list_active_directories_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_active_directories._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -20371,7 +20361,7 @@ def test_list_active_directories_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_active_directories._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -20389,7 +20379,7 @@ def test_list_active_directories_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -20433,7 +20423,7 @@ def test_list_active_directories_rest_required_fields( def test_list_active_directories_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_active_directories._get_unset_required_fields({}) @@ -20453,7 +20443,7 @@ def test_list_active_directories_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_active_directories_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -20511,7 +20501,7 @@ def test_list_active_directories_rest_bad_request( transport: str = "rest", request_type=active_directory.ListActiveDirectoriesRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20533,7 +20523,7 @@ def test_list_active_directories_rest_bad_request( def test_list_active_directories_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20575,7 +20565,7 @@ def test_list_active_directories_rest_flattened(): def test_list_active_directories_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20590,7 +20580,7 @@ def test_list_active_directories_rest_flattened_error(transport: str = "rest"): def test_list_active_directories_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20660,7 +20650,7 @@ def test_list_active_directories_rest_pager(transport: str = "rest"): ) def test_get_active_directory_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20749,7 +20739,7 @@ def test_get_active_directory_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_active_directory._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -20758,7 +20748,7 @@ def test_get_active_directory_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_active_directory._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -20767,7 +20757,7 @@ def test_get_active_directory_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -20809,7 +20799,7 @@ def test_get_active_directory_rest_required_fields( def test_get_active_directory_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_active_directory._get_unset_required_fields({}) @@ -20819,7 +20809,7 @@ def test_get_active_directory_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_active_directory_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -20875,7 +20865,7 @@ def test_get_active_directory_rest_bad_request( transport: str = "rest", request_type=active_directory.GetActiveDirectoryRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20899,7 +20889,7 @@ def test_get_active_directory_rest_bad_request( def test_get_active_directory_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -20943,7 +20933,7 @@ def test_get_active_directory_rest_flattened(): def test_get_active_directory_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -20958,7 +20948,7 @@ def test_get_active_directory_rest_flattened_error(transport: str = "rest"): def test_get_active_directory_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20971,7 +20961,7 @@ def test_get_active_directory_rest_error(): ) def test_create_active_directory_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21114,7 +21104,7 @@ def test_create_active_directory_rest_required_fields( assert "activeDirectoryId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_active_directory._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -21126,7 +21116,7 @@ def test_create_active_directory_rest_required_fields( jsonified_request["activeDirectoryId"] = "active_directory_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_active_directory._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("active_directory_id",)) @@ -21139,7 +21129,7 @@ def test_create_active_directory_rest_required_fields( assert jsonified_request["activeDirectoryId"] == "active_directory_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -21185,7 +21175,7 @@ def test_create_active_directory_rest_required_fields( def test_create_active_directory_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_active_directory._get_unset_required_fields({}) @@ -21204,7 +21194,7 @@ def test_create_active_directory_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_active_directory_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -21263,7 +21253,7 @@ def test_create_active_directory_rest_bad_request( request_type=gcn_active_directory.CreateActiveDirectoryRequest, ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21285,7 +21275,7 @@ def test_create_active_directory_rest_bad_request( def test_create_active_directory_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21327,7 +21317,7 @@ def test_create_active_directory_rest_flattened(): def test_create_active_directory_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21344,7 +21334,7 @@ def test_create_active_directory_rest_flattened_error(transport: str = "rest"): def test_create_active_directory_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21357,7 +21347,7 @@ def test_create_active_directory_rest_error(): ) def test_update_active_directory_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21501,14 +21491,14 @@ def test_update_active_directory_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_active_directory._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_active_directory._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -21517,7 +21507,7 @@ def test_update_active_directory_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -21557,7 +21547,7 @@ def test_update_active_directory_rest_required_fields( def test_update_active_directory_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_active_directory._get_unset_required_fields({}) @@ -21575,7 +21565,7 @@ def test_update_active_directory_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_active_directory_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -21634,7 +21624,7 @@ def test_update_active_directory_rest_bad_request( request_type=gcn_active_directory.UpdateActiveDirectoryRequest, ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21660,7 +21650,7 @@ def test_update_active_directory_rest_bad_request( def test_update_active_directory_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21705,7 +21695,7 @@ def test_update_active_directory_rest_flattened(): def test_update_active_directory_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21721,7 +21711,7 @@ def test_update_active_directory_rest_flattened_error(transport: str = "rest"): def test_update_active_directory_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21734,7 +21724,7 @@ def test_update_active_directory_rest_error(): ) def test_delete_active_directory_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21782,7 +21772,7 @@ def test_delete_active_directory_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_active_directory._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -21791,7 +21781,7 @@ def test_delete_active_directory_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_active_directory._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -21800,7 +21790,7 @@ def test_delete_active_directory_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -21839,7 +21829,7 @@ def test_delete_active_directory_rest_required_fields( def test_delete_active_directory_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_active_directory._get_unset_required_fields({}) @@ -21849,7 +21839,7 @@ def test_delete_active_directory_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_active_directory_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -21907,7 +21897,7 @@ def test_delete_active_directory_rest_bad_request( transport: str = "rest", request_type=active_directory.DeleteActiveDirectoryRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21931,7 +21921,7 @@ def test_delete_active_directory_rest_bad_request( def test_delete_active_directory_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -21973,7 +21963,7 @@ def test_delete_active_directory_rest_flattened(): def test_delete_active_directory_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -21988,7 +21978,7 @@ def test_delete_active_directory_rest_flattened_error(transport: str = "rest"): def test_delete_active_directory_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22001,7 +21991,7 @@ def test_delete_active_directory_rest_error(): ) def test_list_kms_configs_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22052,7 +22042,7 @@ def test_list_kms_configs_rest_required_fields(request_type=kms.ListKmsConfigsRe # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_kms_configs._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22061,7 +22051,7 @@ def test_list_kms_configs_rest_required_fields(request_type=kms.ListKmsConfigsRe jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_kms_configs._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -22079,7 +22069,7 @@ def test_list_kms_configs_rest_required_fields(request_type=kms.ListKmsConfigsRe assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -22121,7 +22111,7 @@ def test_list_kms_configs_rest_required_fields(request_type=kms.ListKmsConfigsRe def test_list_kms_configs_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_kms_configs._get_unset_required_fields({}) @@ -22141,7 +22131,7 @@ def test_list_kms_configs_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_kms_configs_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -22195,7 +22185,7 @@ def test_list_kms_configs_rest_bad_request( transport: str = "rest", request_type=kms.ListKmsConfigsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22217,7 +22207,7 @@ def test_list_kms_configs_rest_bad_request( def test_list_kms_configs_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22258,7 +22248,7 @@ def test_list_kms_configs_rest_flattened(): def test_list_kms_configs_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22273,7 +22263,7 @@ def test_list_kms_configs_rest_flattened_error(transport: str = "rest"): def test_list_kms_configs_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22341,7 +22331,7 @@ def test_list_kms_configs_rest_pager(transport: str = "rest"): ) def test_create_kms_config_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22467,7 +22457,7 @@ def test_create_kms_config_rest_required_fields( assert "kmsConfigId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22479,7 +22469,7 @@ def test_create_kms_config_rest_required_fields( jsonified_request["kmsConfigId"] = "kms_config_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_kms_config._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("kms_config_id",)) @@ -22492,7 +22482,7 @@ def test_create_kms_config_rest_required_fields( assert jsonified_request["kmsConfigId"] == "kms_config_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -22538,7 +22528,7 @@ def test_create_kms_config_rest_required_fields( def test_create_kms_config_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_kms_config._get_unset_required_fields({}) @@ -22557,7 +22547,7 @@ def test_create_kms_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_kms_config_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -22613,7 +22603,7 @@ def test_create_kms_config_rest_bad_request( transport: str = "rest", request_type=kms.CreateKmsConfigRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22635,7 +22625,7 @@ def test_create_kms_config_rest_bad_request( def test_create_kms_config_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22676,7 +22666,7 @@ def test_create_kms_config_rest_flattened(): def test_create_kms_config_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22693,7 +22683,7 @@ def test_create_kms_config_rest_flattened_error(transport: str = "rest"): def test_create_kms_config_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22706,7 +22696,7 @@ def test_create_kms_config_rest_error(): ) def test_get_kms_config_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22767,7 +22757,7 @@ def test_get_kms_config_rest_required_fields(request_type=kms.GetKmsConfigReques # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22776,7 +22766,7 @@ def test_get_kms_config_rest_required_fields(request_type=kms.GetKmsConfigReques jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -22785,7 +22775,7 @@ def test_get_kms_config_rest_required_fields(request_type=kms.GetKmsConfigReques assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -22827,7 +22817,7 @@ def test_get_kms_config_rest_required_fields(request_type=kms.GetKmsConfigReques def test_get_kms_config_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_kms_config._get_unset_required_fields({}) @@ -22837,7 +22827,7 @@ def test_get_kms_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_kms_config_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -22889,7 +22879,7 @@ def test_get_kms_config_rest_bad_request( transport: str = "rest", request_type=kms.GetKmsConfigRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22911,7 +22901,7 @@ def test_get_kms_config_rest_bad_request( def test_get_kms_config_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -22954,7 +22944,7 @@ def test_get_kms_config_rest_flattened(): def test_get_kms_config_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -22969,7 +22959,7 @@ def test_get_kms_config_rest_flattened_error(transport: str = "rest"): def test_get_kms_config_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22982,7 +22972,7 @@ def test_get_kms_config_rest_error(): ) def test_update_kms_config_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23107,14 +23097,14 @@ def test_update_kms_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_kms_config._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -23123,7 +23113,7 @@ def test_update_kms_config_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23163,7 +23153,7 @@ def test_update_kms_config_rest_required_fields( def test_update_kms_config_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_kms_config._get_unset_required_fields({}) @@ -23181,7 +23171,7 @@ def test_update_kms_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_kms_config_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -23237,7 +23227,7 @@ def test_update_kms_config_rest_bad_request( transport: str = "rest", request_type=kms.UpdateKmsConfigRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23261,7 +23251,7 @@ def test_update_kms_config_rest_bad_request( def test_update_kms_config_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23306,7 +23296,7 @@ def test_update_kms_config_rest_flattened(): def test_update_kms_config_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23322,7 +23312,7 @@ def test_update_kms_config_rest_flattened_error(transport: str = "rest"): def test_update_kms_config_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23335,7 +23325,7 @@ def test_update_kms_config_rest_error(): ) def test_encrypt_volumes_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23379,7 +23369,7 @@ def test_encrypt_volumes_rest_required_fields(request_type=kms.EncryptVolumesReq # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).encrypt_volumes._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23388,7 +23378,7 @@ def test_encrypt_volumes_rest_required_fields(request_type=kms.EncryptVolumesReq jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).encrypt_volumes._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23397,7 +23387,7 @@ def test_encrypt_volumes_rest_required_fields(request_type=kms.EncryptVolumesReq assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23437,7 +23427,7 @@ def test_encrypt_volumes_rest_required_fields(request_type=kms.EncryptVolumesReq def test_encrypt_volumes_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.encrypt_volumes._get_unset_required_fields({}) @@ -23447,7 +23437,7 @@ def test_encrypt_volumes_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_encrypt_volumes_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -23503,7 +23493,7 @@ def test_encrypt_volumes_rest_bad_request( transport: str = "rest", request_type=kms.EncryptVolumesRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23525,7 +23515,7 @@ def test_encrypt_volumes_rest_bad_request( def test_encrypt_volumes_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23538,7 +23528,7 @@ def test_encrypt_volumes_rest_error(): ) def test_verify_kms_config_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23593,7 +23583,7 @@ def test_verify_kms_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).verify_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23602,7 +23592,7 @@ def test_verify_kms_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).verify_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23611,7 +23601,7 @@ def test_verify_kms_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23654,7 +23644,7 @@ def test_verify_kms_config_rest_required_fields( def test_verify_kms_config_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.verify_kms_config._get_unset_required_fields({}) @@ -23664,7 +23654,7 @@ def test_verify_kms_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_verify_kms_config_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -23718,7 +23708,7 @@ def test_verify_kms_config_rest_bad_request( transport: str = "rest", request_type=kms.VerifyKmsConfigRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23740,7 +23730,7 @@ def test_verify_kms_config_rest_bad_request( def test_verify_kms_config_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23753,7 +23743,7 @@ def test_verify_kms_config_rest_error(): ) def test_delete_kms_config_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23799,7 +23789,7 @@ def test_delete_kms_config_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23808,7 +23798,7 @@ def test_delete_kms_config_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_kms_config._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -23817,7 +23807,7 @@ def test_delete_kms_config_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -23856,7 +23846,7 @@ def test_delete_kms_config_rest_required_fields( def test_delete_kms_config_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_kms_config._get_unset_required_fields({}) @@ -23866,7 +23856,7 @@ def test_delete_kms_config_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_kms_config_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -23922,7 +23912,7 @@ def test_delete_kms_config_rest_bad_request( transport: str = "rest", request_type=kms.DeleteKmsConfigRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -23944,7 +23934,7 @@ def test_delete_kms_config_rest_bad_request( def test_delete_kms_config_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23985,7 +23975,7 @@ def test_delete_kms_config_rest_flattened(): def test_delete_kms_config_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24000,7 +23990,7 @@ def test_delete_kms_config_rest_flattened_error(transport: str = "rest"): def test_delete_kms_config_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -24013,7 +24003,7 @@ def test_delete_kms_config_rest_error(): ) def test_list_replications_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24066,7 +24056,7 @@ def test_list_replications_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_replications._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24075,7 +24065,7 @@ def test_list_replications_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_replications._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -24093,7 +24083,7 @@ def test_list_replications_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -24135,7 +24125,7 @@ def test_list_replications_rest_required_fields( def test_list_replications_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_replications._get_unset_required_fields({}) @@ -24155,7 +24145,7 @@ def test_list_replications_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_replications_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -24211,7 +24201,7 @@ def test_list_replications_rest_bad_request( transport: str = "rest", request_type=replication.ListReplicationsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24233,7 +24223,7 @@ def test_list_replications_rest_bad_request( def test_list_replications_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24277,7 +24267,7 @@ def test_list_replications_rest_flattened(): def test_list_replications_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24292,7 +24282,7 @@ def test_list_replications_rest_flattened_error(transport: str = "rest"): def test_list_replications_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24364,7 +24354,7 @@ def test_list_replications_rest_pager(transport: str = "rest"): ) def test_get_replication_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24438,7 +24428,7 @@ def test_get_replication_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24447,7 +24437,7 @@ def test_get_replication_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24456,7 +24446,7 @@ def test_get_replication_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -24498,7 +24488,7 @@ def test_get_replication_rest_required_fields( def test_get_replication_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_replication._get_unset_required_fields({}) @@ -24508,7 +24498,7 @@ def test_get_replication_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_replication_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -24564,7 +24554,7 @@ def test_get_replication_rest_bad_request( transport: str = "rest", request_type=replication.GetReplicationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24588,7 +24578,7 @@ def test_get_replication_rest_bad_request( def test_get_replication_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24632,7 +24622,7 @@ def test_get_replication_rest_flattened(): def test_get_replication_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24647,7 +24637,7 @@ def test_get_replication_rest_flattened_error(transport: str = "rest"): def test_get_replication_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -24660,7 +24650,7 @@ def test_get_replication_rest_error(): ) def test_create_replication_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24805,7 +24795,7 @@ def test_create_replication_rest_required_fields( assert "replicationId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -24817,7 +24807,7 @@ def test_create_replication_rest_required_fields( jsonified_request["replicationId"] = "replication_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_replication._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("replication_id",)) @@ -24830,7 +24820,7 @@ def test_create_replication_rest_required_fields( assert jsonified_request["replicationId"] == "replication_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -24876,7 +24866,7 @@ def test_create_replication_rest_required_fields( def test_create_replication_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_replication._get_unset_required_fields({}) @@ -24895,7 +24885,7 @@ def test_create_replication_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_replication_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -24953,7 +24943,7 @@ def test_create_replication_rest_bad_request( transport: str = "rest", request_type=gcn_replication.CreateReplicationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -24975,7 +24965,7 @@ def test_create_replication_rest_bad_request( def test_create_replication_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25019,7 +25009,7 @@ def test_create_replication_rest_flattened(): def test_create_replication_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25036,7 +25026,7 @@ def test_create_replication_rest_flattened_error(transport: str = "rest"): def test_create_replication_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -25049,7 +25039,7 @@ def test_create_replication_rest_error(): ) def test_delete_replication_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25097,7 +25087,7 @@ def test_delete_replication_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25106,7 +25096,7 @@ def test_delete_replication_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25115,7 +25105,7 @@ def test_delete_replication_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -25154,7 +25144,7 @@ def test_delete_replication_rest_required_fields( def test_delete_replication_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_replication._get_unset_required_fields({}) @@ -25164,7 +25154,7 @@ def test_delete_replication_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_replication_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -25222,7 +25212,7 @@ def test_delete_replication_rest_bad_request( transport: str = "rest", request_type=replication.DeleteReplicationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25246,7 +25236,7 @@ def test_delete_replication_rest_bad_request( def test_delete_replication_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25288,7 +25278,7 @@ def test_delete_replication_rest_flattened(): def test_delete_replication_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25303,7 +25293,7 @@ def test_delete_replication_rest_flattened_error(transport: str = "rest"): def test_delete_replication_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -25316,7 +25306,7 @@ def test_delete_replication_rest_error(): ) def test_update_replication_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25462,14 +25452,14 @@ def test_update_replication_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_replication._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -25478,7 +25468,7 @@ def test_update_replication_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -25518,7 +25508,7 @@ def test_update_replication_rest_required_fields( def test_update_replication_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_replication._get_unset_required_fields({}) @@ -25536,7 +25526,7 @@ def test_update_replication_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_replication_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -25594,7 +25584,7 @@ def test_update_replication_rest_bad_request( transport: str = "rest", request_type=gcn_replication.UpdateReplicationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25620,7 +25610,7 @@ def test_update_replication_rest_bad_request( def test_update_replication_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25665,7 +25655,7 @@ def test_update_replication_rest_flattened(): def test_update_replication_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25681,7 +25671,7 @@ def test_update_replication_rest_flattened_error(transport: str = "rest"): def test_update_replication_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -25694,7 +25684,7 @@ def test_update_replication_rest_error(): ) def test_stop_replication_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25742,7 +25732,7 @@ def test_stop_replication_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).stop_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25751,7 +25741,7 @@ def test_stop_replication_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).stop_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25760,7 +25750,7 @@ def test_stop_replication_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -25800,7 +25790,7 @@ def test_stop_replication_rest_required_fields( def test_stop_replication_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.stop_replication._get_unset_required_fields({}) @@ -25810,7 +25800,7 @@ def test_stop_replication_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_stop_replication_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -25868,7 +25858,7 @@ def test_stop_replication_rest_bad_request( transport: str = "rest", request_type=replication.StopReplicationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -25892,7 +25882,7 @@ def test_stop_replication_rest_bad_request( def test_stop_replication_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -25905,7 +25895,7 @@ def test_stop_replication_rest_error(): ) def test_resume_replication_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -25953,7 +25943,7 @@ def test_resume_replication_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).resume_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25962,7 +25952,7 @@ def test_resume_replication_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).resume_replication._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -25971,7 +25961,7 @@ def test_resume_replication_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26011,7 +26001,7 @@ def test_resume_replication_rest_required_fields( def test_resume_replication_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.resume_replication._get_unset_required_fields({}) @@ -26021,7 +26011,7 @@ def test_resume_replication_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_resume_replication_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -26079,7 +26069,7 @@ def test_resume_replication_rest_bad_request( transport: str = "rest", request_type=replication.ResumeReplicationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26103,7 +26093,7 @@ def test_resume_replication_rest_bad_request( def test_resume_replication_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26116,7 +26106,7 @@ def test_resume_replication_rest_error(): ) def test_reverse_replication_direction_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26164,7 +26154,7 @@ def test_reverse_replication_direction_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reverse_replication_direction._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26173,7 +26163,7 @@ def test_reverse_replication_direction_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).reverse_replication_direction._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26182,7 +26172,7 @@ def test_reverse_replication_direction_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26222,7 +26212,7 @@ def test_reverse_replication_direction_rest_required_fields( def test_reverse_replication_direction_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.reverse_replication_direction._get_unset_required_fields( @@ -26234,7 +26224,7 @@ def test_reverse_replication_direction_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_reverse_replication_direction_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -26292,7 +26282,7 @@ def test_reverse_replication_direction_rest_bad_request( transport: str = "rest", request_type=replication.ReverseReplicationDirectionRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26316,7 +26306,7 @@ def test_reverse_replication_direction_rest_bad_request( def test_reverse_replication_direction_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26329,7 +26319,7 @@ def test_reverse_replication_direction_rest_error(): ) def test_create_backup_vault_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26451,7 +26441,7 @@ def test_create_backup_vault_rest_required_fields( assert "backupVaultId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_backup_vault._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26463,7 +26453,7 @@ def test_create_backup_vault_rest_required_fields( jsonified_request["backupVaultId"] = "backup_vault_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_backup_vault._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("backup_vault_id",)) @@ -26476,7 +26466,7 @@ def test_create_backup_vault_rest_required_fields( assert jsonified_request["backupVaultId"] == "backup_vault_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26522,7 +26512,7 @@ def test_create_backup_vault_rest_required_fields( def test_create_backup_vault_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_backup_vault._get_unset_required_fields({}) @@ -26541,7 +26531,7 @@ def test_create_backup_vault_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_backup_vault_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -26599,7 +26589,7 @@ def test_create_backup_vault_rest_bad_request( transport: str = "rest", request_type=gcn_backup_vault.CreateBackupVaultRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26621,7 +26611,7 @@ def test_create_backup_vault_rest_bad_request( def test_create_backup_vault_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26663,7 +26653,7 @@ def test_create_backup_vault_rest_flattened(): def test_create_backup_vault_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26680,7 +26670,7 @@ def test_create_backup_vault_rest_flattened_error(transport: str = "rest"): def test_create_backup_vault_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26693,7 +26683,7 @@ def test_create_backup_vault_rest_error(): ) def test_get_backup_vault_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26748,7 +26738,7 @@ def test_get_backup_vault_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_backup_vault._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26757,7 +26747,7 @@ def test_get_backup_vault_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_backup_vault._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -26766,7 +26756,7 @@ def test_get_backup_vault_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -26808,7 +26798,7 @@ def test_get_backup_vault_rest_required_fields( def test_get_backup_vault_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_backup_vault._get_unset_required_fields({}) @@ -26818,7 +26808,7 @@ def test_get_backup_vault_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_backup_vault_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -26874,7 +26864,7 @@ def test_get_backup_vault_rest_bad_request( transport: str = "rest", request_type=backup_vault.GetBackupVaultRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26896,7 +26886,7 @@ def test_get_backup_vault_rest_bad_request( def test_get_backup_vault_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -26940,7 +26930,7 @@ def test_get_backup_vault_rest_flattened(): def test_get_backup_vault_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -26955,7 +26945,7 @@ def test_get_backup_vault_rest_flattened_error(transport: str = "rest"): def test_get_backup_vault_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -26968,7 +26958,7 @@ def test_get_backup_vault_rest_error(): ) def test_list_backup_vaults_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27021,7 +27011,7 @@ def test_list_backup_vaults_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_backup_vaults._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -27030,7 +27020,7 @@ def test_list_backup_vaults_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_backup_vaults._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -27048,7 +27038,7 @@ def test_list_backup_vaults_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -27090,7 +27080,7 @@ def test_list_backup_vaults_rest_required_fields( def test_list_backup_vaults_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_backup_vaults._get_unset_required_fields({}) @@ -27110,7 +27100,7 @@ def test_list_backup_vaults_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_backup_vaults_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -27166,7 +27156,7 @@ def test_list_backup_vaults_rest_bad_request( transport: str = "rest", request_type=backup_vault.ListBackupVaultsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27188,7 +27178,7 @@ def test_list_backup_vaults_rest_bad_request( def test_list_backup_vaults_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27230,7 +27220,7 @@ def test_list_backup_vaults_rest_flattened(): def test_list_backup_vaults_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27245,7 +27235,7 @@ def test_list_backup_vaults_rest_flattened_error(transport: str = "rest"): def test_list_backup_vaults_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27315,7 +27305,7 @@ def test_list_backup_vaults_rest_pager(transport: str = "rest"): ) def test_update_backup_vault_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27438,14 +27428,14 @@ def test_update_backup_vault_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_backup_vault._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_backup_vault._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -27454,7 +27444,7 @@ def test_update_backup_vault_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -27494,7 +27484,7 @@ def test_update_backup_vault_rest_required_fields( def test_update_backup_vault_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_backup_vault._get_unset_required_fields({}) @@ -27512,7 +27502,7 @@ def test_update_backup_vault_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_backup_vault_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -27570,7 +27560,7 @@ def test_update_backup_vault_rest_bad_request( transport: str = "rest", request_type=gcn_backup_vault.UpdateBackupVaultRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27596,7 +27586,7 @@ def test_update_backup_vault_rest_bad_request( def test_update_backup_vault_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27641,7 +27631,7 @@ def test_update_backup_vault_rest_flattened(): def test_update_backup_vault_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27657,7 +27647,7 @@ def test_update_backup_vault_rest_flattened_error(transport: str = "rest"): def test_update_backup_vault_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -27670,7 +27660,7 @@ def test_update_backup_vault_rest_error(): ) def test_delete_backup_vault_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27716,7 +27706,7 @@ def test_delete_backup_vault_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_backup_vault._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -27725,7 +27715,7 @@ def test_delete_backup_vault_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_backup_vault._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -27734,7 +27724,7 @@ def test_delete_backup_vault_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -27773,7 +27763,7 @@ def test_delete_backup_vault_rest_required_fields( def test_delete_backup_vault_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_backup_vault._get_unset_required_fields({}) @@ -27783,7 +27773,7 @@ def test_delete_backup_vault_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_backup_vault_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -27841,7 +27831,7 @@ def test_delete_backup_vault_rest_bad_request( transport: str = "rest", request_type=backup_vault.DeleteBackupVaultRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27863,7 +27853,7 @@ def test_delete_backup_vault_rest_bad_request( def test_delete_backup_vault_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -27905,7 +27895,7 @@ def test_delete_backup_vault_rest_flattened(): def test_delete_backup_vault_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -27920,7 +27910,7 @@ def test_delete_backup_vault_rest_flattened_error(transport: str = "rest"): def test_delete_backup_vault_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -27933,7 +27923,7 @@ def test_delete_backup_vault_rest_error(): ) def test_create_backup_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28060,7 +28050,7 @@ def test_create_backup_rest_required_fields( assert "backupId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_backup._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28072,7 +28062,7 @@ def test_create_backup_rest_required_fields( jsonified_request["backupId"] = "backup_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_backup._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("backup_id",)) @@ -28085,7 +28075,7 @@ def test_create_backup_rest_required_fields( assert jsonified_request["backupId"] == "backup_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -28131,7 +28121,7 @@ def test_create_backup_rest_required_fields( def test_create_backup_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_backup._get_unset_required_fields({}) @@ -28150,7 +28140,7 @@ def test_create_backup_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_backup_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -28206,7 +28196,7 @@ def test_create_backup_rest_bad_request( transport: str = "rest", request_type=gcn_backup.CreateBackupRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28228,7 +28218,7 @@ def test_create_backup_rest_bad_request( def test_create_backup_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28272,7 +28262,7 @@ def test_create_backup_rest_flattened(): def test_create_backup_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28289,7 +28279,7 @@ def test_create_backup_rest_flattened_error(transport: str = "rest"): def test_create_backup_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -28302,7 +28292,7 @@ def test_create_backup_rest_error(): ) def test_get_backup_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28367,7 +28357,7 @@ def test_get_backup_rest_required_fields(request_type=backup.GetBackupRequest): # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_backup._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28376,7 +28366,7 @@ def test_get_backup_rest_required_fields(request_type=backup.GetBackupRequest): jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_backup._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28385,7 +28375,7 @@ def test_get_backup_rest_required_fields(request_type=backup.GetBackupRequest): assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -28427,7 +28417,7 @@ def test_get_backup_rest_required_fields(request_type=backup.GetBackupRequest): def test_get_backup_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_backup._get_unset_required_fields({}) @@ -28437,7 +28427,7 @@ def test_get_backup_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_backup_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -28489,7 +28479,7 @@ def test_get_backup_rest_bad_request( transport: str = "rest", request_type=backup.GetBackupRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28513,7 +28503,7 @@ def test_get_backup_rest_bad_request( def test_get_backup_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28557,7 +28547,7 @@ def test_get_backup_rest_flattened(): def test_get_backup_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28572,7 +28562,7 @@ def test_get_backup_rest_flattened_error(transport: str = "rest"): def test_get_backup_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -28585,7 +28575,7 @@ def test_get_backup_rest_error(): ) def test_list_backups_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28636,7 +28626,7 @@ def test_list_backups_rest_required_fields(request_type=backup.ListBackupsReques # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_backups._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28645,7 +28635,7 @@ def test_list_backups_rest_required_fields(request_type=backup.ListBackupsReques jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_backups._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -28663,7 +28653,7 @@ def test_list_backups_rest_required_fields(request_type=backup.ListBackupsReques assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -28705,7 +28695,7 @@ def test_list_backups_rest_required_fields(request_type=backup.ListBackupsReques def test_list_backups_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_backups._get_unset_required_fields({}) @@ -28725,7 +28715,7 @@ def test_list_backups_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_backups_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -28779,7 +28769,7 @@ def test_list_backups_rest_bad_request( transport: str = "rest", request_type=backup.ListBackupsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28801,7 +28791,7 @@ def test_list_backups_rest_bad_request( def test_list_backups_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28845,7 +28835,7 @@ def test_list_backups_rest_flattened(): def test_list_backups_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28860,7 +28850,7 @@ def test_list_backups_rest_flattened_error(transport: str = "rest"): def test_list_backups_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -28930,7 +28920,7 @@ def test_list_backups_rest_pager(transport: str = "rest"): ) def test_delete_backup_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -28976,7 +28966,7 @@ def test_delete_backup_rest_required_fields(request_type=backup.DeleteBackupRequ # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_backup._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28985,7 +28975,7 @@ def test_delete_backup_rest_required_fields(request_type=backup.DeleteBackupRequ jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_backup._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -28994,7 +28984,7 @@ def test_delete_backup_rest_required_fields(request_type=backup.DeleteBackupRequ assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -29033,7 +29023,7 @@ def test_delete_backup_rest_required_fields(request_type=backup.DeleteBackupRequ def test_delete_backup_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_backup._get_unset_required_fields({}) @@ -29043,7 +29033,7 @@ def test_delete_backup_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_backup_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -29099,7 +29089,7 @@ def test_delete_backup_rest_bad_request( transport: str = "rest", request_type=backup.DeleteBackupRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29123,7 +29113,7 @@ def test_delete_backup_rest_bad_request( def test_delete_backup_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29165,7 +29155,7 @@ def test_delete_backup_rest_flattened(): def test_delete_backup_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29180,7 +29170,7 @@ def test_delete_backup_rest_flattened_error(transport: str = "rest"): def test_delete_backup_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -29193,7 +29183,7 @@ def test_delete_backup_rest_error(): ) def test_update_backup_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29321,14 +29311,14 @@ def test_update_backup_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_backup._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_backup._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -29337,7 +29327,7 @@ def test_update_backup_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -29377,7 +29367,7 @@ def test_update_backup_rest_required_fields( def test_update_backup_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_backup._get_unset_required_fields({}) @@ -29395,7 +29385,7 @@ def test_update_backup_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_backup_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -29451,7 +29441,7 @@ def test_update_backup_rest_bad_request( transport: str = "rest", request_type=gcn_backup.UpdateBackupRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29477,7 +29467,7 @@ def test_update_backup_rest_bad_request( def test_update_backup_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29522,7 +29512,7 @@ def test_update_backup_rest_flattened(): def test_update_backup_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29538,7 +29528,7 @@ def test_update_backup_rest_flattened_error(transport: str = "rest"): def test_update_backup_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -29551,7 +29541,7 @@ def test_update_backup_rest_error(): ) def test_create_backup_policy_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29680,7 +29670,7 @@ def test_create_backup_policy_rest_required_fields( assert "backupPolicyId" not in jsonified_request unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_backup_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -29692,7 +29682,7 @@ def test_create_backup_policy_rest_required_fields( jsonified_request["backupPolicyId"] = "backup_policy_id_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).create_backup_policy._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("backup_policy_id",)) @@ -29705,7 +29695,7 @@ def test_create_backup_policy_rest_required_fields( assert jsonified_request["backupPolicyId"] == "backup_policy_id_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -29751,7 +29741,7 @@ def test_create_backup_policy_rest_required_fields( def test_create_backup_policy_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.create_backup_policy._get_unset_required_fields({}) @@ -29770,7 +29760,7 @@ def test_create_backup_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_create_backup_policy_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -29828,7 +29818,7 @@ def test_create_backup_policy_rest_bad_request( transport: str = "rest", request_type=gcn_backup_policy.CreateBackupPolicyRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29850,7 +29840,7 @@ def test_create_backup_policy_rest_bad_request( def test_create_backup_policy_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29892,7 +29882,7 @@ def test_create_backup_policy_rest_flattened(): def test_create_backup_policy_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -29909,7 +29899,7 @@ def test_create_backup_policy_rest_flattened_error(transport: str = "rest"): def test_create_backup_policy_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -29922,7 +29912,7 @@ def test_create_backup_policy_rest_error(): ) def test_get_backup_policy_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -29987,7 +29977,7 @@ def test_get_backup_policy_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_backup_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -29996,7 +29986,7 @@ def test_get_backup_policy_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).get_backup_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -30005,7 +29995,7 @@ def test_get_backup_policy_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -30047,7 +30037,7 @@ def test_get_backup_policy_rest_required_fields( def test_get_backup_policy_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.get_backup_policy._get_unset_required_fields({}) @@ -30057,7 +30047,7 @@ def test_get_backup_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_get_backup_policy_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -30113,7 +30103,7 @@ def test_get_backup_policy_rest_bad_request( transport: str = "rest", request_type=backup_policy.GetBackupPolicyRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30135,7 +30125,7 @@ def test_get_backup_policy_rest_bad_request( def test_get_backup_policy_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30179,7 +30169,7 @@ def test_get_backup_policy_rest_flattened(): def test_get_backup_policy_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30194,7 +30184,7 @@ def test_get_backup_policy_rest_flattened_error(transport: str = "rest"): def test_get_backup_policy_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -30207,7 +30197,7 @@ def test_get_backup_policy_rest_error(): ) def test_list_backup_policies_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30260,7 +30250,7 @@ def test_list_backup_policies_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_backup_policies._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -30269,7 +30259,7 @@ def test_list_backup_policies_rest_required_fields( jsonified_request["parent"] = "parent_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).list_backup_policies._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set( @@ -30287,7 +30277,7 @@ def test_list_backup_policies_rest_required_fields( assert jsonified_request["parent"] == "parent_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -30329,7 +30319,7 @@ def test_list_backup_policies_rest_required_fields( def test_list_backup_policies_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.list_backup_policies._get_unset_required_fields({}) @@ -30349,7 +30339,7 @@ def test_list_backup_policies_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_list_backup_policies_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -30405,7 +30395,7 @@ def test_list_backup_policies_rest_bad_request( transport: str = "rest", request_type=backup_policy.ListBackupPoliciesRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30427,7 +30417,7 @@ def test_list_backup_policies_rest_bad_request( def test_list_backup_policies_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30469,7 +30459,7 @@ def test_list_backup_policies_rest_flattened(): def test_list_backup_policies_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30484,7 +30474,7 @@ def test_list_backup_policies_rest_flattened_error(transport: str = "rest"): def test_list_backup_policies_rest_pager(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30554,7 +30544,7 @@ def test_list_backup_policies_rest_pager(transport: str = "rest"): ) def test_update_backup_policy_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30684,14 +30674,14 @@ def test_update_backup_policy_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_backup_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).update_backup_policy._get_unset_required_fields(jsonified_request) # Check that path parameters and body parameters are not mixing in. assert not set(unset_fields) - set(("update_mask",)) @@ -30700,7 +30690,7 @@ def test_update_backup_policy_rest_required_fields( # verify required fields with non-default values are left alone client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -30740,7 +30730,7 @@ def test_update_backup_policy_rest_required_fields( def test_update_backup_policy_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.update_backup_policy._get_unset_required_fields({}) @@ -30758,7 +30748,7 @@ def test_update_backup_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_update_backup_policy_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -30816,7 +30806,7 @@ def test_update_backup_policy_rest_bad_request( transport: str = "rest", request_type=gcn_backup_policy.UpdateBackupPolicyRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30842,7 +30832,7 @@ def test_update_backup_policy_rest_bad_request( def test_update_backup_policy_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30887,7 +30877,7 @@ def test_update_backup_policy_rest_flattened(): def test_update_backup_policy_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -30903,7 +30893,7 @@ def test_update_backup_policy_rest_flattened_error(transport: str = "rest"): def test_update_backup_policy_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -30916,7 +30906,7 @@ def test_update_backup_policy_rest_error(): ) def test_delete_backup_policy_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -30962,7 +30952,7 @@ def test_delete_backup_policy_rest_required_fields( # verify fields with default values are dropped unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_backup_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -30971,7 +30961,7 @@ def test_delete_backup_policy_rest_required_fields( jsonified_request["name"] = "name_value" unset_fields = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ).delete_backup_policy._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) @@ -30980,7 +30970,7 @@ def test_delete_backup_policy_rest_required_fields( assert jsonified_request["name"] == "name_value" client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request = request_type(**request_init) @@ -31019,7 +31009,7 @@ def test_delete_backup_policy_rest_required_fields( def test_delete_backup_policy_rest_unset_required_fields(): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain + credentials=ga_credentials.AnonymousCredentials ) unset_fields = transport.delete_backup_policy._get_unset_required_fields({}) @@ -31029,7 +31019,7 @@ def test_delete_backup_policy_rest_unset_required_fields(): @pytest.mark.parametrize("null_interceptor", [True, False]) def test_delete_backup_policy_rest_interceptors(null_interceptor): transport = transports.NetAppRestTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.NetAppRestInterceptor(), ) client = NetAppClient(transport=transport) @@ -31087,7 +31077,7 @@ def test_delete_backup_policy_rest_bad_request( transport: str = "rest", request_type=backup_policy.DeleteBackupPolicyRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31109,7 +31099,7 @@ def test_delete_backup_policy_rest_bad_request( def test_delete_backup_policy_rest_flattened(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -31151,7 +31141,7 @@ def test_delete_backup_policy_rest_flattened(): def test_delete_backup_policy_rest_flattened_error(transport: str = "rest"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -31166,24 +31156,24 @@ def test_delete_backup_policy_rest_flattened_error(transport: str = "rest"): def test_delete_backup_policy_rest_error(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport="rest" + credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.NetAppGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.NetAppGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = NetAppClient( @@ -31193,7 +31183,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.NetAppGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -31208,13 +31198,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = NetAppClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.NetAppGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = NetAppClient( @@ -31226,7 +31215,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.NetAppGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = NetAppClient(transport=transport) assert client.transport is transport @@ -31235,13 +31224,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.NetAppGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.NetAppGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -31258,7 +31247,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -31272,7 +31261,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = NetAppClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -31280,7 +31269,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -31292,7 +31281,7 @@ def test_net_app_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.NetAppTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -31304,7 +31293,7 @@ def test_net_app_base_transport(): ) as Transport: Transport.return_value = None transport = transports.NetAppTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -31397,7 +31386,7 @@ def test_net_app_base_transport_with_credentials_file(): "google.cloud.netapp_v1.services.net_app.transports.NetAppTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.NetAppTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -31416,7 +31405,7 @@ def test_net_app_base_transport_with_adc(): "google.cloud.netapp_v1.services.net_app.transports.NetAppTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.NetAppTransport() adc.assert_called_once() @@ -31424,7 +31413,7 @@ def test_net_app_base_transport_with_adc(): def test_net_app_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) NetAppClient() adc.assert_called_once_with( scopes=None, @@ -31444,7 +31433,7 @@ def test_net_app_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -31491,7 +31480,7 @@ def test_net_app_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -31516,7 +31505,7 @@ def test_net_app_transport_create_channel(transport_class, grpc_helpers): [transports.NetAppGrpcTransport, transports.NetAppGrpcAsyncIOTransport], ) def test_net_app_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -31554,7 +31543,7 @@ def test_net_app_grpc_transport_client_cert_source_for_mtls(transport_class): def test_net_app_http_transport_client_cert_source_for_mtls(): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with mock.patch( "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" ) as mock_configure_mtls_channel: @@ -31566,7 +31555,7 @@ def test_net_app_http_transport_client_cert_source_for_mtls(): def test_net_app_rest_lro_client(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) transport = client.transport @@ -31591,7 +31580,7 @@ def test_net_app_rest_lro_client(): ) def test_net_app_host_no_port(transport_name): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="netapp.googleapis.com" ), @@ -31614,7 +31603,7 @@ def test_net_app_host_no_port(transport_name): ) def test_net_app_host_with_port(transport_name): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="netapp.googleapis.com:8000" ), @@ -31634,8 +31623,8 @@ def test_net_app_host_with_port(transport_name): ], ) def test_net_app_client_transport_session_collision(transport_name): - creds1 = _AnonymousCredentialsWithUniverseDomain() - creds2 = _AnonymousCredentialsWithUniverseDomain() + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() client1 = NetAppClient( credentials=creds1, transport=transport_name, @@ -31844,7 +31833,7 @@ def test_net_app_transport_channel_mtls_with_client_cert_source(transport_class) mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -31919,7 +31908,7 @@ def test_net_app_transport_channel_mtls_with_adc(transport_class): def test_net_app_grpc_lro_client(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -31936,7 +31925,7 @@ def test_net_app_grpc_lro_client(): def test_net_app_grpc_lro_async_client(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -32333,7 +32322,7 @@ def test_client_with_default_client_info(): transports.NetAppTransport, "_prep_wrapped_messages" ) as prep: client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -32343,7 +32332,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = NetAppClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -32352,7 +32341,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -32367,7 +32356,7 @@ def test_get_location_rest_bad_request( transport: str = "rest", request_type=locations_pb2.GetLocationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32397,7 +32386,7 @@ def test_get_location_rest_bad_request( ) def test_get_location_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -32425,7 +32414,7 @@ def test_list_locations_rest_bad_request( transport: str = "rest", request_type=locations_pb2.ListLocationsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32453,7 +32442,7 @@ def test_list_locations_rest_bad_request( ) def test_list_locations_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1"} @@ -32481,7 +32470,7 @@ def test_cancel_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.CancelOperationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32511,7 +32500,7 @@ def test_cancel_operation_rest_bad_request( ) def test_cancel_operation_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -32539,7 +32528,7 @@ def test_delete_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.DeleteOperationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32569,7 +32558,7 @@ def test_delete_operation_rest_bad_request( ) def test_delete_operation_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -32597,7 +32586,7 @@ def test_get_operation_rest_bad_request( transport: str = "rest", request_type=operations_pb2.GetOperationRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32627,7 +32616,7 @@ def test_get_operation_rest_bad_request( ) def test_get_operation_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} @@ -32655,7 +32644,7 @@ def test_list_operations_rest_bad_request( transport: str = "rest", request_type=operations_pb2.ListOperationsRequest ): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32685,7 +32674,7 @@ def test_list_operations_rest_bad_request( ) def test_list_operations_rest(request_type): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) request_init = {"name": "projects/sample1/locations/sample2"} @@ -32711,7 +32700,7 @@ def test_list_operations_rest(request_type): def test_delete_operation(transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32736,7 +32725,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32760,7 +32749,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32789,7 +32778,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32816,7 +32805,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -32834,7 +32823,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -32850,7 +32839,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32875,7 +32864,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -32899,7 +32888,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32928,7 +32917,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -32955,7 +32944,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -32973,7 +32962,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -32989,7 +32978,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33014,7 +33003,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33040,7 +33029,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -33069,7 +33058,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -33098,7 +33087,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -33116,7 +33105,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -33134,7 +33123,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33159,7 +33148,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33185,7 +33174,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -33214,7 +33203,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -33243,7 +33232,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -33261,7 +33250,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -33279,7 +33268,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33304,7 +33293,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33330,7 +33319,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -33359,7 +33348,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -33388,7 +33377,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -33406,7 +33395,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -33424,7 +33413,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33449,7 +33438,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -33474,7 +33463,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): - client = NetAppClient(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = NetAppClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -33501,7 +33490,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): - client = NetAppAsyncClient(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = NetAppAsyncClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -33529,7 +33518,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -33547,7 +33536,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = NetAppAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -33571,7 +33560,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -33588,7 +33577,7 @@ def test_client_ctx(): ] for transport in transports: client = NetAppClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity/gapic_version.py b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity/gapic_version.py index f903325e9892..360a0d13ebdd 100644 --- a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity/gapic_version.py +++ b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.4.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/gapic_version.py b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/gapic_version.py index f903325e9892..360a0d13ebdd 100644 --- a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/gapic_version.py +++ b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.4.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/hub_service/client.py b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/hub_service/client.py index 42320e970b41..c6df4755d399 100644 --- a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/hub_service/client.py +++ b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/hub_service/client.py @@ -566,6 +566,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -584,6 +585,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -658,17 +660,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = HubServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = HubServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/policy_based_routing_service/client.py b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/policy_based_routing_service/client.py index 6763f978923a..de7161c48e07 100644 --- a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/policy_based_routing_service/client.py +++ b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1/services/policy_based_routing_service/client.py @@ -411,6 +411,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -429,6 +430,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -505,17 +507,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = PolicyBasedRoutingServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = PolicyBasedRoutingServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/gapic_version.py b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/gapic_version.py index f903325e9892..360a0d13ebdd 100644 --- a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/gapic_version.py +++ b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.4.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/services/hub_service/client.py b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/services/hub_service/client.py index 4e3df27a4eba..9227b85c914d 100644 --- a/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/services/hub_service/client.py +++ b/packages/google-cloud-network-connectivity/google/cloud/networkconnectivity_v1alpha1/services/hub_service/client.py @@ -475,6 +475,7 @@ def _read_environment_variables(): ) return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + @staticmethod def _get_client_cert_source(provided_cert_source, use_cert_flag): """Return the client cert source to be used by the client. @@ -493,6 +494,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag): client_cert_source = mtls.default_client_cert_source() return client_cert_source + @staticmethod def _get_api_endpoint( api_override, client_cert_source, universe_domain, use_mtls_endpoint ): @@ -567,17 +569,18 @@ def _compare_universes( Raises: ValueError: when client_universe does not match the universe in credentials. """ - if credentials: - credentials_universe = credentials.universe_domain - if client_universe != credentials_universe: - default_universe = HubServiceClient._DEFAULT_UNIVERSE - raise ValueError( - "The configured universe domain " - f"({client_universe}) does not match the universe domain " - f"found in the credentials ({credentials_universe}). " - "If you haven't configured the universe domain explicitly, " - f"`{default_universe}` is the default." - ) + + default_universe = HubServiceClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) return True def _validate_universe_domain(self): diff --git a/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1.json b/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1.json index 8519677a78dc..62ba18e54b67 100644 --- a/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1.json +++ b/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-network-connectivity", - "version": "2.4.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json b/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json index 9c557df08384..7d9f482d0d17 100644 --- a/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json +++ b/packages/google-cloud-network-connectivity/samples/generated_samples/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-network-connectivity", - "version": "2.4.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-network-connectivity/setup.py b/packages/google-cloud-network-connectivity/setup.py index 02321a253839..703c5a37fc05 100644 --- a/packages/google-cloud-network-connectivity/setup.py +++ b/packages/google-cloud-network-connectivity/setup.py @@ -42,6 +42,7 @@ dependencies = [ "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.*", + "google-auth >= 2.14.1, <3.0.0dev", "proto-plus >= 1.22.3, <2.0.0dev", "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", "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", diff --git a/packages/google-cloud-network-connectivity/testing/constraints-3.7.txt b/packages/google-cloud-network-connectivity/testing/constraints-3.7.txt index 44ffd04543a8..712d45b4c5ea 100644 --- a/packages/google-cloud-network-connectivity/testing/constraints-3.7.txt +++ b/packages/google-cloud-network-connectivity/testing/constraints-3.7.txt @@ -5,6 +5,7 @@ # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.34.0 +google-auth==2.14.1 proto-plus==1.22.3 protobuf==3.19.5 grpc-google-iam-v1==0.12.4 diff --git a/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_hub_service.py b/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_hub_service.py index 18674c00825a..7ce65c89df34 100644 --- a/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_hub_service.py +++ b/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_hub_service.py @@ -91,18 +91,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -305,7 +293,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -332,42 +320,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -377,7 +372,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_hub_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -423,7 +418,7 @@ def test_hub_service_client_service_account_always_use_jwt( ], ) def test_hub_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -480,9 +475,7 @@ def test_hub_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(HubServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -873,20 +866,20 @@ def test_hub_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -898,13 +891,11 @@ def test_hub_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -920,8 +911,7 @@ def test_hub_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1060,8 +1050,8 @@ def test_hub_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1090,7 +1080,7 @@ def test_hub_service_client_create_channel_credentials_file( ) def test_list_hubs(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1122,7 +1112,7 @@ def test_list_hubs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1139,7 +1129,7 @@ async def test_list_hubs_async( transport: str = "grpc_asyncio", request_type=hub.ListHubsRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1176,7 +1166,7 @@ async def test_list_hubs_async_from_dict(): def test_list_hubs_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1206,7 +1196,7 @@ def test_list_hubs_field_headers(): @pytest.mark.asyncio async def test_list_hubs_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1237,7 +1227,7 @@ async def test_list_hubs_field_headers_async(): def test_list_hubs_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1261,7 +1251,7 @@ def test_list_hubs_flattened(): def test_list_hubs_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1276,7 +1266,7 @@ def test_list_hubs_flattened_error(): @pytest.mark.asyncio async def test_list_hubs_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1305,7 +1295,7 @@ async def test_list_hubs_flattened_async(): @pytest.mark.asyncio async def test_list_hubs_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1319,7 +1309,7 @@ async def test_list_hubs_flattened_error_async(): def test_list_hubs_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1369,7 +1359,7 @@ def test_list_hubs_pager(transport_name: str = "grpc"): def test_list_hubs_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1411,7 +1401,7 @@ def test_list_hubs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_hubs_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1461,7 +1451,7 @@ async def test_list_hubs_async_pager(): @pytest.mark.asyncio async def test_list_hubs_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1516,7 +1506,7 @@ async def test_list_hubs_async_pages(): ) def test_get_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1554,7 +1544,7 @@ def test_get_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1571,7 +1561,7 @@ async def test_get_hub_async( transport: str = "grpc_asyncio", request_type=hub.GetHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1614,7 +1604,7 @@ async def test_get_hub_async_from_dict(): def test_get_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1644,7 +1634,7 @@ def test_get_hub_field_headers(): @pytest.mark.asyncio async def test_get_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1673,7 +1663,7 @@ async def test_get_hub_field_headers_async(): def test_get_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1697,7 +1687,7 @@ def test_get_hub_flattened(): def test_get_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1712,7 +1702,7 @@ def test_get_hub_flattened_error(): @pytest.mark.asyncio async def test_get_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1739,7 +1729,7 @@ async def test_get_hub_flattened_async(): @pytest.mark.asyncio async def test_get_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1760,7 +1750,7 @@ async def test_get_hub_flattened_error_async(): ) def test_create_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1787,7 +1777,7 @@ def test_create_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1804,7 +1794,7 @@ async def test_create_hub_async( transport: str = "grpc_asyncio", request_type=gcn_hub.CreateHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1836,7 +1826,7 @@ async def test_create_hub_async_from_dict(): def test_create_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1866,7 +1856,7 @@ def test_create_hub_field_headers(): @pytest.mark.asyncio async def test_create_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1897,7 +1887,7 @@ async def test_create_hub_field_headers_async(): def test_create_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1929,7 +1919,7 @@ def test_create_hub_flattened(): def test_create_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1946,7 +1936,7 @@ def test_create_hub_flattened_error(): @pytest.mark.asyncio async def test_create_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1983,7 +1973,7 @@ async def test_create_hub_flattened_async(): @pytest.mark.asyncio async def test_create_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2006,7 +1996,7 @@ async def test_create_hub_flattened_error_async(): ) def test_update_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2033,7 +2023,7 @@ def test_update_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2050,7 +2040,7 @@ async def test_update_hub_async( transport: str = "grpc_asyncio", request_type=gcn_hub.UpdateHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2082,7 +2072,7 @@ async def test_update_hub_async_from_dict(): def test_update_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2112,7 +2102,7 @@ def test_update_hub_field_headers(): @pytest.mark.asyncio async def test_update_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2143,7 +2133,7 @@ async def test_update_hub_field_headers_async(): def test_update_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2171,7 +2161,7 @@ def test_update_hub_flattened(): def test_update_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2187,7 +2177,7 @@ def test_update_hub_flattened_error(): @pytest.mark.asyncio async def test_update_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2220,7 +2210,7 @@ async def test_update_hub_flattened_async(): @pytest.mark.asyncio async def test_update_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2242,7 +2232,7 @@ async def test_update_hub_flattened_error_async(): ) def test_delete_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2269,7 +2259,7 @@ def test_delete_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2286,7 +2276,7 @@ async def test_delete_hub_async( transport: str = "grpc_asyncio", request_type=hub.DeleteHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2318,7 +2308,7 @@ async def test_delete_hub_async_from_dict(): def test_delete_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2348,7 +2338,7 @@ def test_delete_hub_field_headers(): @pytest.mark.asyncio async def test_delete_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2379,7 +2369,7 @@ async def test_delete_hub_field_headers_async(): def test_delete_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2403,7 +2393,7 @@ def test_delete_hub_flattened(): def test_delete_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2418,7 +2408,7 @@ def test_delete_hub_flattened_error(): @pytest.mark.asyncio async def test_delete_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2447,7 +2437,7 @@ async def test_delete_hub_flattened_async(): @pytest.mark.asyncio async def test_delete_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2468,7 +2458,7 @@ async def test_delete_hub_flattened_error_async(): ) def test_list_hub_spokes(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2500,7 +2490,7 @@ def test_list_hub_spokes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2517,7 +2507,7 @@ async def test_list_hub_spokes_async( transport: str = "grpc_asyncio", request_type=hub.ListHubSpokesRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2554,7 +2544,7 @@ async def test_list_hub_spokes_async_from_dict(): def test_list_hub_spokes_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2584,7 +2574,7 @@ def test_list_hub_spokes_field_headers(): @pytest.mark.asyncio async def test_list_hub_spokes_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2615,7 +2605,7 @@ async def test_list_hub_spokes_field_headers_async(): def test_list_hub_spokes_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2639,7 +2629,7 @@ def test_list_hub_spokes_flattened(): def test_list_hub_spokes_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2654,7 +2644,7 @@ def test_list_hub_spokes_flattened_error(): @pytest.mark.asyncio async def test_list_hub_spokes_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2683,7 +2673,7 @@ async def test_list_hub_spokes_flattened_async(): @pytest.mark.asyncio async def test_list_hub_spokes_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2697,7 +2687,7 @@ async def test_list_hub_spokes_flattened_error_async(): def test_list_hub_spokes_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2747,7 +2737,7 @@ def test_list_hub_spokes_pager(transport_name: str = "grpc"): def test_list_hub_spokes_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2789,7 +2779,7 @@ def test_list_hub_spokes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_hub_spokes_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2839,7 +2829,7 @@ async def test_list_hub_spokes_async_pager(): @pytest.mark.asyncio async def test_list_hub_spokes_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2894,7 +2884,7 @@ async def test_list_hub_spokes_async_pages(): ) def test_list_spokes(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2926,7 +2916,7 @@ def test_list_spokes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2943,7 +2933,7 @@ async def test_list_spokes_async( transport: str = "grpc_asyncio", request_type=hub.ListSpokesRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2980,7 +2970,7 @@ async def test_list_spokes_async_from_dict(): def test_list_spokes_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3010,7 +3000,7 @@ def test_list_spokes_field_headers(): @pytest.mark.asyncio async def test_list_spokes_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3041,7 +3031,7 @@ async def test_list_spokes_field_headers_async(): def test_list_spokes_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3065,7 +3055,7 @@ def test_list_spokes_flattened(): def test_list_spokes_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3080,7 +3070,7 @@ def test_list_spokes_flattened_error(): @pytest.mark.asyncio async def test_list_spokes_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3109,7 +3099,7 @@ async def test_list_spokes_flattened_async(): @pytest.mark.asyncio async def test_list_spokes_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3123,7 +3113,7 @@ async def test_list_spokes_flattened_error_async(): def test_list_spokes_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3173,7 +3163,7 @@ def test_list_spokes_pager(transport_name: str = "grpc"): def test_list_spokes_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -3215,7 +3205,7 @@ def test_list_spokes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_spokes_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3265,7 +3255,7 @@ async def test_list_spokes_async_pager(): @pytest.mark.asyncio async def test_list_spokes_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3320,7 +3310,7 @@ async def test_list_spokes_async_pages(): ) def test_get_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3362,7 +3352,7 @@ def test_get_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3379,7 +3369,7 @@ async def test_get_spoke_async( transport: str = "grpc_asyncio", request_type=hub.GetSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3426,7 +3416,7 @@ async def test_get_spoke_async_from_dict(): def test_get_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3456,7 +3446,7 @@ def test_get_spoke_field_headers(): @pytest.mark.asyncio async def test_get_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3485,7 +3475,7 @@ async def test_get_spoke_field_headers_async(): def test_get_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3509,7 +3499,7 @@ def test_get_spoke_flattened(): def test_get_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3524,7 +3514,7 @@ def test_get_spoke_flattened_error(): @pytest.mark.asyncio async def test_get_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3551,7 +3541,7 @@ async def test_get_spoke_flattened_async(): @pytest.mark.asyncio async def test_get_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3572,7 +3562,7 @@ async def test_get_spoke_flattened_error_async(): ) def test_create_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3599,7 +3589,7 @@ def test_create_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3616,7 +3606,7 @@ async def test_create_spoke_async( transport: str = "grpc_asyncio", request_type=hub.CreateSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3648,7 +3638,7 @@ async def test_create_spoke_async_from_dict(): def test_create_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3678,7 +3668,7 @@ def test_create_spoke_field_headers(): @pytest.mark.asyncio async def test_create_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3709,7 +3699,7 @@ async def test_create_spoke_field_headers_async(): def test_create_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3741,7 +3731,7 @@ def test_create_spoke_flattened(): def test_create_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3758,7 +3748,7 @@ def test_create_spoke_flattened_error(): @pytest.mark.asyncio async def test_create_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3795,7 +3785,7 @@ async def test_create_spoke_flattened_async(): @pytest.mark.asyncio async def test_create_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3818,7 +3808,7 @@ async def test_create_spoke_flattened_error_async(): ) def test_update_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3845,7 +3835,7 @@ def test_update_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3862,7 +3852,7 @@ async def test_update_spoke_async( transport: str = "grpc_asyncio", request_type=hub.UpdateSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3894,7 +3884,7 @@ async def test_update_spoke_async_from_dict(): def test_update_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3924,7 +3914,7 @@ def test_update_spoke_field_headers(): @pytest.mark.asyncio async def test_update_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3955,7 +3945,7 @@ async def test_update_spoke_field_headers_async(): def test_update_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3983,7 +3973,7 @@ def test_update_spoke_flattened(): def test_update_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3999,7 +3989,7 @@ def test_update_spoke_flattened_error(): @pytest.mark.asyncio async def test_update_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4032,7 +4022,7 @@ async def test_update_spoke_flattened_async(): @pytest.mark.asyncio async def test_update_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4054,7 +4044,7 @@ async def test_update_spoke_flattened_error_async(): ) def test_reject_hub_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4081,7 +4071,7 @@ def test_reject_hub_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4098,7 +4088,7 @@ async def test_reject_hub_spoke_async( transport: str = "grpc_asyncio", request_type=hub.RejectHubSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4130,7 +4120,7 @@ async def test_reject_hub_spoke_async_from_dict(): def test_reject_hub_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4160,7 +4150,7 @@ def test_reject_hub_spoke_field_headers(): @pytest.mark.asyncio async def test_reject_hub_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4191,7 +4181,7 @@ async def test_reject_hub_spoke_field_headers_async(): def test_reject_hub_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4219,7 +4209,7 @@ def test_reject_hub_spoke_flattened(): def test_reject_hub_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4235,7 +4225,7 @@ def test_reject_hub_spoke_flattened_error(): @pytest.mark.asyncio async def test_reject_hub_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4268,7 +4258,7 @@ async def test_reject_hub_spoke_flattened_async(): @pytest.mark.asyncio async def test_reject_hub_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4290,7 +4280,7 @@ async def test_reject_hub_spoke_flattened_error_async(): ) def test_accept_hub_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4317,7 +4307,7 @@ def test_accept_hub_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4334,7 +4324,7 @@ async def test_accept_hub_spoke_async( transport: str = "grpc_asyncio", request_type=hub.AcceptHubSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4366,7 +4356,7 @@ async def test_accept_hub_spoke_async_from_dict(): def test_accept_hub_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4396,7 +4386,7 @@ def test_accept_hub_spoke_field_headers(): @pytest.mark.asyncio async def test_accept_hub_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4427,7 +4417,7 @@ async def test_accept_hub_spoke_field_headers_async(): def test_accept_hub_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4455,7 +4445,7 @@ def test_accept_hub_spoke_flattened(): def test_accept_hub_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4471,7 +4461,7 @@ def test_accept_hub_spoke_flattened_error(): @pytest.mark.asyncio async def test_accept_hub_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4504,7 +4494,7 @@ async def test_accept_hub_spoke_flattened_async(): @pytest.mark.asyncio async def test_accept_hub_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4526,7 +4516,7 @@ async def test_accept_hub_spoke_flattened_error_async(): ) def test_delete_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4553,7 +4543,7 @@ def test_delete_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4570,7 +4560,7 @@ async def test_delete_spoke_async( transport: str = "grpc_asyncio", request_type=hub.DeleteSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4602,7 +4592,7 @@ async def test_delete_spoke_async_from_dict(): def test_delete_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4632,7 +4622,7 @@ def test_delete_spoke_field_headers(): @pytest.mark.asyncio async def test_delete_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4663,7 +4653,7 @@ async def test_delete_spoke_field_headers_async(): def test_delete_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4687,7 +4677,7 @@ def test_delete_spoke_flattened(): def test_delete_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4702,7 +4692,7 @@ def test_delete_spoke_flattened_error(): @pytest.mark.asyncio async def test_delete_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4731,7 +4721,7 @@ async def test_delete_spoke_flattened_async(): @pytest.mark.asyncio async def test_delete_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4752,7 +4742,7 @@ async def test_delete_spoke_flattened_error_async(): ) def test_get_route_table(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4788,7 +4778,7 @@ def test_get_route_table_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4805,7 +4795,7 @@ async def test_get_route_table_async( transport: str = "grpc_asyncio", request_type=hub.GetRouteTableRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4846,7 +4836,7 @@ async def test_get_route_table_async_from_dict(): def test_get_route_table_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4876,7 +4866,7 @@ def test_get_route_table_field_headers(): @pytest.mark.asyncio async def test_get_route_table_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4905,7 +4895,7 @@ async def test_get_route_table_field_headers_async(): def test_get_route_table_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4929,7 +4919,7 @@ def test_get_route_table_flattened(): def test_get_route_table_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4944,7 +4934,7 @@ def test_get_route_table_flattened_error(): @pytest.mark.asyncio async def test_get_route_table_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4971,7 +4961,7 @@ async def test_get_route_table_flattened_async(): @pytest.mark.asyncio async def test_get_route_table_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -4992,7 +4982,7 @@ async def test_get_route_table_flattened_error_async(): ) def test_get_route(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5036,7 +5026,7 @@ def test_get_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5053,7 +5043,7 @@ async def test_get_route_async( transport: str = "grpc_asyncio", request_type=hub.GetRouteRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5102,7 +5092,7 @@ async def test_get_route_async_from_dict(): def test_get_route_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5132,7 +5122,7 @@ def test_get_route_field_headers(): @pytest.mark.asyncio async def test_get_route_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5161,7 +5151,7 @@ async def test_get_route_field_headers_async(): def test_get_route_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5185,7 +5175,7 @@ def test_get_route_flattened(): def test_get_route_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5200,7 +5190,7 @@ def test_get_route_flattened_error(): @pytest.mark.asyncio async def test_get_route_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5227,7 +5217,7 @@ async def test_get_route_flattened_async(): @pytest.mark.asyncio async def test_get_route_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5248,7 +5238,7 @@ async def test_get_route_flattened_error_async(): ) def test_list_routes(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5280,7 +5270,7 @@ def test_list_routes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5297,7 +5287,7 @@ async def test_list_routes_async( transport: str = "grpc_asyncio", request_type=hub.ListRoutesRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5334,7 +5324,7 @@ async def test_list_routes_async_from_dict(): def test_list_routes_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5364,7 +5354,7 @@ def test_list_routes_field_headers(): @pytest.mark.asyncio async def test_list_routes_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5395,7 +5385,7 @@ async def test_list_routes_field_headers_async(): def test_list_routes_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5419,7 +5409,7 @@ def test_list_routes_flattened(): def test_list_routes_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5434,7 +5424,7 @@ def test_list_routes_flattened_error(): @pytest.mark.asyncio async def test_list_routes_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5463,7 +5453,7 @@ async def test_list_routes_flattened_async(): @pytest.mark.asyncio async def test_list_routes_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5477,7 +5467,7 @@ async def test_list_routes_flattened_error_async(): def test_list_routes_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5527,7 +5517,7 @@ def test_list_routes_pager(transport_name: str = "grpc"): def test_list_routes_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5569,7 +5559,7 @@ def test_list_routes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_routes_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5619,7 +5609,7 @@ async def test_list_routes_async_pager(): @pytest.mark.asyncio async def test_list_routes_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5674,7 +5664,7 @@ async def test_list_routes_async_pages(): ) def test_list_route_tables(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5708,7 +5698,7 @@ def test_list_route_tables_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5727,7 +5717,7 @@ async def test_list_route_tables_async( transport: str = "grpc_asyncio", request_type=hub.ListRouteTablesRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5766,7 +5756,7 @@ async def test_list_route_tables_async_from_dict(): def test_list_route_tables_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5798,7 +5788,7 @@ def test_list_route_tables_field_headers(): @pytest.mark.asyncio async def test_list_route_tables_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -5831,7 +5821,7 @@ async def test_list_route_tables_field_headers_async(): def test_list_route_tables_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5857,7 +5847,7 @@ def test_list_route_tables_flattened(): def test_list_route_tables_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5872,7 +5862,7 @@ def test_list_route_tables_flattened_error(): @pytest.mark.asyncio async def test_list_route_tables_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5903,7 +5893,7 @@ async def test_list_route_tables_flattened_async(): @pytest.mark.asyncio async def test_list_route_tables_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -5917,7 +5907,7 @@ async def test_list_route_tables_flattened_error_async(): def test_list_route_tables_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -5969,7 +5959,7 @@ def test_list_route_tables_pager(transport_name: str = "grpc"): def test_list_route_tables_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -6013,7 +6003,7 @@ def test_list_route_tables_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_route_tables_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6065,7 +6055,7 @@ async def test_list_route_tables_async_pager(): @pytest.mark.asyncio async def test_list_route_tables_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6122,7 +6112,7 @@ async def test_list_route_tables_async_pages(): ) def test_get_group(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6158,7 +6148,7 @@ def test_get_group_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6175,7 +6165,7 @@ async def test_get_group_async( transport: str = "grpc_asyncio", request_type=hub.GetGroupRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6216,7 +6206,7 @@ async def test_get_group_async_from_dict(): def test_get_group_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6246,7 +6236,7 @@ def test_get_group_field_headers(): @pytest.mark.asyncio async def test_get_group_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6275,7 +6265,7 @@ async def test_get_group_field_headers_async(): def test_get_group_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6299,7 +6289,7 @@ def test_get_group_flattened(): def test_get_group_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6314,7 +6304,7 @@ def test_get_group_flattened_error(): @pytest.mark.asyncio async def test_get_group_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6341,7 +6331,7 @@ async def test_get_group_flattened_async(): @pytest.mark.asyncio async def test_get_group_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6362,7 +6352,7 @@ async def test_get_group_flattened_error_async(): ) def test_list_groups(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6394,7 +6384,7 @@ def test_list_groups_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6411,7 +6401,7 @@ async def test_list_groups_async( transport: str = "grpc_asyncio", request_type=hub.ListGroupsRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6448,7 +6438,7 @@ async def test_list_groups_async_from_dict(): def test_list_groups_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6478,7 +6468,7 @@ def test_list_groups_field_headers(): @pytest.mark.asyncio async def test_list_groups_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -6509,7 +6499,7 @@ async def test_list_groups_field_headers_async(): def test_list_groups_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6533,7 +6523,7 @@ def test_list_groups_flattened(): def test_list_groups_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6548,7 +6538,7 @@ def test_list_groups_flattened_error(): @pytest.mark.asyncio async def test_list_groups_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6577,7 +6567,7 @@ async def test_list_groups_flattened_async(): @pytest.mark.asyncio async def test_list_groups_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -6591,7 +6581,7 @@ async def test_list_groups_flattened_error_async(): def test_list_groups_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -6641,7 +6631,7 @@ def test_list_groups_pager(transport_name: str = "grpc"): def test_list_groups_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -6683,7 +6673,7 @@ def test_list_groups_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_groups_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6733,7 +6723,7 @@ async def test_list_groups_async_pager(): @pytest.mark.asyncio async def test_list_groups_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6782,17 +6772,17 @@ async def test_list_groups_async_pages(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = HubServiceClient( @@ -6802,7 +6792,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -6817,13 +6807,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = HubServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = HubServiceClient( @@ -6835,7 +6824,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = HubServiceClient(transport=transport) assert client.transport is transport @@ -6844,13 +6833,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.HubServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -6866,7 +6855,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -6879,7 +6868,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = HubServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -6887,7 +6876,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -6899,7 +6888,7 @@ def test_hub_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.HubServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -6911,7 +6900,7 @@ def test_hub_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.HubServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -6975,7 +6964,7 @@ def test_hub_service_base_transport_with_credentials_file(): "google.cloud.networkconnectivity_v1.services.hub_service.transports.HubServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.HubServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -6994,7 +6983,7 @@ def test_hub_service_base_transport_with_adc(): "google.cloud.networkconnectivity_v1.services.hub_service.transports.HubServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.HubServiceTransport() adc.assert_called_once() @@ -7002,7 +6991,7 @@ def test_hub_service_base_transport_with_adc(): def test_hub_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) HubServiceClient() adc.assert_called_once_with( scopes=None, @@ -7022,7 +7011,7 @@ def test_hub_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -7068,7 +7057,7 @@ def test_hub_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -7093,7 +7082,7 @@ def test_hub_service_transport_create_channel(transport_class, grpc_helpers): [transports.HubServiceGrpcTransport, transports.HubServiceGrpcAsyncIOTransport], ) def test_hub_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -7139,7 +7128,7 @@ def test_hub_service_grpc_transport_client_cert_source_for_mtls(transport_class) ) def test_hub_service_host_no_port(transport_name): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="networkconnectivity.googleapis.com" ), @@ -7157,7 +7146,7 @@ def test_hub_service_host_no_port(transport_name): ) def test_hub_service_host_with_port(transport_name): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="networkconnectivity.googleapis.com:8000" ), @@ -7211,7 +7200,7 @@ def test_hub_service_transport_channel_mtls_with_client_cert_source(transport_cl mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -7286,7 +7275,7 @@ def test_hub_service_transport_channel_mtls_with_adc(transport_class): def test_hub_service_grpc_lro_client(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -7303,7 +7292,7 @@ def test_hub_service_grpc_lro_client(): def test_hub_service_grpc_lro_async_client(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -7659,7 +7648,7 @@ def test_client_with_default_client_info(): transports.HubServiceTransport, "_prep_wrapped_messages" ) as prep: client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7669,7 +7658,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = HubServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7678,7 +7667,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -7691,7 +7680,7 @@ async def test_transport_close_async(): def test_delete_operation(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7716,7 +7705,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7740,7 +7729,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7769,7 +7758,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7796,7 +7785,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7814,7 +7803,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -7830,7 +7819,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7855,7 +7844,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7879,7 +7868,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7908,7 +7897,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -7935,7 +7924,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7953,7 +7942,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -7969,7 +7958,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7994,7 +7983,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8020,7 +8009,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8049,7 +8038,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8078,7 +8067,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -8096,7 +8085,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -8114,7 +8103,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8139,7 +8128,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8165,7 +8154,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8194,7 +8183,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8223,7 +8212,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -8241,7 +8230,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -8259,7 +8248,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8284,7 +8273,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8310,7 +8299,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8339,7 +8328,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8368,7 +8357,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8386,7 +8375,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8404,7 +8393,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8429,7 +8418,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8454,7 +8443,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): - client = HubServiceClient(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = HubServiceClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -8481,9 +8470,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): - client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + client = HubServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials()) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -8511,7 +8498,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8529,7 +8516,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -8547,7 +8534,7 @@ async def test_get_location_from_dict_async(): def test_set_iam_policy(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8580,7 +8567,7 @@ def test_set_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8615,7 +8602,7 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8645,7 +8632,7 @@ def test_set_iam_policy_field_headers(): @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8674,7 +8661,7 @@ async def test_set_iam_policy_field_headers_async(): def test_set_iam_policy_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -8693,7 +8680,7 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -8711,7 +8698,7 @@ async def test_set_iam_policy_from_dict_async(): def test_get_iam_policy(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8746,7 +8733,7 @@ def test_get_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8782,7 +8769,7 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8812,7 +8799,7 @@ def test_get_iam_policy_field_headers(): @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8841,7 +8828,7 @@ async def test_get_iam_policy_field_headers_async(): def test_get_iam_policy_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -8860,7 +8847,7 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -8878,7 +8865,7 @@ async def test_get_iam_policy_from_dict_async(): def test_test_iam_permissions(transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8912,7 +8899,7 @@ def test_test_iam_permissions(transport: str = "grpc"): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8947,7 +8934,7 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -8979,7 +8966,7 @@ def test_test_iam_permissions_field_headers(): @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -9012,7 +8999,7 @@ async def test_test_iam_permissions_field_headers_async(): def test_test_iam_permissions_from_dict(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9033,7 +9020,7 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_from_dict_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -9060,7 +9047,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -9076,7 +9063,7 @@ def test_client_ctx(): ] for transport in transports: client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_policy_based_routing_service.py b/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_policy_based_routing_service.py index a33409250a25..9541b31869d7 100644 --- a/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_policy_based_routing_service.py +++ b/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1/test_policy_based_routing_service.py @@ -88,18 +88,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -350,7 +338,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -377,42 +365,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -424,7 +419,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name def test_policy_based_routing_service_client_from_service_account_info( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -472,7 +467,7 @@ def test_policy_based_routing_service_client_service_account_always_use_jwt( def test_policy_based_routing_service_client_from_service_account_file( client_class, transport_name ): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -535,9 +530,7 @@ def test_policy_based_routing_service_client_client_options( with mock.patch.object( PolicyBasedRoutingServiceClient, "get_transport_class" ) as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -952,20 +945,20 @@ def test_policy_based_routing_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -977,13 +970,11 @@ def test_policy_based_routing_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -999,8 +990,7 @@ def test_policy_based_routing_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1155,8 +1145,8 @@ def test_policy_based_routing_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1185,7 +1175,7 @@ def test_policy_based_routing_service_client_create_channel_credentials_file( ) def test_list_policy_based_routes(request_type, transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1219,7 +1209,7 @@ def test_list_policy_based_routes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1239,7 +1229,7 @@ async def test_list_policy_based_routes_async( request_type=policy_based_routing.ListPolicyBasedRoutesRequest, ): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1278,7 +1268,7 @@ async def test_list_policy_based_routes_async_from_dict(): def test_list_policy_based_routes_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1310,7 +1300,7 @@ def test_list_policy_based_routes_field_headers(): @pytest.mark.asyncio async def test_list_policy_based_routes_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1343,7 +1333,7 @@ async def test_list_policy_based_routes_field_headers_async(): def test_list_policy_based_routes_flattened(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1369,7 +1359,7 @@ def test_list_policy_based_routes_flattened(): def test_list_policy_based_routes_flattened_error(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1384,7 +1374,7 @@ def test_list_policy_based_routes_flattened_error(): @pytest.mark.asyncio async def test_list_policy_based_routes_flattened_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1415,7 +1405,7 @@ async def test_list_policy_based_routes_flattened_async(): @pytest.mark.asyncio async def test_list_policy_based_routes_flattened_error_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1429,7 +1419,7 @@ async def test_list_policy_based_routes_flattened_error_async(): def test_list_policy_based_routes_pager(transport_name: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1483,7 +1473,7 @@ def test_list_policy_based_routes_pager(transport_name: str = "grpc"): def test_list_policy_based_routes_pages(transport_name: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1527,7 +1517,7 @@ def test_list_policy_based_routes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_policy_based_routes_async_pager(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1581,7 +1571,7 @@ async def test_list_policy_based_routes_async_pager(): @pytest.mark.asyncio async def test_list_policy_based_routes_async_pages(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1638,7 +1628,7 @@ async def test_list_policy_based_routes_async_pages(): ) def test_get_policy_based_route(request_type, transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1681,7 +1671,7 @@ def test_get_policy_based_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1701,7 +1691,7 @@ async def test_get_policy_based_route_async( request_type=policy_based_routing.GetPolicyBasedRouteRequest, ): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1748,7 +1738,7 @@ async def test_get_policy_based_route_async_from_dict(): def test_get_policy_based_route_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1780,7 +1770,7 @@ def test_get_policy_based_route_field_headers(): @pytest.mark.asyncio async def test_get_policy_based_route_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1813,7 +1803,7 @@ async def test_get_policy_based_route_field_headers_async(): def test_get_policy_based_route_flattened(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1839,7 +1829,7 @@ def test_get_policy_based_route_flattened(): def test_get_policy_based_route_flattened_error(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1854,7 +1844,7 @@ def test_get_policy_based_route_flattened_error(): @pytest.mark.asyncio async def test_get_policy_based_route_flattened_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1885,7 +1875,7 @@ async def test_get_policy_based_route_flattened_async(): @pytest.mark.asyncio async def test_get_policy_based_route_flattened_error_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1906,7 +1896,7 @@ async def test_get_policy_based_route_flattened_error_async(): ) def test_create_policy_based_route(request_type, transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1935,7 +1925,7 @@ def test_create_policy_based_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1955,7 +1945,7 @@ async def test_create_policy_based_route_async( request_type=policy_based_routing.CreatePolicyBasedRouteRequest, ): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1989,7 +1979,7 @@ async def test_create_policy_based_route_async_from_dict(): def test_create_policy_based_route_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2021,7 +2011,7 @@ def test_create_policy_based_route_field_headers(): @pytest.mark.asyncio async def test_create_policy_based_route_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2054,7 +2044,7 @@ async def test_create_policy_based_route_field_headers_async(): def test_create_policy_based_route_flattened(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2096,7 +2086,7 @@ def test_create_policy_based_route_flattened(): def test_create_policy_based_route_flattened_error(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2117,7 +2107,7 @@ def test_create_policy_based_route_flattened_error(): @pytest.mark.asyncio async def test_create_policy_based_route_flattened_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2164,7 +2154,7 @@ async def test_create_policy_based_route_flattened_async(): @pytest.mark.asyncio async def test_create_policy_based_route_flattened_error_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2191,7 +2181,7 @@ async def test_create_policy_based_route_flattened_error_async(): ) def test_delete_policy_based_route(request_type, transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2220,7 +2210,7 @@ def test_delete_policy_based_route_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2240,7 +2230,7 @@ async def test_delete_policy_based_route_async( request_type=policy_based_routing.DeletePolicyBasedRouteRequest, ): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2274,7 +2264,7 @@ async def test_delete_policy_based_route_async_from_dict(): def test_delete_policy_based_route_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2306,7 +2296,7 @@ def test_delete_policy_based_route_field_headers(): @pytest.mark.asyncio async def test_delete_policy_based_route_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2339,7 +2329,7 @@ async def test_delete_policy_based_route_field_headers_async(): def test_delete_policy_based_route_flattened(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2365,7 +2355,7 @@ def test_delete_policy_based_route_flattened(): def test_delete_policy_based_route_flattened_error(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2380,7 +2370,7 @@ def test_delete_policy_based_route_flattened_error(): @pytest.mark.asyncio async def test_delete_policy_based_route_flattened_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2411,7 +2401,7 @@ async def test_delete_policy_based_route_flattened_async(): @pytest.mark.asyncio async def test_delete_policy_based_route_flattened_error_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2426,17 +2416,17 @@ async def test_delete_policy_based_route_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.PolicyBasedRoutingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.PolicyBasedRoutingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PolicyBasedRoutingServiceClient( @@ -2446,7 +2436,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.PolicyBasedRoutingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -2461,13 +2451,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = PolicyBasedRoutingServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.PolicyBasedRoutingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = PolicyBasedRoutingServiceClient( @@ -2479,7 +2468,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.PolicyBasedRoutingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = PolicyBasedRoutingServiceClient(transport=transport) assert client.transport is transport @@ -2488,13 +2477,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.PolicyBasedRoutingServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.PolicyBasedRoutingServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -2510,7 +2499,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -2523,7 +2512,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = PolicyBasedRoutingServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -2531,7 +2520,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -2543,7 +2532,7 @@ def test_policy_based_routing_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.PolicyBasedRoutingServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -2555,7 +2544,7 @@ def test_policy_based_routing_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.PolicyBasedRoutingServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -2604,7 +2593,7 @@ def test_policy_based_routing_service_base_transport_with_credentials_file(): "google.cloud.networkconnectivity_v1.services.policy_based_routing_service.transports.PolicyBasedRoutingServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.PolicyBasedRoutingServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -2623,7 +2612,7 @@ def test_policy_based_routing_service_base_transport_with_adc(): "google.cloud.networkconnectivity_v1.services.policy_based_routing_service.transports.PolicyBasedRoutingServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.PolicyBasedRoutingServiceTransport() adc.assert_called_once() @@ -2631,7 +2620,7 @@ def test_policy_based_routing_service_base_transport_with_adc(): def test_policy_based_routing_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) PolicyBasedRoutingServiceClient() adc.assert_called_once_with( scopes=None, @@ -2651,7 +2640,7 @@ def test_policy_based_routing_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -2699,7 +2688,7 @@ def test_policy_based_routing_service_transport_create_channel( ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -2729,7 +2718,7 @@ def test_policy_based_routing_service_transport_create_channel( def test_policy_based_routing_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -2775,7 +2764,7 @@ def test_policy_based_routing_service_grpc_transport_client_cert_source_for_mtls ) def test_policy_based_routing_service_host_no_port(transport_name): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="networkconnectivity.googleapis.com" ), @@ -2793,7 +2782,7 @@ def test_policy_based_routing_service_host_no_port(transport_name): ) def test_policy_based_routing_service_host_with_port(transport_name): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="networkconnectivity.googleapis.com:8000" ), @@ -2852,7 +2841,7 @@ def test_policy_based_routing_service_transport_channel_mtls_with_client_cert_so mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -2930,7 +2919,7 @@ def test_policy_based_routing_service_transport_channel_mtls_with_adc(transport_ def test_policy_based_routing_service_grpc_lro_client(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -2947,7 +2936,7 @@ def test_policy_based_routing_service_grpc_lro_client(): def test_policy_based_routing_service_grpc_lro_async_client(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -3122,7 +3111,7 @@ def test_client_with_default_client_info(): transports.PolicyBasedRoutingServiceTransport, "_prep_wrapped_messages" ) as prep: client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3132,7 +3121,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = PolicyBasedRoutingServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -3141,7 +3130,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -3154,7 +3143,7 @@ async def test_transport_close_async(): def test_delete_operation(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3179,7 +3168,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3203,7 +3192,7 @@ async def test_delete_operation_async(transport: str = "grpc_asyncio"): def test_delete_operation_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3232,7 +3221,7 @@ def test_delete_operation_field_headers(): @pytest.mark.asyncio async def test_delete_operation_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3259,7 +3248,7 @@ async def test_delete_operation_field_headers_async(): def test_delete_operation_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -3277,7 +3266,7 @@ def test_delete_operation_from_dict(): @pytest.mark.asyncio async def test_delete_operation_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: @@ -3293,7 +3282,7 @@ async def test_delete_operation_from_dict_async(): def test_cancel_operation(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3318,7 +3307,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3342,7 +3331,7 @@ async def test_cancel_operation_async(transport: str = "grpc_asyncio"): def test_cancel_operation_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3371,7 +3360,7 @@ def test_cancel_operation_field_headers(): @pytest.mark.asyncio async def test_cancel_operation_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3398,7 +3387,7 @@ async def test_cancel_operation_field_headers_async(): def test_cancel_operation_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -3416,7 +3405,7 @@ def test_cancel_operation_from_dict(): @pytest.mark.asyncio async def test_cancel_operation_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: @@ -3432,7 +3421,7 @@ async def test_cancel_operation_from_dict_async(): def test_get_operation(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3457,7 +3446,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_operation_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3483,7 +3472,7 @@ async def test_get_operation_async(transport: str = "grpc_asyncio"): def test_get_operation_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3512,7 +3501,7 @@ def test_get_operation_field_headers(): @pytest.mark.asyncio async def test_get_operation_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3541,7 +3530,7 @@ async def test_get_operation_field_headers_async(): def test_get_operation_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -3559,7 +3548,7 @@ def test_get_operation_from_dict(): @pytest.mark.asyncio async def test_get_operation_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_operation), "__call__") as call: @@ -3577,7 +3566,7 @@ async def test_get_operation_from_dict_async(): def test_list_operations(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3602,7 +3591,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_operations_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3628,7 +3617,7 @@ async def test_list_operations_async(transport: str = "grpc_asyncio"): def test_list_operations_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3657,7 +3646,7 @@ def test_list_operations_field_headers(): @pytest.mark.asyncio async def test_list_operations_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3686,7 +3675,7 @@ async def test_list_operations_field_headers_async(): def test_list_operations_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -3704,7 +3693,7 @@ def test_list_operations_from_dict(): @pytest.mark.asyncio async def test_list_operations_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_operations), "__call__") as call: @@ -3722,7 +3711,7 @@ async def test_list_operations_from_dict_async(): def test_list_locations(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3747,7 +3736,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio async def test_list_locations_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3773,7 +3762,7 @@ async def test_list_locations_async(transport: str = "grpc_asyncio"): def test_list_locations_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3802,7 +3791,7 @@ def test_list_locations_field_headers(): @pytest.mark.asyncio async def test_list_locations_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3831,7 +3820,7 @@ async def test_list_locations_field_headers_async(): def test_list_locations_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3849,7 +3838,7 @@ def test_list_locations_from_dict(): @pytest.mark.asyncio async def test_list_locations_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3867,7 +3856,7 @@ async def test_list_locations_from_dict_async(): def test_get_location(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3892,7 +3881,7 @@ def test_get_location(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_location_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3918,7 +3907,7 @@ async def test_get_location_async(transport: str = "grpc_asyncio"): def test_get_location_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3947,7 +3936,7 @@ def test_get_location_field_headers(): @pytest.mark.asyncio async def test_get_location_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain() + credentials=ga_credentials.AnonymousCredentials() ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3976,7 +3965,7 @@ async def test_get_location_field_headers_async(): def test_get_location_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -3994,7 +3983,7 @@ def test_get_location_from_dict(): @pytest.mark.asyncio async def test_get_location_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_locations), "__call__") as call: @@ -4012,7 +4001,7 @@ async def test_get_location_from_dict_async(): def test_set_iam_policy(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4045,7 +4034,7 @@ def test_set_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4080,7 +4069,7 @@ async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): def test_set_iam_policy_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4110,7 +4099,7 @@ def test_set_iam_policy_field_headers(): @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4139,7 +4128,7 @@ async def test_set_iam_policy_field_headers_async(): def test_set_iam_policy_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -4158,7 +4147,7 @@ def test_set_iam_policy_from_dict(): @pytest.mark.asyncio async def test_set_iam_policy_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -4176,7 +4165,7 @@ async def test_set_iam_policy_from_dict_async(): def test_get_iam_policy(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4211,7 +4200,7 @@ def test_get_iam_policy(transport: str = "grpc"): @pytest.mark.asyncio async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4247,7 +4236,7 @@ async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): def test_get_iam_policy_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4277,7 +4266,7 @@ def test_get_iam_policy_field_headers(): @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4306,7 +4295,7 @@ async def test_get_iam_policy_field_headers_async(): def test_get_iam_policy_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -4325,7 +4314,7 @@ def test_get_iam_policy_from_dict(): @pytest.mark.asyncio async def test_get_iam_policy_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -4343,7 +4332,7 @@ async def test_get_iam_policy_from_dict_async(): def test_test_iam_permissions(transport: str = "grpc"): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4377,7 +4366,7 @@ def test_test_iam_permissions(transport: str = "grpc"): @pytest.mark.asyncio async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4412,7 +4401,7 @@ async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): def test_test_iam_permissions_field_headers(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4444,7 +4433,7 @@ def test_test_iam_permissions_field_headers(): @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -4477,7 +4466,7 @@ async def test_test_iam_permissions_field_headers_async(): def test_test_iam_permissions_from_dict(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4498,7 +4487,7 @@ def test_test_iam_permissions_from_dict(): @pytest.mark.asyncio async def test_test_iam_permissions_from_dict_async(): client = PolicyBasedRoutingServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4525,7 +4514,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4541,7 +4530,7 @@ def test_client_ctx(): ] for transport in transports: client = PolicyBasedRoutingServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: diff --git a/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1alpha1/test_hub_service.py b/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1alpha1/test_hub_service.py index e619f325c302..92e2474ca65b 100644 --- a/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1alpha1/test_hub_service.py +++ b/packages/google-cloud-network-connectivity/tests/unit/gapic/networkconnectivity_v1alpha1/test_hub_service.py @@ -87,18 +87,6 @@ def modify_default_endpoint_template(client): ) -# Anonymous Credentials with universe domain property. If no universe domain is provided, then -# the default universe domain is "googleapis.com". -class _AnonymousCredentialsWithUniverseDomain(ga_credentials.AnonymousCredentials): - def __init__(self, universe_domain="googleapis.com"): - super(_AnonymousCredentialsWithUniverseDomain, self).__init__() - self._universe_domain = universe_domain - - @property - def universe_domain(self): - return self._universe_domain - - def test__get_default_mtls_endpoint(): api_endpoint = "example.googleapis.com" api_mtls_endpoint = "example.mtls.googleapis.com" @@ -301,7 +289,7 @@ def test__get_universe_domain(): ) def test__validate_universe_domain(client_class, transport_class, transport_name): client = client_class( - transport=transport_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) ) assert client._validate_universe_domain() == True @@ -328,42 +316,49 @@ def test__validate_universe_domain(client_class, transport_class, transport_name client = client_class(transport=transport) assert client._validate_universe_domain() == True - # Test the case when there is a universe mismatch from the credentials. - client = client_class( - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain( - universe_domain="foo.com" - ) - ) - ) - with pytest.raises(ValueError) as excinfo: - client._validate_universe_domain() - assert ( - str(excinfo.value) - == "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." - ) - - # Test the case when there is a universe mismatch from the client. - # - # TODO: Make this test unconditional once the minimum supported version of - # google-api-core becomes 2.15.0 or higher. - api_core_major, api_core_minor, _ = [ - int(part) for part in api_core_version.__version__.split(".") + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor, _ = [ + int(part) for part in google.auth.__version__.split(".") ] - if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): - client = client_class( - client_options={"universe_domain": "bar.com"}, - transport=transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), - ), - ) + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) with pytest.raises(ValueError) as excinfo: client._validate_universe_domain() assert ( str(excinfo.value) - == "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." + == "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." ) + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor, _ = [ + int(part) for part in api_core_version.__version__.split(".") + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "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." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + @pytest.mark.parametrize( "client_class,transport_name", @@ -373,7 +368,7 @@ def test__validate_universe_domain(client_class, transport_class, transport_name ], ) def test_hub_service_client_from_service_account_info(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -419,7 +414,7 @@ def test_hub_service_client_service_account_always_use_jwt( ], ) def test_hub_service_client_from_service_account_file(client_class, transport_name): - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -476,9 +471,7 @@ def test_hub_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(HubServiceClient, "get_transport_class") as gtc: - transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain() - ) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -869,20 +862,20 @@ def test_hub_service_client_client_api_endpoint(client_class): ) client = client_class( client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert client.api_endpoint == api_override # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == default_endpoint # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - client = client_class(credentials=_AnonymousCredentialsWithUniverseDomain()) + client = client_class(credentials=ga_credentials.AnonymousCredentials()) assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), @@ -894,13 +887,11 @@ def test_hub_service_client_client_api_endpoint(client_class): if universe_exists: options = client_options.ClientOptions(universe_domain=mock_universe) client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) else: client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == ( mock_endpoint if universe_exists else default_endpoint @@ -916,8 +907,7 @@ def test_hub_service_client_client_api_endpoint(client_class): delattr(options, "universe_domain") with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): client = client_class( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) assert client.api_endpoint == default_endpoint @@ -1056,8 +1046,8 @@ def test_hub_service_client_create_channel_credentials_file( ) as adc, mock.patch.object( grpc_helpers, "create_channel" ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() - file_creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() load_creds.return_value = (file_creds, None) adc.return_value = (creds, None) client = client_class(client_options=options, transport=transport_name) @@ -1086,7 +1076,7 @@ def test_hub_service_client_create_channel_credentials_file( ) def test_list_hubs(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1118,7 +1108,7 @@ def test_list_hubs_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1135,7 +1125,7 @@ async def test_list_hubs_async( transport: str = "grpc_asyncio", request_type=hub.ListHubsRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1172,7 +1162,7 @@ async def test_list_hubs_async_from_dict(): def test_list_hubs_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1202,7 +1192,7 @@ def test_list_hubs_field_headers(): @pytest.mark.asyncio async def test_list_hubs_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1233,7 +1223,7 @@ async def test_list_hubs_field_headers_async(): def test_list_hubs_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1257,7 +1247,7 @@ def test_list_hubs_flattened(): def test_list_hubs_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1272,7 +1262,7 @@ def test_list_hubs_flattened_error(): @pytest.mark.asyncio async def test_list_hubs_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1301,7 +1291,7 @@ async def test_list_hubs_flattened_async(): @pytest.mark.asyncio async def test_list_hubs_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1315,7 +1305,7 @@ async def test_list_hubs_flattened_error_async(): def test_list_hubs_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1365,7 +1355,7 @@ def test_list_hubs_pager(transport_name: str = "grpc"): def test_list_hubs_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -1407,7 +1397,7 @@ def test_list_hubs_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_hubs_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1457,7 +1447,7 @@ async def test_list_hubs_async_pager(): @pytest.mark.asyncio async def test_list_hubs_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1512,7 +1502,7 @@ async def test_list_hubs_async_pages(): ) def test_get_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1550,7 +1540,7 @@ def test_get_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1567,7 +1557,7 @@ async def test_get_hub_async( transport: str = "grpc_asyncio", request_type=hub.GetHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1610,7 +1600,7 @@ async def test_get_hub_async_from_dict(): def test_get_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1640,7 +1630,7 @@ def test_get_hub_field_headers(): @pytest.mark.asyncio async def test_get_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1669,7 +1659,7 @@ async def test_get_hub_field_headers_async(): def test_get_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1693,7 +1683,7 @@ def test_get_hub_flattened(): def test_get_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1708,7 +1698,7 @@ def test_get_hub_flattened_error(): @pytest.mark.asyncio async def test_get_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1735,7 +1725,7 @@ async def test_get_hub_flattened_async(): @pytest.mark.asyncio async def test_get_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1756,7 +1746,7 @@ async def test_get_hub_flattened_error_async(): ) def test_create_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1783,7 +1773,7 @@ def test_create_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1800,7 +1790,7 @@ async def test_create_hub_async( transport: str = "grpc_asyncio", request_type=gcn_hub.CreateHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1832,7 +1822,7 @@ async def test_create_hub_async_from_dict(): def test_create_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1862,7 +1852,7 @@ def test_create_hub_field_headers(): @pytest.mark.asyncio async def test_create_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -1893,7 +1883,7 @@ async def test_create_hub_field_headers_async(): def test_create_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1925,7 +1915,7 @@ def test_create_hub_flattened(): def test_create_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1942,7 +1932,7 @@ def test_create_hub_flattened_error(): @pytest.mark.asyncio async def test_create_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1979,7 +1969,7 @@ async def test_create_hub_flattened_async(): @pytest.mark.asyncio async def test_create_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2002,7 +1992,7 @@ async def test_create_hub_flattened_error_async(): ) def test_update_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2029,7 +2019,7 @@ def test_update_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2046,7 +2036,7 @@ async def test_update_hub_async( transport: str = "grpc_asyncio", request_type=gcn_hub.UpdateHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2078,7 +2068,7 @@ async def test_update_hub_async_from_dict(): def test_update_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2108,7 +2098,7 @@ def test_update_hub_field_headers(): @pytest.mark.asyncio async def test_update_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2139,7 +2129,7 @@ async def test_update_hub_field_headers_async(): def test_update_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2167,7 +2157,7 @@ def test_update_hub_flattened(): def test_update_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2183,7 +2173,7 @@ def test_update_hub_flattened_error(): @pytest.mark.asyncio async def test_update_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2216,7 +2206,7 @@ async def test_update_hub_flattened_async(): @pytest.mark.asyncio async def test_update_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2238,7 +2228,7 @@ async def test_update_hub_flattened_error_async(): ) def test_delete_hub(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2265,7 +2255,7 @@ def test_delete_hub_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2282,7 +2272,7 @@ async def test_delete_hub_async( transport: str = "grpc_asyncio", request_type=hub.DeleteHubRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2314,7 +2304,7 @@ async def test_delete_hub_async_from_dict(): def test_delete_hub_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2344,7 +2334,7 @@ def test_delete_hub_field_headers(): @pytest.mark.asyncio async def test_delete_hub_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2375,7 +2365,7 @@ async def test_delete_hub_field_headers_async(): def test_delete_hub_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2399,7 +2389,7 @@ def test_delete_hub_flattened(): def test_delete_hub_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2414,7 +2404,7 @@ def test_delete_hub_flattened_error(): @pytest.mark.asyncio async def test_delete_hub_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2443,7 +2433,7 @@ async def test_delete_hub_flattened_async(): @pytest.mark.asyncio async def test_delete_hub_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2464,7 +2454,7 @@ async def test_delete_hub_flattened_error_async(): ) def test_list_spokes(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2496,7 +2486,7 @@ def test_list_spokes_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2513,7 +2503,7 @@ async def test_list_spokes_async( transport: str = "grpc_asyncio", request_type=hub.ListSpokesRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2550,7 +2540,7 @@ async def test_list_spokes_async_from_dict(): def test_list_spokes_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2580,7 +2570,7 @@ def test_list_spokes_field_headers(): @pytest.mark.asyncio async def test_list_spokes_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -2611,7 +2601,7 @@ async def test_list_spokes_field_headers_async(): def test_list_spokes_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2635,7 +2625,7 @@ def test_list_spokes_flattened(): def test_list_spokes_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2650,7 +2640,7 @@ def test_list_spokes_flattened_error(): @pytest.mark.asyncio async def test_list_spokes_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2679,7 +2669,7 @@ async def test_list_spokes_flattened_async(): @pytest.mark.asyncio async def test_list_spokes_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -2693,7 +2683,7 @@ async def test_list_spokes_flattened_error_async(): def test_list_spokes_pager(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2743,7 +2733,7 @@ def test_list_spokes_pager(transport_name: str = "grpc"): def test_list_spokes_pages(transport_name: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2785,7 +2775,7 @@ def test_list_spokes_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_spokes_async_pager(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2835,7 +2825,7 @@ async def test_list_spokes_async_pager(): @pytest.mark.asyncio async def test_list_spokes_async_pages(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2890,7 +2880,7 @@ async def test_list_spokes_async_pages(): ) def test_get_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2934,7 +2924,7 @@ def test_get_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2951,7 +2941,7 @@ async def test_get_spoke_async( transport: str = "grpc_asyncio", request_type=hub.GetSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3002,7 +2992,7 @@ async def test_get_spoke_async_from_dict(): def test_get_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3032,7 +3022,7 @@ def test_get_spoke_field_headers(): @pytest.mark.asyncio async def test_get_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3061,7 +3051,7 @@ async def test_get_spoke_field_headers_async(): def test_get_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3085,7 +3075,7 @@ def test_get_spoke_flattened(): def test_get_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3100,7 +3090,7 @@ def test_get_spoke_flattened_error(): @pytest.mark.asyncio async def test_get_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3127,7 +3117,7 @@ async def test_get_spoke_flattened_async(): @pytest.mark.asyncio async def test_get_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3148,7 +3138,7 @@ async def test_get_spoke_flattened_error_async(): ) def test_create_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3175,7 +3165,7 @@ def test_create_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3192,7 +3182,7 @@ async def test_create_spoke_async( transport: str = "grpc_asyncio", request_type=hub.CreateSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3224,7 +3214,7 @@ async def test_create_spoke_async_from_dict(): def test_create_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3254,7 +3244,7 @@ def test_create_spoke_field_headers(): @pytest.mark.asyncio async def test_create_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3285,7 +3275,7 @@ async def test_create_spoke_field_headers_async(): def test_create_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3317,7 +3307,7 @@ def test_create_spoke_flattened(): def test_create_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3334,7 +3324,7 @@ def test_create_spoke_flattened_error(): @pytest.mark.asyncio async def test_create_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3371,7 +3361,7 @@ async def test_create_spoke_flattened_async(): @pytest.mark.asyncio async def test_create_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3394,7 +3384,7 @@ async def test_create_spoke_flattened_error_async(): ) def test_update_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3421,7 +3411,7 @@ def test_update_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3438,7 +3428,7 @@ async def test_update_spoke_async( transport: str = "grpc_asyncio", request_type=hub.UpdateSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3470,7 +3460,7 @@ async def test_update_spoke_async_from_dict(): def test_update_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3500,7 +3490,7 @@ def test_update_spoke_field_headers(): @pytest.mark.asyncio async def test_update_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3531,7 +3521,7 @@ async def test_update_spoke_field_headers_async(): def test_update_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3559,7 +3549,7 @@ def test_update_spoke_flattened(): def test_update_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3575,7 +3565,7 @@ def test_update_spoke_flattened_error(): @pytest.mark.asyncio async def test_update_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3608,7 +3598,7 @@ async def test_update_spoke_flattened_async(): @pytest.mark.asyncio async def test_update_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3630,7 +3620,7 @@ async def test_update_spoke_flattened_error_async(): ) def test_delete_spoke(request_type, transport: str = "grpc"): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3657,7 +3647,7 @@ def test_delete_spoke_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3674,7 +3664,7 @@ async def test_delete_spoke_async( transport: str = "grpc_asyncio", request_type=hub.DeleteSpokeRequest ): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3706,7 +3696,7 @@ async def test_delete_spoke_async_from_dict(): def test_delete_spoke_field_headers(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3736,7 +3726,7 @@ def test_delete_spoke_field_headers(): @pytest.mark.asyncio async def test_delete_spoke_field_headers_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as @@ -3767,7 +3757,7 @@ async def test_delete_spoke_field_headers_async(): def test_delete_spoke_flattened(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3791,7 +3781,7 @@ def test_delete_spoke_flattened(): def test_delete_spoke_flattened_error(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3806,7 +3796,7 @@ def test_delete_spoke_flattened_error(): @pytest.mark.asyncio async def test_delete_spoke_flattened_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3835,7 +3825,7 @@ async def test_delete_spoke_flattened_async(): @pytest.mark.asyncio async def test_delete_spoke_flattened_error_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -3850,17 +3840,17 @@ async def test_delete_spoke_flattened_error_async(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = HubServiceClient( @@ -3870,7 +3860,7 @@ def test_credentials_transport_error(): # It is an error to provide an api_key and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) options = client_options.ClientOptions() options.api_key = "api_key" @@ -3885,13 +3875,12 @@ def test_credentials_transport_error(): options.api_key = "api_key" with pytest.raises(ValueError): client = HubServiceClient( - client_options=options, - credentials=_AnonymousCredentialsWithUniverseDomain(), + client_options=options, credentials=ga_credentials.AnonymousCredentials() ) # It is an error to provide scopes and a transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = HubServiceClient( @@ -3903,7 +3892,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) client = HubServiceClient(transport=transport) assert client.transport is transport @@ -3912,13 +3901,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.HubServiceGrpcTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.HubServiceGrpcAsyncIOTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -3934,7 +3923,7 @@ def test_transport_get_channel(): def test_transport_adc(transport_class): # Test default credentials are used if not provided. with mock.patch.object(google.auth, "default") as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() @@ -3947,7 +3936,7 @@ def test_transport_adc(transport_class): ) def test_transport_kind(transport_name): transport = HubServiceClient.get_transport_class(transport_name)( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert transport.kind == transport_name @@ -3955,7 +3944,7 @@ def test_transport_kind(transport_name): def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( client.transport, @@ -3967,7 +3956,7 @@ def test_hub_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.HubServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -3979,7 +3968,7 @@ def test_hub_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.HubServiceTransport( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -4025,7 +4014,7 @@ def test_hub_service_base_transport_with_credentials_file(): "google.cloud.networkconnectivity_v1alpha1.services.hub_service.transports.HubServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.HubServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", @@ -4044,7 +4033,7 @@ def test_hub_service_base_transport_with_adc(): "google.cloud.networkconnectivity_v1alpha1.services.hub_service.transports.HubServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.HubServiceTransport() adc.assert_called_once() @@ -4052,7 +4041,7 @@ def test_hub_service_base_transport_with_adc(): def test_hub_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) HubServiceClient() adc.assert_called_once_with( scopes=None, @@ -4072,7 +4061,7 @@ def test_hub_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (_AnonymousCredentialsWithUniverseDomain(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) adc.assert_called_once_with( scopes=["1", "2"], @@ -4118,7 +4107,7 @@ def test_hub_service_transport_create_channel(transport_class, grpc_helpers): ) as adc, mock.patch.object( grpc_helpers, "create_channel", autospec=True ) as create_channel: - creds = _AnonymousCredentialsWithUniverseDomain() + creds = ga_credentials.AnonymousCredentials() adc.return_value = (creds, None) transport_class(quota_project_id="octopus", scopes=["1", "2"]) @@ -4143,7 +4132,7 @@ def test_hub_service_transport_create_channel(transport_class, grpc_helpers): [transports.HubServiceGrpcTransport, transports.HubServiceGrpcAsyncIOTransport], ) def test_hub_service_grpc_transport_client_cert_source_for_mtls(transport_class): - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -4189,7 +4178,7 @@ def test_hub_service_grpc_transport_client_cert_source_for_mtls(transport_class) ) def test_hub_service_host_no_port(transport_name): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="networkconnectivity.googleapis.com" ), @@ -4207,7 +4196,7 @@ def test_hub_service_host_no_port(transport_name): ) def test_hub_service_host_with_port(transport_name): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="networkconnectivity.googleapis.com:8000" ), @@ -4261,7 +4250,7 @@ def test_hub_service_transport_channel_mtls_with_client_cert_source(transport_cl mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = _AnonymousCredentialsWithUniverseDomain() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) @@ -4336,7 +4325,7 @@ def test_hub_service_transport_channel_mtls_with_adc(transport_class): def test_hub_service_grpc_lro_client(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -4353,7 +4342,7 @@ def test_hub_service_grpc_lro_client(): def test_hub_service_grpc_lro_async_client(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -4605,7 +4594,7 @@ def test_client_with_default_client_info(): transports.HubServiceTransport, "_prep_wrapped_messages" ) as prep: client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4615,7 +4604,7 @@ def test_client_with_default_client_info(): ) as prep: transport_class = HubServiceClient.get_transport_class() transport = transport_class( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4624,7 +4613,7 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = HubServiceAsyncClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) with mock.patch.object( @@ -4642,7 +4631,7 @@ def test_transport_close(): for transport, close_name in transports.items(): client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) with mock.patch.object( type(getattr(client.transport, close_name)), "close" @@ -4658,7 +4647,7 @@ def test_client_ctx(): ] for transport in transports: client = HubServiceClient( - credentials=_AnonymousCredentialsWithUniverseDomain(), transport=transport + credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. with mock.patch.object(type(client.transport), "close") as close: