From 881d137234650781f035a8fcdc4baca1d06c1515 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Fri, 12 Jan 2024 03:28:59 +0000 Subject: [PATCH] fix: Ensure endpoints are correct for mixin clients --- .../rest/service_stub.rb | 9 +++ .../analytics_admin_service_paths_test.rb | 68 +++++++++++-------- .../analytics_admin_service_rest_test.rb | 11 ++- .../v1alpha/analytics_admin_service_test.rb | 11 ++- .../analytics_data/rest/service_stub.rb | 9 +++ .../v1beta/analytics_data_operations_test.rb | 11 ++- .../data/v1beta/analytics_data_paths_test.rb | 16 ++++- .../data/v1beta/analytics_data_rest_test.rb | 11 ++- .../data/v1beta/analytics_data_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../spaces_service/rest/service_stub.rb | 9 +++ .../conference_records_service_paths_test.rb | 22 ++++-- .../conference_records_service_rest_test.rb | 11 ++- .../v2beta/conference_records_service_test.rb | 11 ++- .../meet/v2beta/spaces_service_paths_test.rb | 14 +++- .../meet/v2beta/spaces_service_rest_test.rb | 11 ++- .../apps/meet/v2beta/spaces_service_test.rb | 11 ++- .../tables_service/rest/service_stub.rb | 9 +++ .../v1alpha1/tables_service_paths_test.rb | 16 ++++- .../v1alpha1/tables_service_rest_test.rb | 11 ++- .../tables/v1alpha1/tables_service_test.rb | 11 ++- .../v1/access_approval/rest/service_stub.rb | 9 +++ .../v1/access_approval_paths_test.rb | 20 ++++-- .../v1/access_approval_rest_test.rb | 11 ++- .../v1/access_approval_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ ...visory_notifications_service_paths_test.rb | 16 ++++- ...dvisory_notifications_service_rest_test.rb | 11 ++- .../v1/advisory_notifications_service_test.rb | 11 ++- .../alloy_db/v1/alloy_db_admin/client.rb | 28 ++++---- .../alloy_db/v1/alloy_db_admin/rest/client.rb | 22 +++--- .../v1/alloy_db_admin/rest/service_stub.rb | 9 +++ .../v1/alloy_db_admin_operations_test.rb | 11 ++- .../alloy_db/v1/alloy_db_admin_paths_test.rb | 24 +++++-- .../alloy_db/v1/alloy_db_admin_rest_test.rb | 11 ++- .../cloud/alloy_db/v1/alloy_db_admin_test.rb | 14 +++- .../alloy_db/v1alpha/alloy_db_admin/client.rb | 28 ++++---- .../v1alpha/alloy_db_admin_operations_test.rb | 11 ++- .../v1alpha/alloy_db_admin_paths_test.rb | 24 +++++-- .../alloy_db/v1alpha/alloy_db_admin_test.rb | 14 +++- .../alloy_db/v1beta/alloy_db_admin/client.rb | 28 ++++---- .../v1beta/alloy_db_admin/rest/client.rb | 22 +++--- .../alloy_db_admin/rest/service_stub.rb | 9 +++ .../v1beta/alloy_db_admin_operations_test.rb | 11 ++- .../v1beta/alloy_db_admin_paths_test.rb | 24 +++++-- .../v1beta/alloy_db_admin_rest_test.rb | 11 ++- .../alloy_db/v1beta/alloy_db_admin_test.rb | 14 +++- .../api_gateway_service/rest/service_stub.rb | 9 +++ .../v1/api_gateway_service_operations_test.rb | 11 ++- .../v1/api_gateway_service_paths_test.rb | 24 +++++-- .../v1/api_gateway_service_rest_test.rb | 11 ++- .../v1/api_gateway_service_test.rb | 14 +++- .../api_keys/v2/api_keys/rest/service_stub.rb | 9 +++ .../api_keys/v2/api_keys_operations_test.rb | 11 ++- .../cloud/api_keys/v2/api_keys_paths_test.rb | 14 +++- .../cloud/api_keys/v2/api_keys_rest_test.rb | 11 ++- .../google/cloud/api_keys/v2/api_keys_test.rb | 14 +++- .../connection_service/rest/service_stub.rb | 9 +++ .../v1/connection_service_paths_test.rb | 12 +++- .../v1/connection_service_rest_test.rb | 11 ++- .../v1/connection_service_test.rb | 11 ++- .../cloud/apigee_connect/v1/tether_test.rb | 11 ++- .../apigee_registry/v1/provisioning/client.rb | 28 ++++---- .../v1/provisioning/rest/client.rb | 22 +++--- .../v1/provisioning/rest/service_stub.rb | 9 +++ .../apigee_registry/v1/registry/client.rb | 28 ++++---- .../v1/registry/rest/client.rb | 22 +++--- .../v1/registry/rest/service_stub.rb | 9 +++ .../v1/provisioning_operations_test.rb | 11 ++- .../v1/provisioning_paths_test.rb | 14 +++- .../v1/provisioning_rest_test.rb | 11 ++- .../apigee_registry/v1/provisioning_test.rb | 14 +++- .../apigee_registry/v1/registry_paths_test.rb | 22 ++++-- .../apigee_registry/v1/registry_rest_test.rb | 11 ++- .../cloud/apigee_registry/v1/registry_test.rb | 11 ++- .../v1/applications/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../authorized_domains/rest/service_stub.rb | 9 +++ .../v1/domain_mappings/rest/service_stub.rb | 9 +++ .../v1/firewall/rest/service_stub.rb | 9 +++ .../v1/instances/rest/service_stub.rb | 9 +++ .../v1/services/rest/service_stub.rb | 9 +++ .../v1/versions/rest/service_stub.rb | 9 +++ .../v1/applications_operations_test.rb | 11 ++- .../app_engine/v1/applications_rest_test.rb | 11 ++- .../cloud/app_engine/v1/applications_test.rb | 14 +++- .../v1/authorized_certificates_rest_test.rb | 11 ++- .../v1/authorized_certificates_test.rb | 11 ++- .../v1/authorized_domains_rest_test.rb | 11 ++- .../app_engine/v1/authorized_domains_test.rb | 11 ++- .../v1/domain_mappings_operations_test.rb | 11 ++- .../v1/domain_mappings_rest_test.rb | 11 ++- .../app_engine/v1/domain_mappings_test.rb | 14 +++- .../cloud/app_engine/v1/firewall_rest_test.rb | 11 ++- .../cloud/app_engine/v1/firewall_test.rb | 11 ++- .../v1/instances_operations_test.rb | 11 ++- .../app_engine/v1/instances_rest_test.rb | 11 ++- .../cloud/app_engine/v1/instances_test.rb | 14 +++- .../app_engine/v1/services_operations_test.rb | 11 ++- .../cloud/app_engine/v1/services_rest_test.rb | 11 ++- .../cloud/app_engine/v1/services_test.rb | 14 +++- .../app_engine/v1/versions_operations_test.rb | 11 ++- .../cloud/app_engine/v1/versions_rest_test.rb | 11 ++- .../cloud/app_engine/v1/versions_test.rb | 14 +++- .../v1/artifact_registry/client.rb | 14 ++-- .../v1/artifact_registry/rest/client.rb | 16 ++--- .../v1/artifact_registry/rest/service_stub.rb | 9 +++ .../v1/artifact_registry_operations_test.rb | 11 ++- .../v1/artifact_registry_paths_test.rb | 36 ++++++---- .../v1/artifact_registry_rest_test.rb | 11 ++- .../v1/artifact_registry_test.rb | 14 +++- .../v1beta2/artifact_registry/client.rb | 14 ++-- .../v1beta2/artifact_registry/rest/client.rb | 16 ++--- .../artifact_registry/rest/service_stub.rb | 9 +++ .../artifact_registry_operations_test.rb | 11 ++- .../v1beta2/artifact_registry_paths_test.rb | 18 +++-- .../v1beta2/artifact_registry_rest_test.rb | 11 ++- .../v1beta2/artifact_registry_test.rb | 14 +++- .../v1/asset_service/rest/service_stub.rb | 9 +++ .../asset/v1/asset_service_operations_test.rb | 11 ++- .../asset/v1/asset_service_paths_test.rb | 20 ++++-- .../cloud/asset/v1/asset_service_rest_test.rb | 11 ++- .../cloud/asset/v1/asset_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...sured_workloads_service_operations_test.rb | 11 ++- .../assured_workloads_service_paths_test.rb | 16 ++++- .../v1/assured_workloads_service_rest_test.rb | 11 ++- .../v1/assured_workloads_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...sured_workloads_service_operations_test.rb | 11 ++- .../assured_workloads_service_paths_test.rb | 14 +++- .../assured_workloads_service_rest_test.rb | 11 ++- .../v1beta1/assured_workloads_service_test.rb | 14 +++- .../automl/v1/automl/rest/service_stub.rb | 9 +++ .../prediction_service/rest/service_stub.rb | 9 +++ .../cloud/automl/v1/automl_operations_test.rb | 11 ++- .../cloud/automl/v1/automl_paths_test.rb | 20 ++++-- .../cloud/automl/v1/automl_rest_test.rb | 11 ++- .../google/cloud/automl/v1/automl_test.rb | 14 +++- .../v1/prediction_service_operations_test.rb | 11 ++- .../v1/prediction_service_paths_test.rb | 12 +++- .../automl/v1/prediction_service_rest_test.rb | 11 ++- .../automl/v1/prediction_service_test.rb | 14 +++- .../v1beta1/automl/rest/service_stub.rb | 9 +++ .../prediction_service/rest/service_stub.rb | 9 +++ .../automl/v1beta1/automl_operations_test.rb | 11 ++- .../cloud/automl/v1beta1/automl_paths_test.rb | 24 +++++-- .../cloud/automl/v1beta1/automl_rest_test.rb | 11 ++- .../cloud/automl/v1beta1/automl_test.rb | 14 +++- .../prediction_service_operations_test.rb | 11 ++- .../v1beta1/prediction_service_paths_test.rb | 12 +++- .../v1beta1/prediction_service_rest_test.rb | 11 ++- .../automl/v1beta1/prediction_service_test.rb | 14 +++- .../v2/bare_metal_solution/client.rb | 28 ++++---- .../v2/bare_metal_solution/rest/client.rb | 22 +++--- .../bare_metal_solution/rest/service_stub.rb | 9 +++ .../v2/bare_metal_solution_operations_test.rb | 11 ++- .../v2/bare_metal_solution_paths_test.rb | 38 +++++++---- .../v2/bare_metal_solution_rest_test.rb | 11 ++- .../v2/bare_metal_solution_test.rb | 14 +++- .../cloud/batch/v1/batch_service/client.rb | 14 ++-- .../batch/v1/batch_service/rest/client.rb | 16 ++--- .../v1/batch_service/rest/service_stub.rb | 9 +++ .../lib/google/iam/v1/iam_policy/client.rb | 14 ++-- .../google/iam/v1/iam_policy/rest/client.rb | 16 ++--- .../iam/v1/iam_policy/rest/service_stub.rb | 9 +++ .../batch/v1/batch_service_operations_test.rb | 11 ++- .../batch/v1/batch_service_paths_test.rb | 18 +++-- .../cloud/batch/v1/batch_service_rest_test.rb | 11 ++- .../cloud/batch/v1/batch_service_test.rb | 14 +++- .../google/iam/v1/iam_policy_rest_test.rb | 11 ++- .../test/google/iam/v1/iam_policy_test.rb | 11 ++- .../v1/app_connections_service/client.rb | 28 ++++---- ...app_connections_service_operations_test.rb | 11 ++- .../v1/app_connections_service_paths_test.rb | 18 +++-- .../v1/app_connections_service_test.rb | 14 +++- .../v1/app_connectors_service/client.rb | 28 ++++---- .../app_connectors_service_operations_test.rb | 11 ++- .../v1/app_connectors_service_paths_test.rb | 14 +++- .../v1/app_connectors_service_test.rb | 14 +++- .../v1/app_gateways_service/client.rb | 28 ++++---- .../app_gateways_service_operations_test.rb | 11 ++- .../v1/app_gateways_service_paths_test.rb | 14 +++- .../v1/app_gateways_service_test.rb | 14 +++- .../client.rb | 28 ++++---- ...nector_services_service_operations_test.rb | 11 ++- ...t_connector_services_service_paths_test.rb | 14 +++- .../client_connector_services_service_test.rb | 14 +++- .../v1/client_gateways_service/client.rb | 28 ++++---- ...client_gateways_service_operations_test.rb | 11 ++- .../v1/client_gateways_service_paths_test.rb | 14 +++- .../v1/client_gateways_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../analytics_hub_service_operations_test.rb | 11 ++- .../v1/analytics_hub_service_paths_test.rb | 20 ++++-- .../v1/analytics_hub_service_rest_test.rb | 11 ++- .../v1/analytics_hub_service_test.rb | 14 +++- .../connection_service/rest/service_stub.rb | 9 +++ .../v1/connection_service_paths_test.rb | 18 +++-- .../v1/connection_service_rest_test.rb | 11 ++- .../connection/v1/connection_service_test.rb | 11 ++- .../v1beta1/analytics_hub_service/client.rb | 14 ++-- .../analytics_hub_service_paths_test.rb | 18 +++-- .../v1beta1/analytics_hub_service_test.rb | 11 ++- .../data_policy_service/rest/service_stub.rb | 9 +++ .../v1/data_policy_service_paths_test.rb | 14 +++- .../v1/data_policy_service_rest_test.rb | 11 ++- .../v1/data_policy_service_test.rb | 11 ++- .../v1beta1/data_policy_service_paths_test.rb | 14 +++- .../v1beta1/data_policy_service_test.rb | 11 ++- .../v1/data_transfer_service/client.rb | 14 ++-- .../v1/data_transfer_service/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../v1/data_transfer_service_paths_test.rb | 20 ++++-- .../v1/data_transfer_service_rest_test.rb | 11 ++- .../v1/data_transfer_service_test.rb | 11 ++- .../v2/migration_service_paths_test.rb | 16 ++++- .../migration/v2/migration_service_test.rb | 11 ++- .../reservation_service/rest/service_stub.rb | 9 +++ .../v1/reservation_service_paths_test.rb | 20 ++++-- .../v1/reservation_service_rest_test.rb | 11 ++- .../v1/reservation_service_test.rb | 11 ++- .../storage/v1/big_query_read_paths_test.rb | 18 +++-- .../storage/v1/big_query_read_test.rb | 11 ++- .../storage/v1/big_query_write_paths_test.rb | 14 +++- .../storage/v1/big_query_write_test.rb | 11 ++- ...bigtable_instance_admin_operations_test.rb | 11 ++- .../v2/bigtable_instance_admin_paths_test.rb | 22 ++++-- .../admin/v2/bigtable_instance_admin_test.rb | 14 +++- .../bigtable_table_admin_operations_test.rb | 11 ++- .../v2/bigtable_table_admin_paths_test.rb | 22 ++++-- .../admin/v2/bigtable_table_admin_test.rb | 14 +++- .../cloud/bigtable/v2/bigtable_paths_test.rb | 14 +++- .../google/cloud/bigtable/v2/bigtable_test.rb | 11 ++- .../v1/budget_service/rest/service_stub.rb | 9 +++ .../budgets/v1/budget_service_paths_test.rb | 14 +++- .../budgets/v1/budget_service_rest_test.rb | 11 ++- .../billing/budgets/v1/budget_service_test.rb | 11 ++- .../v1beta1/budget_service_paths_test.rb | 14 +++- .../budgets/v1beta1/budget_service_test.rb | 11 ++- .../v1/cloud_billing/rest/service_stub.rb | 9 +++ .../v1/cloud_catalog/rest/service_stub.rb | 9 +++ .../billing/v1/cloud_billing_paths_test.rb | 18 +++-- .../billing/v1/cloud_billing_rest_test.rb | 11 ++- .../cloud/billing/v1/cloud_billing_test.rb | 11 ++- .../billing/v1/cloud_catalog_paths_test.rb | 12 +++- .../billing/v1/cloud_catalog_rest_test.rb | 11 ++- .../cloud/billing/v1/cloud_catalog_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../v1/system_policy/rest/service_stub.rb | 9 +++ .../v1/validation_helper/rest/service_stub.rb | 9 +++ .../binauthz_management_service_paths_test.rb | 16 ++++- .../binauthz_management_service_rest_test.rb | 11 ++- .../v1/binauthz_management_service_test.rb | 11 ++- .../v1/system_policy_paths_test.rb | 12 +++- .../v1/system_policy_rest_test.rb | 11 ++- .../v1/system_policy_test.rb | 11 ++- .../v1/validation_helper_rest_test.rb | 11 ++- .../v1/validation_helper_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../system_policy/rest/service_stub.rb | 9 +++ .../binauthz_management_service_paths_test.rb | 16 ++++- .../binauthz_management_service_rest_test.rb | 11 ++- .../binauthz_management_service_test.rb | 11 ++- .../v1beta1/system_policy_paths_test.rb | 12 +++- .../v1beta1/system_policy_rest_test.rb | 11 ++- .../v1beta1/system_policy_test.rb | 11 ++- .../build/v1/cloud_build/rest/service_stub.rb | 9 +++ .../build/v1/cloud_build_operations_test.rb | 11 ++- .../cloud/build/v1/cloud_build_paths_test.rb | 36 ++++++---- .../cloud/build/v1/cloud_build_rest_test.rb | 11 ++- .../google/cloud/build/v1/cloud_build_test.rb | 14 +++- .../build/v2/repository_manager/client.rb | 28 ++++---- .../v2/repository_manager_operations_test.rb | 11 ++- .../build/v2/repository_manager_paths_test.rb | 20 ++++-- .../cloud/build/v2/repository_manager_test.rb | 14 +++- .../v1/certificate_manager/client.rb | 14 ++-- .../v1/certificate_manager/rest/client.rb | 16 ++--- .../certificate_manager/rest/service_stub.rb | 9 +++ .../v1/certificate_manager_operations_test.rb | 11 ++- .../v1/certificate_manager_paths_test.rb | 24 +++++-- .../v1/certificate_manager_rest_test.rb | 11 ++- .../v1/certificate_manager_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ ...channel_reports_service_operations_test.rb | 11 ++- ...loud_channel_reports_service_paths_test.rb | 14 +++- ...cloud_channel_reports_service_rest_test.rb | 11 ++- .../v1/cloud_channel_reports_service_test.rb | 14 +++- .../cloud_channel_service_operations_test.rb | 11 ++- .../v1/cloud_channel_service_paths_test.rb | 26 ++++--- .../v1/cloud_channel_service_rest_test.rb | 11 ++- .../channel/v1/cloud_channel_service_test.rb | 14 +++- .../v1/data_migration_service/client.rb | 28 ++++---- .../data_migration_service_operations_test.rb | 11 ++- .../v1/data_migration_service_paths_test.rb | 24 +++++-- .../v1/data_migration_service_test.rb | 14 +++- .../v1/cloud_quotas/rest/service_stub.rb | 9 +++ .../v1/cloud_quotas_paths_test.rb | 18 +++-- .../cloud_quotas/v1/cloud_quotas_rest_test.rb | 11 ++- .../cloud_quotas/v1/cloud_quotas_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ ...mer_procurement_service_operations_test.rb | 11 ++- ...consumer_procurement_service_paths_test.rb | 14 +++- .../consumer_procurement_service_rest_test.rb | 11 ++- .../v1/consumer_procurement_service_test.rb | 14 +++- .../v1/accelerator_types/rest/service_stub.rb | 9 +++ .../compute/v1/addresses/rest/service_stub.rb | 9 +++ .../v1/autoscalers/rest/service_stub.rb | 9 +++ .../v1/backend_buckets/rest/service_stub.rb | 9 +++ .../v1/backend_services/rest/service_stub.rb | 9 +++ .../v1/disk_types/rest/service_stub.rb | 9 +++ .../compute/v1/disks/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/firewall_policies/rest/service_stub.rb | 9 +++ .../compute/v1/firewalls/rest/service_stub.rb | 9 +++ .../v1/forwarding_rules/rest/service_stub.rb | 9 +++ .../v1/global_addresses/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/global_operations/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/health_checks/rest/service_stub.rb | 9 +++ .../image_family_views/rest/service_stub.rb | 9 +++ .../compute/v1/images/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/instance_groups/rest/service_stub.rb | 9 +++ .../instance_templates/rest/service_stub.rb | 9 +++ .../compute/v1/instances/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/interconnects/rest/service_stub.rb | 9 +++ .../v1/license_codes/rest/service_stub.rb | 9 +++ .../compute/v1/licenses/rest/service_stub.rb | 9 +++ .../v1/machine_images/rest/service_stub.rb | 9 +++ .../v1/machine_types/rest/service_stub.rb | 9 +++ .../network_attachments/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../compute/v1/networks/rest/service_stub.rb | 9 +++ .../v1/node_groups/rest/service_stub.rb | 9 +++ .../v1/node_templates/rest/service_stub.rb | 9 +++ .../v1/node_types/rest/service_stub.rb | 9 +++ .../v1/packet_mirrorings/rest/service_stub.rb | 9 +++ .../compute/v1/projects/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../region_autoscalers/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../region_commitments/rest/service_stub.rb | 9 +++ .../v1/region_disk_types/rest/service_stub.rb | 9 +++ .../v1/region_disks/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../region_health_checks/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/region_instances/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/region_operations/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../region_ssl_policies/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/region_url_maps/rest/service_stub.rb | 9 +++ .../compute/v1/regions/rest/service_stub.rb | 9 +++ .../v1/reservations/rest/service_stub.rb | 9 +++ .../v1/resource_policies/rest/service_stub.rb | 9 +++ .../compute/v1/routers/rest/service_stub.rb | 9 +++ .../compute/v1/routes/rest/service_stub.rb | 9 +++ .../v1/security_policies/rest/service_stub.rb | 9 +++ .../service_attachments/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../compute/v1/snapshots/rest/service_stub.rb | 9 +++ .../v1/ssl_certificates/rest/service_stub.rb | 9 +++ .../v1/ssl_policies/rest/service_stub.rb | 9 +++ .../v1/subnetworks/rest/service_stub.rb | 9 +++ .../target_grpc_proxies/rest/service_stub.rb | 9 +++ .../target_http_proxies/rest/service_stub.rb | 9 +++ .../target_https_proxies/rest/service_stub.rb | 9 +++ .../v1/target_instances/rest/service_stub.rb | 9 +++ .../v1/target_pools/rest/service_stub.rb | 9 +++ .../target_ssl_proxies/rest/service_stub.rb | 9 +++ .../target_tcp_proxies/rest/service_stub.rb | 9 +++ .../target_vpn_gateways/rest/service_stub.rb | 9 +++ .../compute/v1/url_maps/rest/service_stub.rb | 9 +++ .../v1/vpn_gateways/rest/service_stub.rb | 9 +++ .../v1/vpn_tunnels/rest/service_stub.rb | 9 +++ .../v1/zone_operations/rest/service_stub.rb | 9 +++ .../compute/v1/zones/rest/service_stub.rb | 9 +++ .../compute/v1/accelerator_types_rest_test.rb | 11 ++- .../cloud/compute/v1/addresses_rest_test.rb | 11 ++- .../cloud/compute/v1/autoscalers_rest_test.rb | 11 ++- .../compute/v1/backend_buckets_rest_test.rb | 11 ++- .../compute/v1/backend_services_rest_test.rb | 11 ++- .../cloud/compute/v1/disk_types_rest_test.rb | 11 ++- .../cloud/compute/v1/disks_rest_test.rb | 11 ++- .../v1/external_vpn_gateways_rest_test.rb | 11 ++- .../compute/v1/firewall_policies_rest_test.rb | 11 ++- .../cloud/compute/v1/firewalls_rest_test.rb | 11 ++- .../compute/v1/forwarding_rules_rest_test.rb | 11 ++- .../compute/v1/global_addresses_rest_test.rb | 11 ++- .../v1/global_forwarding_rules_rest_test.rb | 11 ++- ...lobal_network_endpoint_groups_rest_test.rb | 11 ++- .../compute/v1/global_operations_rest_test.rb | 11 ++- ...lobal_organization_operations_rest_test.rb | 11 ++- ...bal_public_delegated_prefixes_rest_test.rb | 11 ++- .../compute/v1/health_checks_rest_test.rb | 11 ++- .../v1/image_family_views_rest_test.rb | 11 ++- .../cloud/compute/v1/images_rest_test.rb | 11 ++- .../v1/instance_group_managers_rest_test.rb | 11 ++- .../compute/v1/instance_groups_rest_test.rb | 11 ++- .../v1/instance_templates_rest_test.rb | 11 ++- .../cloud/compute/v1/instances_rest_test.rb | 11 ++- .../v1/interconnect_attachments_rest_test.rb | 11 ++- .../v1/interconnect_locations_rest_test.rb | 11 ++- ...interconnect_remote_locations_rest_test.rb | 11 ++- .../compute/v1/interconnects_rest_test.rb | 11 ++- .../compute/v1/license_codes_rest_test.rb | 11 ++- .../cloud/compute/v1/licenses_rest_test.rb | 11 ++- .../compute/v1/machine_images_rest_test.rb | 11 ++- .../compute/v1/machine_types_rest_test.rb | 11 ++- .../v1/network_attachments_rest_test.rb | 11 ++- ...etwork_edge_security_services_rest_test.rb | 11 ++- .../v1/network_endpoint_groups_rest_test.rb | 11 ++- .../v1/network_firewall_policies_rest_test.rb | 11 ++- .../cloud/compute/v1/networks_rest_test.rb | 11 ++- .../cloud/compute/v1/node_groups_rest_test.rb | 11 ++- .../compute/v1/node_templates_rest_test.rb | 11 ++- .../cloud/compute/v1/node_types_rest_test.rb | 11 ++- .../compute/v1/packet_mirrorings_rest_test.rb | 11 ++- .../cloud/compute/v1/projects_rest_test.rb | 11 ++- .../public_advertised_prefixes_rest_test.rb | 11 ++- .../v1/public_delegated_prefixes_rest_test.rb | 11 ++- .../v1/region_autoscalers_rest_test.rb | 11 ++- .../v1/region_backend_services_rest_test.rb | 11 ++- .../v1/region_commitments_rest_test.rb | 11 ++- .../compute/v1/region_disk_types_rest_test.rb | 11 ++- .../compute/v1/region_disks_rest_test.rb | 11 ++- .../region_health_check_services_rest_test.rb | 11 ++- .../v1/region_health_checks_rest_test.rb | 11 ++- ...egion_instance_group_managers_rest_test.rb | 11 ++- .../v1/region_instance_groups_rest_test.rb | 11 ++- .../v1/region_instance_templates_rest_test.rb | 11 ++- .../compute/v1/region_instances_rest_test.rb | 11 ++- ...egion_network_endpoint_groups_rest_test.rb | 11 ++- ...ion_network_firewall_policies_rest_test.rb | 11 ++- ...region_notification_endpoints_rest_test.rb | 11 ++- .../compute/v1/region_operations_rest_test.rb | 11 ++- .../v1/region_security_policies_rest_test.rb | 11 ++- .../v1/region_ssl_certificates_rest_test.rb | 11 ++- .../v1/region_ssl_policies_rest_test.rb | 11 ++- .../region_target_http_proxies_rest_test.rb | 11 ++- .../region_target_https_proxies_rest_test.rb | 11 ++- .../v1/region_target_tcp_proxies_rest_test.rb | 11 ++- .../compute/v1/region_url_maps_rest_test.rb | 11 ++- .../cloud/compute/v1/regions_rest_test.rb | 11 ++- .../compute/v1/reservations_rest_test.rb | 11 ++- .../compute/v1/resource_policies_rest_test.rb | 11 ++- .../cloud/compute/v1/routers_rest_test.rb | 11 ++- .../cloud/compute/v1/routes_rest_test.rb | 11 ++- .../compute/v1/security_policies_rest_test.rb | 11 ++- .../v1/service_attachments_rest_test.rb | 11 ++- .../v1/snapshot_settings_service_rest_test.rb | 11 ++- .../cloud/compute/v1/snapshots_rest_test.rb | 11 ++- .../compute/v1/ssl_certificates_rest_test.rb | 11 ++- .../compute/v1/ssl_policies_rest_test.rb | 11 ++- .../cloud/compute/v1/subnetworks_rest_test.rb | 11 ++- .../v1/target_grpc_proxies_rest_test.rb | 11 ++- .../v1/target_http_proxies_rest_test.rb | 11 ++- .../v1/target_https_proxies_rest_test.rb | 11 ++- .../compute/v1/target_instances_rest_test.rb | 11 ++- .../compute/v1/target_pools_rest_test.rb | 11 ++- .../v1/target_ssl_proxies_rest_test.rb | 11 ++- .../v1/target_tcp_proxies_rest_test.rb | 11 ++- .../v1/target_vpn_gateways_rest_test.rb | 11 ++- .../cloud/compute/v1/url_maps_rest_test.rb | 11 ++- .../compute/v1/vpn_gateways_rest_test.rb | 11 ++- .../cloud/compute/v1/vpn_tunnels_rest_test.rb | 11 ++- .../compute/v1/zone_operations_rest_test.rb | 11 ++- .../cloud/compute/v1/zones_rest_test.rb | 11 ++- .../v1/confidential_computing/client.rb | 14 ++-- .../v1/confidential_computing/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../v1/confidential_computing_paths_test.rb | 14 +++- .../v1/confidential_computing_rest_test.rb | 11 ++- .../v1/confidential_computing_test.rb | 11 ++- .../cloud/config_service/v1/config/client.rb | 28 ++++---- .../config_service/v1/config/rest/client.rb | 22 +++--- .../v1/config/rest/service_stub.rb | 9 +++ .../v1/config_operations_test.rb | 11 ++- .../config_service/v1/config_paths_test.rb | 22 ++++-- .../config_service/v1/config_rest_test.rb | 11 ++- .../cloud/config_service/v1/config_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...contact_center_insights_operations_test.rb | 11 ++- .../v1/contact_center_insights_paths_test.rb | 32 ++++++--- .../v1/contact_center_insights_rest_test.rb | 11 ++- .../v1/contact_center_insights_test.rb | 14 +++- .../v1/cluster_manager_paths_test.rb | 12 +++- .../container/v1/cluster_manager_test.rb | 11 ++- .../v1beta1/cluster_manager_paths_test.rb | 12 +++- .../container/v1beta1/cluster_manager_test.rb | 11 ++- .../v1/container_analysis_paths_test.rb | 12 +++- .../v1/container_analysis_test.rb | 11 ++- .../lineage/v1/lineage/rest/service_stub.rb | 9 +++ .../lineage/v1/lineage_operations_test.rb | 11 ++- .../lineage/v1/lineage_paths_test.rb | 18 +++-- .../lineage/v1/lineage_rest_test.rb | 11 ++- .../data_catalog/lineage/v1/lineage_test.rb | 14 +++- .../data_catalog/v1/data_catalog/client.rb | 14 ++-- .../v1/data_catalog/rest/client.rb | 14 ++-- .../v1/data_catalog/rest/service_stub.rb | 9 +++ .../v1/policy_tag_manager/client.rb | 14 ++-- .../v1/policy_tag_manager/rest/client.rb | 14 ++-- .../policy_tag_manager/rest/service_stub.rb | 9 +++ .../client.rb | 14 ++-- .../rest/client.rb | 14 ++-- .../rest/service_stub.rb | 9 +++ .../v1/data_catalog_operations_test.rb | 11 ++- .../v1/data_catalog_paths_test.rb | 24 +++++-- .../data_catalog/v1/data_catalog_rest_test.rb | 11 ++- .../data_catalog/v1/data_catalog_test.rb | 14 +++- .../v1/policy_tag_manager_paths_test.rb | 16 ++++- .../v1/policy_tag_manager_rest_test.rb | 11 ++- ...cy_tag_manager_serialization_paths_test.rb | 14 +++- ...icy_tag_manager_serialization_rest_test.rb | 11 ++- .../policy_tag_manager_serialization_test.rb | 11 ++- .../v1/policy_tag_manager_test.rb | 11 ++- .../v1beta1/data_catalog/client.rb | 14 ++-- .../v1beta1/data_catalog/rest/client.rb | 14 ++-- .../v1beta1/data_catalog/rest/service_stub.rb | 9 +++ .../v1beta1/policy_tag_manager/client.rb | 14 ++-- .../v1beta1/policy_tag_manager/rest/client.rb | 14 ++-- .../policy_tag_manager/rest/service_stub.rb | 9 +++ .../client.rb | 14 ++-- .../rest/client.rb | 14 ++-- .../rest/service_stub.rb | 9 +++ .../v1beta1/data_catalog_paths_test.rb | 24 +++++-- .../v1beta1/data_catalog_rest_test.rb | 11 ++- .../data_catalog/v1beta1/data_catalog_test.rb | 11 ++- .../v1beta1/policy_tag_manager_paths_test.rb | 16 ++++- .../v1beta1/policy_tag_manager_rest_test.rb | 11 ++- ...cy_tag_manager_serialization_paths_test.rb | 14 +++- ...icy_tag_manager_serialization_rest_test.rb | 11 ++- .../policy_tag_manager_serialization_test.rb | 11 ++- .../v1beta1/policy_tag_manager_test.rb | 11 ++- .../v1/data_fusion/rest/service_stub.rb | 9 +++ .../v1/data_fusion_operations_test.rb | 11 ++- .../data_fusion/v1/data_fusion_paths_test.rb | 16 ++++- .../data_fusion/v1/data_fusion_rest_test.rb | 11 ++- .../cloud/data_fusion/v1/data_fusion_test.rb | 14 +++- .../data_labeling_service_operations_test.rb | 11 ++- .../data_labeling_service_paths_test.rb | 28 +++++--- .../v1beta1/data_labeling_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../v1beta3/jobs/rest/service_stub.rb | 9 +++ .../v1beta3/messages/rest/service_stub.rb | 9 +++ .../v1beta3/metrics/rest/service_stub.rb | 9 +++ .../v1beta3/snapshots/rest/service_stub.rb | 9 +++ .../templates_service/rest/service_stub.rb | 9 +++ .../flex_templates_service_rest_test.rb | 11 ++- .../v1beta3/flex_templates_service_test.rb | 11 ++- .../cloud/dataflow/v1beta3/jobs_rest_test.rb | 11 ++- .../cloud/dataflow/v1beta3/jobs_test.rb | 11 ++- .../dataflow/v1beta3/messages_rest_test.rb | 11 ++- .../cloud/dataflow/v1beta3/messages_test.rb | 11 ++- .../dataflow/v1beta3/metrics_rest_test.rb | 11 ++- .../cloud/dataflow/v1beta3/metrics_test.rb | 11 ++- .../dataflow/v1beta3/snapshots_rest_test.rb | 11 ++- .../cloud/dataflow/v1beta3/snapshots_test.rb | 11 ++- .../v1beta3/templates_service_rest_test.rb | 11 ++- .../v1beta3/templates_service_test.rb | 11 ++- .../cloud/dataform/v1beta1/dataform/client.rb | 28 ++++---- .../dataform/v1beta1/dataform/rest/client.rb | 22 +++--- .../v1beta1/dataform/rest/service_stub.rb | 9 +++ .../dataform/v1beta1/dataform_paths_test.rb | 26 ++++--- .../dataform/v1beta1/dataform_rest_test.rb | 11 ++- .../cloud/dataform/v1beta1/dataform_test.rb | 11 ++- .../dataplex/v1/content_service/client.rb | 28 ++++---- .../v1/content_service/rest/client.rb | 22 +++--- .../v1/content_service/rest/service_stub.rb | 9 +++ .../dataplex/v1/data_scan_service/client.rb | 28 ++++---- .../v1/data_scan_service/rest/client.rb | 22 +++--- .../v1/data_scan_service/rest/service_stub.rb | 9 +++ .../v1/data_taxonomy_service/client.rb | 28 ++++---- .../v1/data_taxonomy_service/rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ .../dataplex/v1/dataplex_service/client.rb | 28 ++++---- .../v1/dataplex_service/rest/client.rb | 22 +++--- .../v1/dataplex_service/rest/service_stub.rb | 9 +++ .../dataplex/v1/metadata_service/client.rb | 28 ++++---- .../v1/metadata_service/rest/client.rb | 22 +++--- .../v1/metadata_service/rest/service_stub.rb | 9 +++ .../dataplex/v1/content_service_paths_test.rb | 14 +++- .../dataplex/v1/content_service_rest_test.rb | 11 ++- .../cloud/dataplex/v1/content_service_test.rb | 11 ++- .../v1/data_scan_service_operations_test.rb | 11 ++- .../v1/data_scan_service_paths_test.rb | 18 +++-- .../v1/data_scan_service_rest_test.rb | 11 ++- .../dataplex/v1/data_scan_service_test.rb | 14 +++- .../data_taxonomy_service_operations_test.rb | 11 ++- .../v1/data_taxonomy_service_paths_test.rb | 18 +++-- .../v1/data_taxonomy_service_rest_test.rb | 11 ++- .../dataplex/v1/data_taxonomy_service_test.rb | 14 +++- .../v1/dataplex_service_operations_test.rb | 11 ++- .../v1/dataplex_service_paths_test.rb | 24 +++++-- .../dataplex/v1/dataplex_service_rest_test.rb | 11 ++- .../dataplex/v1/dataplex_service_test.rb | 14 +++- .../v1/metadata_service_paths_test.rb | 16 ++++- .../dataplex/v1/metadata_service_rest_test.rb | 11 ++- .../dataplex/v1/metadata_service_test.rb | 11 ++- .../v1/autoscaling_policy_service/client.rb | 14 ++-- .../autoscaling_policy_service/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../dataproc/v1/batch_controller/client.rb | 14 ++-- .../v1/batch_controller/rest/client.rb | 16 ++--- .../v1/batch_controller/rest/service_stub.rb | 9 +++ .../dataproc/v1/cluster_controller/client.rb | 14 ++-- .../v1/cluster_controller/rest/client.rb | 16 ++--- .../cluster_controller/rest/service_stub.rb | 9 +++ .../dataproc/v1/job_controller/client.rb | 14 ++-- .../dataproc/v1/job_controller/rest/client.rb | 16 ++--- .../v1/job_controller/rest/service_stub.rb | 9 +++ .../v1/node_group_controller/client.rb | 14 ++-- .../v1/node_group_controller/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../v1/workflow_template_service/client.rb | 14 ++-- .../workflow_template_service/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../autoscaling_policy_service_paths_test.rb | 16 ++++- .../autoscaling_policy_service_rest_test.rb | 11 ++- .../v1/autoscaling_policy_service_test.rb | 11 ++- .../v1/batch_controller_operations_test.rb | 11 ++- .../v1/batch_controller_paths_test.rb | 16 ++++- .../dataproc/v1/batch_controller_rest_test.rb | 11 ++- .../dataproc/v1/batch_controller_test.rb | 14 +++- .../v1/cluster_controller_operations_test.rb | 11 ++- .../v1/cluster_controller_paths_test.rb | 16 ++++- .../v1/cluster_controller_rest_test.rb | 11 ++- .../dataproc/v1/cluster_controller_test.rb | 14 +++- .../v1/job_controller_operations_test.rb | 11 ++- .../dataproc/v1/job_controller_rest_test.rb | 11 ++- .../cloud/dataproc/v1/job_controller_test.rb | 14 +++- .../node_group_controller_operations_test.rb | 11 ++- .../v1/node_group_controller_paths_test.rb | 14 +++- .../v1/node_group_controller_rest_test.rb | 11 ++- .../dataproc/v1/node_group_controller_test.rb | 14 +++- ...rkflow_template_service_operations_test.rb | 11 ++- .../workflow_template_service_paths_test.rb | 20 ++++-- .../v1/workflow_template_service_rest_test.rb | 11 ++- .../v1/workflow_template_service_test.rb | 14 +++- .../auto_suggestion_service_paths_test.rb | 12 +++- .../v1alpha/auto_suggestion_service_test.rb | 11 ++- .../v1alpha/question_service_paths_test.rb | 16 ++++- .../dataqna/v1alpha/question_service_test.rb | 11 ++- .../v1/datastore_admin/rest/service_stub.rb | 9 +++ .../v1/datastore_admin_operations_test.rb | 11 ++- .../admin/v1/datastore_admin_rest_test.rb | 11 ++- .../admin/v1/datastore_admin_test.rb | 14 +++- .../v1/datastore/rest/service_stub.rb | 9 +++ .../cloud/datastore/v1/datastore_rest_test.rb | 11 ++- .../cloud/datastore/v1/datastore_test.rb | 11 ++- .../cloud/datastream/v1/datastream/client.rb | 28 ++++---- .../datastream/v1/datastream/rest/client.rb | 22 +++--- .../v1/datastream/rest/service_stub.rb | 9 +++ .../v1/datastream_operations_test.rb | 11 ++- .../datastream/v1/datastream_paths_test.rb | 24 +++++-- .../datastream/v1/datastream_rest_test.rb | 11 ++- .../cloud/datastream/v1/datastream_test.rb | 14 +++- .../v1alpha1/datastream/rest/service_stub.rb | 9 +++ .../v1alpha1/datastream_operations_test.rb | 11 ++- .../v1alpha1/datastream_paths_test.rb | 20 ++++-- .../v1alpha1/datastream_rest_test.rb | 11 ++- .../datastream/v1alpha1/datastream_test.rb | 14 +++- .../cloud/deploy/v1/cloud_deploy/client.rb | 28 ++++---- .../deploy/v1/cloud_deploy/rest/client.rb | 22 +++--- .../v1/cloud_deploy/rest/service_stub.rb | 9 +++ .../deploy/v1/cloud_deploy_operations_test.rb | 11 ++- .../deploy/v1/cloud_deploy_paths_test.rb | 42 +++++++----- .../cloud/deploy/v1/cloud_deploy_rest_test.rb | 11 ++- .../cloud/deploy/v1/cloud_deploy_test.rb | 14 +++- .../cloud/dialogflow/cx/v3/agents/client.rb | 14 ++-- .../dialogflow/cx/v3/agents/rest/client.rb | 16 ++--- .../cx/v3/agents/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/changelogs/client.rb | 14 ++-- .../cx/v3/changelogs/rest/client.rb | 16 ++--- .../cx/v3/changelogs/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/deployments/client.rb | 14 ++-- .../cx/v3/deployments/rest/client.rb | 16 ++--- .../cx/v3/deployments/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/entity_types/client.rb | 14 ++-- .../cx/v3/entity_types/rest/client.rb | 16 ++--- .../cx/v3/entity_types/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/environments/client.rb | 14 ++-- .../cx/v3/environments/rest/client.rb | 16 ++--- .../cx/v3/environments/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/experiments/client.rb | 14 ++-- .../cx/v3/experiments/rest/client.rb | 16 ++--- .../cx/v3/experiments/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/cx/v3/flows/client.rb | 14 ++-- .../dialogflow/cx/v3/flows/rest/client.rb | 16 ++--- .../cx/v3/flows/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/generators/client.rb | 14 ++-- .../cx/v3/generators/rest/client.rb | 16 ++--- .../cx/v3/generators/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/cx/v3/intents/client.rb | 14 ++-- .../dialogflow/cx/v3/intents/rest/client.rb | 16 ++--- .../cx/v3/intents/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/cx/v3/pages/client.rb | 14 ++-- .../dialogflow/cx/v3/pages/rest/client.rb | 16 ++--- .../cx/v3/pages/rest/service_stub.rb | 9 +++ .../cx/v3/security_settings_service/client.rb | 14 ++-- .../security_settings_service/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../cx/v3/session_entity_types/client.rb | 14 ++-- .../cx/v3/session_entity_types/rest/client.rb | 16 ++--- .../session_entity_types/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/cx/v3/sessions/client.rb | 14 ++-- .../dialogflow/cx/v3/sessions/rest/client.rb | 16 ++--- .../cx/v3/sessions/rest/service_stub.rb | 9 +++ .../dialogflow/cx/v3/test_cases/client.rb | 14 ++-- .../cx/v3/test_cases/rest/client.rb | 16 ++--- .../cx/v3/test_cases/rest/service_stub.rb | 9 +++ .../cx/v3/transition_route_groups/client.rb | 14 ++-- .../v3/transition_route_groups/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../cloud/dialogflow/cx/v3/versions/client.rb | 14 ++-- .../dialogflow/cx/v3/versions/rest/client.rb | 16 ++--- .../cx/v3/versions/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/cx/v3/webhooks/client.rb | 14 ++-- .../dialogflow/cx/v3/webhooks/rest/client.rb | 16 ++--- .../cx/v3/webhooks/rest/service_stub.rb | 9 +++ .../cx/v3/agents_operations_test.rb | 11 ++- .../dialogflow/cx/v3/agents_paths_test.rb | 24 +++++-- .../dialogflow/cx/v3/agents_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/agents_test.rb | 14 +++- .../dialogflow/cx/v3/changelogs_paths_test.rb | 14 +++- .../dialogflow/cx/v3/changelogs_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/changelogs_test.rb | 11 ++- .../cx/v3/deployments_paths_test.rb | 14 +++- .../dialogflow/cx/v3/deployments_rest_test.rb | 11 ++- .../dialogflow/cx/v3/deployments_test.rb | 11 ++- .../cx/v3/entity_types_paths_test.rb | 14 +++- .../cx/v3/entity_types_rest_test.rb | 11 ++- .../dialogflow/cx/v3/entity_types_test.rb | 11 ++- .../cx/v3/environments_operations_test.rb | 11 ++- .../cx/v3/environments_paths_test.rb | 22 ++++-- .../cx/v3/environments_rest_test.rb | 11 ++- .../dialogflow/cx/v3/environments_test.rb | 14 +++- .../cx/v3/experiments_paths_test.rb | 16 ++++- .../dialogflow/cx/v3/experiments_rest_test.rb | 11 ++- .../dialogflow/cx/v3/experiments_test.rb | 11 ++- .../dialogflow/cx/v3/flows_operations_test.rb | 11 ++- .../dialogflow/cx/v3/flows_paths_test.rb | 24 +++++-- .../cloud/dialogflow/cx/v3/flows_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/flows_test.rb | 14 +++- .../dialogflow/cx/v3/generators_paths_test.rb | 14 +++- .../dialogflow/cx/v3/generators_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/generators_test.rb | 11 ++- .../cx/v3/intents_operations_test.rb | 11 ++- .../dialogflow/cx/v3/intents_paths_test.rb | 16 ++++- .../dialogflow/cx/v3/intents_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/intents_test.rb | 14 +++- .../dialogflow/cx/v3/pages_paths_test.rb | 22 ++++-- .../cloud/dialogflow/cx/v3/pages_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/pages_test.rb | 11 ++- .../security_settings_service_paths_test.rb | 18 +++-- .../v3/security_settings_service_rest_test.rb | 11 ++- .../cx/v3/security_settings_service_test.rb | 11 ++- .../cx/v3/session_entity_types_paths_test.rb | 14 +++- .../cx/v3/session_entity_types_rest_test.rb | 11 ++- .../cx/v3/session_entity_types_test.rb | 11 ++- .../dialogflow/cx/v3/sessions_paths_test.rb | 24 +++++-- .../dialogflow/cx/v3/sessions_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/sessions_test.rb | 11 ++- .../cx/v3/test_cases_operations_test.rb | 11 ++- .../dialogflow/cx/v3/test_cases_paths_test.rb | 30 +++++--- .../dialogflow/cx/v3/test_cases_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/test_cases_test.rb | 14 +++- .../v3/transition_route_groups_paths_test.rb | 22 ++++-- .../v3/transition_route_groups_rest_test.rb | 11 ++- .../cx/v3/transition_route_groups_test.rb | 11 ++- .../cx/v3/versions_operations_test.rb | 11 ++- .../dialogflow/cx/v3/versions_paths_test.rb | 14 +++- .../dialogflow/cx/v3/versions_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/versions_test.rb | 14 +++- .../dialogflow/cx/v3/webhooks_paths_test.rb | 16 ++++- .../dialogflow/cx/v3/webhooks_rest_test.rb | 11 ++- .../cloud/dialogflow/cx/v3/webhooks_test.rb | 11 ++- .../cloud/dialogflow/v2/agents/client.rb | 14 ++-- .../cloud/dialogflow/v2/agents/rest/client.rb | 16 ++--- .../dialogflow/v2/agents/rest/service_stub.rb | 9 +++ .../dialogflow/v2/answer_records/client.rb | 14 ++-- .../v2/answer_records/rest/client.rb | 16 ++--- .../v2/answer_records/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/v2/contexts/client.rb | 14 ++-- .../dialogflow/v2/contexts/rest/client.rb | 16 ++--- .../v2/contexts/rest/service_stub.rb | 9 +++ .../v2/conversation_datasets/client.rb | 14 ++-- .../v2/conversation_datasets/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../v2/conversation_models/client.rb | 14 ++-- .../v2/conversation_models/rest/client.rb | 16 ++--- .../conversation_models/rest/service_stub.rb | 9 +++ .../v2/conversation_profiles/client.rb | 14 ++-- .../v2/conversation_profiles/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../dialogflow/v2/conversations/client.rb | 14 ++-- .../v2/conversations/rest/client.rb | 16 ++--- .../v2/conversations/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/v2/documents/client.rb | 14 ++-- .../dialogflow/v2/documents/rest/client.rb | 16 ++--- .../v2/documents/rest/service_stub.rb | 9 +++ .../dialogflow/v2/entity_types/client.rb | 14 ++-- .../dialogflow/v2/entity_types/rest/client.rb | 16 ++--- .../v2/entity_types/rest/service_stub.rb | 9 +++ .../dialogflow/v2/environments/client.rb | 14 ++-- .../dialogflow/v2/environments/rest/client.rb | 16 ++--- .../v2/environments/rest/service_stub.rb | 9 +++ .../dialogflow/v2/fulfillments/client.rb | 14 ++-- .../dialogflow/v2/fulfillments/rest/client.rb | 16 ++--- .../v2/fulfillments/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/v2/intents/client.rb | 14 ++-- .../dialogflow/v2/intents/rest/client.rb | 16 ++--- .../v2/intents/rest/service_stub.rb | 9 +++ .../dialogflow/v2/knowledge_bases/client.rb | 14 ++-- .../v2/knowledge_bases/rest/client.rb | 16 ++--- .../v2/knowledge_bases/rest/service_stub.rb | 9 +++ .../dialogflow/v2/participants/client.rb | 14 ++-- .../dialogflow/v2/participants/rest/client.rb | 16 ++--- .../v2/participants/rest/service_stub.rb | 9 +++ .../v2/session_entity_types/client.rb | 14 ++-- .../v2/session_entity_types/rest/client.rb | 16 ++--- .../session_entity_types/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/v2/sessions/client.rb | 14 ++-- .../dialogflow/v2/sessions/rest/client.rb | 16 ++--- .../v2/sessions/rest/service_stub.rb | 9 +++ .../cloud/dialogflow/v2/versions/client.rb | 14 ++-- .../dialogflow/v2/versions/rest/client.rb | 16 ++--- .../v2/versions/rest/service_stub.rb | 9 +++ .../dialogflow/v2/agents_operations_test.rb | 11 ++- .../cloud/dialogflow/v2/agents_paths_test.rb | 16 ++++- .../cloud/dialogflow/v2/agents_rest_test.rb | 11 ++- .../google/cloud/dialogflow/v2/agents_test.rb | 14 +++- .../v2/answer_records_paths_test.rb | 20 ++++-- .../dialogflow/v2/answer_records_rest_test.rb | 11 ++- .../dialogflow/v2/answer_records_test.rb | 11 ++- .../dialogflow/v2/contexts_paths_test.rb | 14 +++- .../cloud/dialogflow/v2/contexts_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/contexts_test.rb | 11 ++- .../conversation_datasets_operations_test.rb | 11 ++- .../v2/conversation_datasets_paths_test.rb | 14 +++- .../v2/conversation_datasets_rest_test.rb | 11 ++- .../v2/conversation_datasets_test.rb | 14 +++- .../v2/conversation_models_operations_test.rb | 11 ++- .../v2/conversation_models_paths_test.rb | 18 +++-- .../v2/conversation_models_rest_test.rb | 11 ++- .../dialogflow/v2/conversation_models_test.rb | 14 +++- .../conversation_profiles_operations_test.rb | 11 ++- .../v2/conversation_profiles_paths_test.rb | 26 ++++--- .../v2/conversation_profiles_rest_test.rb | 11 ++- .../v2/conversation_profiles_test.rb | 14 +++- .../dialogflow/v2/conversations_paths_test.rb | 30 +++++--- .../dialogflow/v2/conversations_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/conversations_test.rb | 11 ++- .../v2/documents_operations_test.rb | 11 ++- .../dialogflow/v2/documents_paths_test.rb | 14 +++- .../dialogflow/v2/documents_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/documents_test.rb | 14 +++- .../v2/entity_types_operations_test.rb | 11 ++- .../dialogflow/v2/entity_types_paths_test.rb | 14 +++- .../dialogflow/v2/entity_types_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/entity_types_test.rb | 14 +++- .../dialogflow/v2/environments_paths_test.rb | 18 +++-- .../dialogflow/v2/environments_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/environments_test.rb | 11 ++- .../dialogflow/v2/fulfillments_paths_test.rb | 12 +++- .../dialogflow/v2/fulfillments_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/fulfillments_test.rb | 11 ++- .../dialogflow/v2/intents_operations_test.rb | 11 ++- .../cloud/dialogflow/v2/intents_paths_test.rb | 16 ++++- .../cloud/dialogflow/v2/intents_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/intents_test.rb | 14 +++- .../v2/knowledge_bases_paths_test.rb | 16 ++++- .../v2/knowledge_bases_rest_test.rb | 11 ++- .../dialogflow/v2/knowledge_bases_test.rb | 11 ++- .../dialogflow/v2/participants_paths_test.rb | 20 ++++-- .../dialogflow/v2/participants_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/participants_test.rb | 11 ++- .../v2/session_entity_types_paths_test.rb | 14 +++- .../v2/session_entity_types_rest_test.rb | 11 ++- .../v2/session_entity_types_test.rb | 11 ++- .../dialogflow/v2/sessions_paths_test.rb | 16 ++++- .../cloud/dialogflow/v2/sessions_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/sessions_test.rb | 11 ++- .../dialogflow/v2/versions_paths_test.rb | 14 +++- .../cloud/dialogflow/v2/versions_rest_test.rb | 11 ++- .../cloud/dialogflow/v2/versions_test.rb | 11 ++- .../v1/completion_service/client.rb | 14 ++-- .../v1/completion_service/rest/client.rb | 14 ++-- .../completion_service/rest/service_stub.rb | 9 +++ .../conversational_search_service/client.rb | 14 ++-- .../rest/client.rb | 14 ++-- .../rest/service_stub.rb | 9 +++ .../v1/document_service/client.rb | 14 ++-- .../v1/document_service/rest/client.rb | 14 ++-- .../v1/document_service/rest/service_stub.rb | 9 +++ .../v1/schema_service/client.rb | 14 ++-- .../v1/schema_service/rest/client.rb | 14 ++-- .../v1/schema_service/rest/service_stub.rb | 9 +++ .../v1/search_service/client.rb | 14 ++-- .../v1/search_service/rest/client.rb | 14 ++-- .../v1/search_service/rest/service_stub.rb | 9 +++ .../v1/user_event_service/client.rb | 14 ++-- .../v1/user_event_service/rest/client.rb | 14 ++-- .../user_event_service/rest/service_stub.rb | 9 +++ .../v1/completion_service_paths_test.rb | 12 +++- .../v1/completion_service_rest_test.rb | 11 ++- .../v1/completion_service_test.rb | 11 ++- ...onversational_search_service_paths_test.rb | 16 ++++- ...conversational_search_service_rest_test.rb | 11 ++- .../v1/conversational_search_service_test.rb | 11 ++- .../v1/document_service_operations_test.rb | 11 ++- .../v1/document_service_paths_test.rb | 14 +++- .../v1/document_service_rest_test.rb | 11 ++- .../v1/document_service_test.rb | 14 +++- .../v1/schema_service_operations_test.rb | 11 ++- .../v1/schema_service_paths_test.rb | 14 +++- .../v1/schema_service_rest_test.rb | 11 ++- .../v1/schema_service_test.rb | 14 +++- .../v1/search_service_paths_test.rb | 14 +++- .../v1/search_service_rest_test.rb | 11 ++- .../v1/search_service_test.rb | 11 ++- .../v1/user_event_service_operations_test.rb | 11 ++- .../v1/user_event_service_paths_test.rb | 14 +++- .../v1/user_event_service_rest_test.rb | 11 ++- .../v1/user_event_service_test.rb | 14 +++- .../v1beta/completion_service/client.rb | 14 ++-- .../v1beta/completion_service/rest/client.rb | 14 ++-- .../completion_service/rest/service_stub.rb | 9 +++ .../conversational_search_service/client.rb | 14 ++-- .../rest/client.rb | 14 ++-- .../rest/service_stub.rb | 9 +++ .../v1beta/document_service/client.rb | 14 ++-- .../v1beta/document_service/rest/client.rb | 14 ++-- .../document_service/rest/service_stub.rb | 9 +++ .../v1beta/recommendation_service/client.rb | 14 ++-- .../recommendation_service/rest/client.rb | 14 ++-- .../rest/service_stub.rb | 9 +++ .../v1beta/schema_service/client.rb | 14 ++-- .../v1beta/schema_service/rest/client.rb | 14 ++-- .../schema_service/rest/service_stub.rb | 9 +++ .../v1beta/search_service/client.rb | 14 ++-- .../v1beta/search_service/rest/client.rb | 14 ++-- .../search_service/rest/service_stub.rb | 9 +++ .../v1beta/user_event_service/client.rb | 14 ++-- .../v1beta/user_event_service/rest/client.rb | 14 ++-- .../user_event_service/rest/service_stub.rb | 9 +++ .../v1beta/completion_service_paths_test.rb | 12 +++- .../v1beta/completion_service_rest_test.rb | 11 ++- .../v1beta/completion_service_test.rb | 11 ++- ...onversational_search_service_paths_test.rb | 16 ++++- ...conversational_search_service_rest_test.rb | 11 ++- .../conversational_search_service_test.rb | 11 ++- .../document_service_operations_test.rb | 11 ++- .../v1beta/document_service_paths_test.rb | 14 +++- .../v1beta/document_service_rest_test.rb | 11 ++- .../v1beta/document_service_test.rb | 14 +++- .../recommendation_service_paths_test.rb | 14 +++- .../recommendation_service_rest_test.rb | 11 ++- .../v1beta/recommendation_service_test.rb | 11 ++- .../v1beta/schema_service_operations_test.rb | 11 ++- .../v1beta/schema_service_paths_test.rb | 14 +++- .../v1beta/schema_service_rest_test.rb | 11 ++- .../v1beta/schema_service_test.rb | 14 +++- .../v1beta/search_service_paths_test.rb | 14 +++- .../v1beta/search_service_rest_test.rb | 11 ++- .../v1beta/search_service_test.rb | 11 ++- .../user_event_service_operations_test.rb | 11 ++- .../v1beta/user_event_service_paths_test.rb | 14 +++- .../v1beta/user_event_service_rest_test.rb | 11 ++- .../v1beta/user_event_service_test.rb | 14 +++- .../google/cloud/dlp/v2/dlp_service/client.rb | 14 ++-- .../cloud/dlp/v2/dlp_service/rest/client.rb | 14 ++-- .../dlp/v2/dlp_service/rest/service_stub.rb | 9 +++ .../cloud/dlp/v2/dlp_service_paths_test.rb | 30 +++++--- .../cloud/dlp/v2/dlp_service_rest_test.rb | 11 ++- .../google/cloud/dlp/v2/dlp_service_test.rb | 11 ++- .../v1/document_processor_service/client.rb | 14 ++-- .../document_processor_service/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ ...ument_processor_service_operations_test.rb | 11 ++- .../document_processor_service_paths_test.rb | 22 ++++-- .../document_processor_service_rest_test.rb | 11 ++- .../v1/document_processor_service_test.rb | 14 +++- .../document_processor_service/client.rb | 14 ++-- .../document_processor_service/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ .../v1beta3/document_service/client.rb | 14 ++-- .../v1beta3/document_service/rest/client.rb | 16 ++--- .../document_service/rest/service_stub.rb | 9 +++ ...ument_processor_service_operations_test.rb | 11 ++- .../document_processor_service_paths_test.rb | 22 ++++-- .../document_processor_service_rest_test.rb | 11 ++- .../document_processor_service_test.rb | 14 +++- .../document_service_operations_test.rb | 11 ++- .../v1beta3/document_service_paths_test.rb | 16 ++++- .../v1beta3/document_service_rest_test.rb | 11 ++- .../v1beta3/document_service_test.rb | 14 +++- .../domains/v1/domains/rest/service_stub.rb | 9 +++ .../domains/v1/domains_operations_test.rb | 11 ++- .../cloud/domains/v1/domains_paths_test.rb | 14 +++- .../cloud/domains/v1/domains_rest_test.rb | 11 ++- .../google/cloud/domains/v1/domains_test.rb | 14 +++- .../v1beta1/domains/rest/service_stub.rb | 9 +++ .../v1beta1/domains_operations_test.rb | 11 ++- .../domains/v1beta1/domains_paths_test.rb | 14 +++- .../domains/v1beta1/domains_rest_test.rb | 11 ++- .../cloud/domains/v1beta1/domains_test.rb | 14 +++- .../edge_network/v1/edge_network/client.rb | 14 ++-- .../v1/edge_network/rest/client.rb | 16 ++--- .../v1/edge_network/rest/service_stub.rb | 9 +++ .../v1/edge_network_operations_test.rb | 11 ++- .../v1/edge_network_paths_test.rb | 24 +++++-- .../edge_network/v1/edge_network_rest_test.rb | 11 ++- .../edge_network/v1/edge_network_test.rb | 14 +++- .../error_group_service/rest/service_stub.rb | 9 +++ .../error_stats_service/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1beta1/error_group_service_paths_test.rb | 12 +++- .../v1beta1/error_group_service_rest_test.rb | 11 ++- .../v1beta1/error_group_service_test.rb | 11 ++- .../v1beta1/error_stats_service_paths_test.rb | 12 +++- .../v1beta1/error_stats_service_rest_test.rb | 11 ++- .../v1beta1/error_stats_service_test.rb | 11 ++- .../report_errors_service_paths_test.rb | 12 +++- .../report_errors_service_rest_test.rb | 11 ++- .../v1beta1/report_errors_service_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../essential_contacts_service_paths_test.rb | 18 +++-- .../essential_contacts_service_rest_test.rb | 11 ++- .../v1/essential_contacts_service_test.rb | 11 ++- .../v1/publisher/rest/service_stub.rb | 9 +++ .../publishing/v1/publisher_rest_test.rb | 11 ++- .../eventarc/publishing/v1/publisher_test.rb | 11 ++- .../cloud/eventarc/v1/eventarc/client.rb | 28 ++++---- .../cloud/eventarc/v1/eventarc/rest/client.rb | 22 +++--- .../eventarc/v1/eventarc/rest/service_stub.rb | 9 +++ .../eventarc/v1/eventarc_operations_test.rb | 11 ++- .../cloud/eventarc/v1/eventarc_paths_test.rb | 32 ++++++--- .../cloud/eventarc/v1/eventarc_rest_test.rb | 11 ++- .../google/cloud/eventarc/v1/eventarc_test.rb | 14 +++- .../v1/cloud_filestore_manager/client.rb | 14 ++-- .../v1/cloud_filestore_manager/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ ...cloud_filestore_manager_operations_test.rb | 11 ++- .../v1/cloud_filestore_manager_paths_test.rb | 18 +++-- .../v1/cloud_filestore_manager_rest_test.rb | 11 ++- .../v1/cloud_filestore_manager_test.rb | 14 +++- .../admin/v1/firestore_admin/client.rb | 14 ++-- .../admin/v1/firestore_admin/rest/client.rb | 14 ++-- .../v1/firestore_admin/rest/service_stub.rb | 9 +++ .../v1/firestore_admin_operations_test.rb | 11 ++- .../admin/v1/firestore_admin_paths_test.rb | 20 ++++-- .../admin/v1/firestore_admin_rest_test.rb | 11 ++- .../admin/v1/firestore_admin_test.rb | 14 +++- .../cloud/firestore/v1/firestore/client.rb | 14 ++-- .../firestore/v1/firestore/rest/client.rb | 14 ++-- .../v1/firestore/rest/service_stub.rb | 9 +++ .../cloud/firestore/v1/firestore_rest_test.rb | 11 ++- .../cloud/firestore/v1/firestore_test.rb | 11 ++- .../v1/cloud_functions_service/client.rb | 28 ++++---- .../v1/cloud_functions_service/rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ ...cloud_functions_service_operations_test.rb | 11 ++- .../v1/cloud_functions_service_paths_test.rb | 18 +++-- .../v1/cloud_functions_service_rest_test.rb | 11 ++- .../v1/cloud_functions_service_test.rb | 14 +++- .../functions/v2/function_service/client.rb | 28 ++++---- .../v2/function_service/rest/client.rb | 22 +++--- .../v2/function_service/rest/service_stub.rb | 9 +++ .../v2/function_service_operations_test.rb | 11 ++- .../v2/function_service_paths_test.rb | 32 ++++++--- .../v2/function_service_rest_test.rb | 11 ++- .../functions/v2/function_service_test.rb | 14 +++- .../gke_backup/v1/backup_for_gke/client.rb | 28 ++++---- .../v1/backup_for_gke/rest/client.rb | 22 +++--- .../v1/backup_for_gke/rest/service_stub.rb | 9 +++ .../v1/backup_for_gke_operations_test.rb | 11 ++- .../v1/backup_for_gke_paths_test.rb | 28 +++++--- .../gke_backup/v1/backup_for_gke_rest_test.rb | 11 ++- .../gke_backup/v1/backup_for_gke_test.rb | 14 +++- .../gateway/v1beta1/gateway_service_test.rb | 11 ++- .../gke_hub/v1/gke_hub/rest/service_stub.rb | 9 +++ .../gke_hub/v1/gke_hub_operations_test.rb | 11 ++- .../cloud/gke_hub/v1/gke_hub_paths_test.rb | 16 ++++- .../cloud/gke_hub/v1/gke_hub_rest_test.rb | 11 ++- .../google/cloud/gke_hub/v1/gke_hub_test.rb | 14 +++- .../gke_hub_membership_service/client.rb | 28 ++++---- .../gke_hub_membership_service/rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ ..._hub_membership_service_operations_test.rb | 11 ++- .../gke_hub_membership_service_paths_test.rb | 14 +++- .../gke_hub_membership_service_rest_test.rb | 11 ++- .../gke_hub_membership_service_test.rb | 14 +++- .../v1/attached_clusters/rest/service_stub.rb | 9 +++ .../v1/aws_clusters/rest/service_stub.rb | 9 +++ .../v1/azure_clusters/rest/service_stub.rb | 9 +++ .../v1/attached_clusters_operations_test.rb | 11 ++- .../v1/attached_clusters_paths_test.rb | 16 ++++- .../v1/attached_clusters_rest_test.rb | 11 ++- .../v1/attached_clusters_test.rb | 14 +++- .../v1/aws_clusters_operations_test.rb | 11 ++- .../v1/aws_clusters_paths_test.rb | 18 +++-- .../v1/aws_clusters_rest_test.rb | 11 ++- .../gke_multi_cloud/v1/aws_clusters_test.rb | 14 +++- .../v1/azure_clusters_operations_test.rb | 11 ++- .../v1/azure_clusters_paths_test.rb | 20 ++++-- .../v1/azure_clusters_rest_test.rb | 11 ++- .../gke_multi_cloud/v1/azure_clusters_test.rb | 14 +++- .../v1/gsuite_add_ons/rest/service_stub.rb | 9 +++ .../v1/gsuite_add_ons_paths_test.rb | 18 +++-- .../v1/gsuite_add_ons_rest_test.rb | 11 ++- .../gsuite_add_ons/v1/gsuite_add_ons_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ ...ty_aware_proxy_admin_service_paths_test.rb | 14 +++- ...ity_aware_proxy_admin_service_rest_test.rb | 11 ++- ...identity_aware_proxy_admin_service_test.rb | 11 ++- ...ty_aware_proxy_o_auth_service_rest_test.rb | 11 ++- ...dentity_aware_proxy_o_auth_service_test.rb | 11 ++- .../cloud/ids/v1/ids/rest/service_stub.rb | 9 +++ .../cloud/ids/v1/ids_operations_test.rb | 11 ++- .../google/cloud/ids/v1/ids_paths_test.rb | 14 +++- .../test/google/cloud/ids/v1/ids_rest_test.rb | 11 ++- .../test/google/cloud/ids/v1/ids_test.rb | 14 +++- .../v1/device_manager/rest/service_stub.rb | 9 +++ .../cloud/iot/v1/device_manager_paths_test.rb | 16 ++++- .../cloud/iot/v1/device_manager_rest_test.rb | 11 ++- .../cloud/iot/v1/device_manager_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../key_tracking_service/rest/service_stub.rb | 9 +++ .../v1/key_dashboard_service_paths_test.rb | 12 +++- .../v1/key_dashboard_service_rest_test.rb | 11 ++- .../v1/key_dashboard_service_test.rb | 11 ++- .../v1/key_tracking_service_paths_test.rb | 14 +++- .../v1/key_tracking_service_rest_test.rb | 11 ++- .../inventory/v1/key_tracking_service_test.rb | 11 ++- .../google/cloud/kms/v1/ekm_service/client.rb | 28 ++++---- .../cloud/kms/v1/ekm_service/rest/client.rb | 22 +++--- .../kms/v1/ekm_service/rest/service_stub.rb | 9 +++ .../kms/v1/key_management_service/client.rb | 28 ++++---- .../v1/key_management_service/rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ .../cloud/kms/v1/ekm_service_paths_test.rb | 18 +++-- .../cloud/kms/v1/ekm_service_rest_test.rb | 11 ++- .../google/cloud/kms/v1/ekm_service_test.rb | 11 ++- .../v1/key_management_service_paths_test.rb | 20 ++++-- .../v1/key_management_service_rest_test.rb | 11 ++- .../kms/v1/key_management_service_test.rb | 11 ++- .../v1/language_service/rest/service_stub.rb | 9 +++ .../language/v1/language_service_rest_test.rb | 11 ++- .../language/v1/language_service_test.rb | 11 ++- .../language_service/rest/service_stub.rb | 9 +++ .../v1beta2/language_service_rest_test.rb | 11 ++- .../language/v1beta2/language_service_test.rb | 11 ++- .../v2/language_service/rest/service_stub.rb | 9 +++ .../language/v2/language_service_rest_test.rb | 11 ++- .../language/v2/language_service_test.rb | 11 ++- .../v2beta/workflows_service/client.rb | 14 ++-- .../v2beta/workflows_service/rest/client.rb | 16 ++--- .../workflows_service/rest/service_stub.rb | 9 +++ .../workflows_service_operations_test.rb | 11 ++- .../v2beta/workflows_service_rest_test.rb | 11 ++- .../v2beta/workflows_service_test.rb | 14 +++- .../v2/config_service_operations_test.rb | 11 ++- .../logging/v2/config_service_paths_test.rb | 40 +++++++---- .../cloud/logging/v2/config_service_test.rb | 14 +++- .../logging/v2/logging_service_paths_test.rb | 20 ++++-- .../cloud/logging/v2/logging_service_test.rb | 11 ++- .../logging/v2/metrics_service_paths_test.rb | 14 +++- .../cloud/logging/v2/metrics_service_test.rb | 11 ++- ...aged_identities_service_operations_test.rb | 11 ++- .../managed_identities_service_paths_test.rb | 14 +++- .../v1/managed_identities_service_test.rb | 14 +++- .../speech_translation_service_test.rb | 11 ++- .../memcache/v1/cloud_memcache/client.rb | 14 ++-- .../memcache/v1/cloud_memcache/rest/client.rb | 16 ++--- .../v1/cloud_memcache/rest/service_stub.rb | 9 +++ .../v1/cloud_memcache_operations_test.rb | 11 ++- .../memcache/v1/cloud_memcache_paths_test.rb | 14 +++- .../memcache/v1/cloud_memcache_rest_test.rb | 11 ++- .../cloud/memcache/v1/cloud_memcache_test.rb | 14 +++- .../memcache/v1beta2/cloud_memcache/client.rb | 14 ++-- .../v1beta2/cloud_memcache/rest/client.rb | 16 ++--- .../cloud_memcache/rest/service_stub.rb | 9 +++ .../v1beta2/cloud_memcache_operations_test.rb | 11 ++- .../v1beta2/cloud_memcache_paths_test.rb | 14 +++- .../v1beta2/cloud_memcache_rest_test.rb | 11 ++- .../memcache/v1beta2/cloud_memcache_test.rb | 14 +++- .../metastore/v1/dataproc_metastore/client.rb | 28 ++++---- .../v1/dataproc_metastore/rest/client.rb | 22 +++--- .../dataproc_metastore/rest/service_stub.rb | 9 +++ .../dataproc_metastore_federation/client.rb | 28 ++++---- .../rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ ...oc_metastore_federation_operations_test.rb | 11 ++- ...ataproc_metastore_federation_paths_test.rb | 14 +++- ...dataproc_metastore_federation_rest_test.rb | 11 ++- .../v1/dataproc_metastore_federation_test.rb | 14 +++- .../v1/dataproc_metastore_operations_test.rb | 11 ++- .../v1/dataproc_metastore_paths_test.rb | 22 ++++-- .../v1/dataproc_metastore_rest_test.rb | 11 ++- .../metastore/v1/dataproc_metastore_test.rb | 14 +++- .../v1beta/dataproc_metastore/client.rb | 28 ++++---- .../v1beta/dataproc_metastore/rest/client.rb | 22 +++--- .../dataproc_metastore/rest/service_stub.rb | 9 +++ .../dataproc_metastore_federation/client.rb | 28 ++++---- .../rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ ...oc_metastore_federation_operations_test.rb | 11 ++- ...ataproc_metastore_federation_paths_test.rb | 14 +++- ...dataproc_metastore_federation_rest_test.rb | 11 ++- .../dataproc_metastore_federation_test.rb | 14 +++- .../dataproc_metastore_operations_test.rb | 11 ++- .../v1beta/dataproc_metastore_paths_test.rb | 24 +++++-- .../v1beta/dataproc_metastore_rest_test.rb | 11 ++- .../v1beta/dataproc_metastore_test.rb | 14 +++- .../v1/migration_center/client.rb | 14 ++-- .../v1/migration_center/rest/client.rb | 16 ++--- .../v1/migration_center/rest/service_stub.rb | 9 +++ .../v1/migration_center_operations_test.rb | 11 ++- .../v1/migration_center_paths_test.rb | 32 ++++++--- .../v1/migration_center_rest_test.rb | 11 ++- .../v1/migration_center_test.rb | 14 +++- .../dashboards_service/rest/service_stub.rb | 9 +++ .../v1/dashboards_service_paths_test.rb | 16 ++++- .../v1/dashboards_service_rest_test.rb | 11 ++- .../dashboard/v1/dashboards_service_test.rb | 11 ++- .../v1/metrics_scopes_operations_test.rb | 11 ++- .../v1/metrics_scopes_paths_test.rb | 14 +++- .../metrics_scope/v1/metrics_scopes_test.rb | 14 +++- .../v3/alert_policy_service_paths_test.rb | 22 ++++-- .../v3/alert_policy_service_test.rb | 11 ++- .../monitoring/v3/group_service_paths_test.rb | 20 ++++-- .../cloud/monitoring/v3/group_service_test.rb | 11 ++- .../v3/metric_service_paths_test.rb | 22 ++++-- .../monitoring/v3/metric_service_test.rb | 11 ++- ...notification_channel_service_paths_test.rb | 22 ++++-- .../v3/notification_channel_service_test.rb | 11 ++- .../cloud/monitoring/v3/query_service_test.rb | 11 ++- .../service_monitoring_service_paths_test.rb | 22 ++++-- .../v3/service_monitoring_service_test.rb | 11 ++- .../v3/snooze_service_paths_test.rb | 18 +++-- .../monitoring/v3/snooze_service_test.rb | 11 ++- .../v3/uptime_check_service_paths_test.rb | 20 ++++-- .../v3/uptime_check_service_test.rb | 11 ++- .../google/cloud/netapp/v1/netapp/client.rb | 14 ++-- .../cloud/netapp/v1/netapp/rest/client.rb | 16 ++--- .../netapp/v1/netapp/rest/service_stub.rb | 9 +++ .../cloud/netapp/v1/netapp_operations_test.rb | 11 ++- .../cloud/netapp/v1/netapp_paths_test.rb | 32 ++++++--- .../cloud/netapp/v1/netapp_rest_test.rb | 11 ++- .../google/cloud/netapp/v1/netapp_test.rb | 14 +++- .../v1/hub_service/client.rb | 28 ++++---- .../v1/policy_based_routing_service/client.rb | 28 ++++---- .../v1/hub_service_operations_test.rb | 11 ++- .../v1/hub_service_paths_test.rb | 30 +++++--- .../v1/hub_service_test.rb | 14 +++- ...y_based_routing_service_operations_test.rb | 11 ++- ...policy_based_routing_service_paths_test.rb | 16 ++++- .../v1/policy_based_routing_service_test.rb | 14 +++- .../v1alpha1/hub_service_operations_test.rb | 11 ++- .../v1alpha1/hub_service_paths_test.rb | 22 ++++-- .../v1alpha1/hub_service_test.rb | 14 +++- .../reachability_service/rest/service_stub.rb | 9 +++ .../reachability_service_operations_test.rb | 11 ++- .../v1/reachability_service_paths_test.rb | 12 +++- .../v1/reachability_service_rest_test.rb | 11 ++- .../v1/reachability_service_test.rb | 14 +++- .../v1beta1/network_security/client.rb | 28 ++++---- .../v1beta1/network_security/rest/client.rb | 22 +++--- .../network_security/rest/service_stub.rb | 9 +++ .../network_security_operations_test.rb | 11 ++- .../v1beta1/network_security_paths_test.rb | 18 +++-- .../v1beta1/network_security_rest_test.rb | 11 ++- .../v1beta1/network_security_test.rb | 14 +++- .../v1/managed_notebook_service/client.rb | 28 ++++---- .../managed_notebook_service/rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ .../notebooks/v1/notebook_service/client.rb | 28 ++++---- .../v1/notebook_service/rest/client.rb | 22 +++--- .../v1/notebook_service/rest/service_stub.rb | 9 +++ ...anaged_notebook_service_operations_test.rb | 11 ++- .../v1/managed_notebook_service_paths_test.rb | 14 +++- .../v1/managed_notebook_service_rest_test.rb | 11 ++- .../v1/managed_notebook_service_test.rb | 14 +++- .../v1/notebook_service_operations_test.rb | 11 ++- .../v1/notebook_service_paths_test.rb | 20 ++++-- .../v1/notebook_service_rest_test.rb | 11 ++- .../notebooks/v1/notebook_service_test.rb | 14 +++- .../v1beta1/notebook_service/client.rb | 28 ++++---- .../notebook_service_operations_test.rb | 11 ++- .../v1beta1/notebook_service_paths_test.rb | 14 +++- .../v1beta1/notebook_service_test.rb | 14 +++- .../notebooks/v2/notebook_service/client.rb | 28 ++++---- .../v2/notebook_service/rest/client.rb | 22 +++--- .../v2/notebook_service/rest/service_stub.rb | 9 +++ .../v2/notebook_service_operations_test.rb | 11 ++- .../v2/notebook_service_paths_test.rb | 14 +++- .../v2/notebook_service_rest_test.rb | 11 ++- .../notebooks/v2/notebook_service_test.rb | 14 +++- .../v1/fleet_routing/rest/service_stub.rb | 9 +++ .../v1/fleet_routing_operations_test.rb | 11 ++- .../v1/fleet_routing_rest_test.rb | 11 ++- .../optimization/v1/fleet_routing_test.rb | 14 +++- .../v1/environments/rest/service_stub.rb | 9 +++ .../v1/image_versions/rest/service_stub.rb | 9 +++ .../v1/environments_operations_test.rb | 11 ++- .../service/v1/environments_paths_test.rb | 12 +++- .../service/v1/environments_rest_test.rb | 11 ++- .../airflow/service/v1/environments_test.rb | 14 +++- .../service/v1/image_versions_rest_test.rb | 11 ++- .../airflow/service/v1/image_versions_test.rb | 11 ++- .../v2/org_policy/rest/service_stub.rb | 9 +++ .../org_policy/v2/org_policy_paths_test.rb | 20 ++++-- .../org_policy/v2/org_policy_rest_test.rb | 11 ++- .../cloud/org_policy/v2/org_policy_test.rb | 11 ++- .../v1/os_config_service/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../v1/os_config_service_paths_test.rb | 16 ++++- .../v1/os_config_service_rest_test.rb | 11 ++- .../os_config/v1/os_config_service_test.rb | 11 ++- ...os_config_zonal_service_operations_test.rb | 11 ++- .../v1/os_config_zonal_service_paths_test.rb | 24 +++++-- .../v1/os_config_zonal_service_rest_test.rb | 11 ++- .../v1/os_config_zonal_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...os_config_zonal_service_operations_test.rb | 11 ++- .../os_config_zonal_service_paths_test.rb | 26 ++++--- .../os_config_zonal_service_rest_test.rb | 11 ++- .../v1alpha/os_config_zonal_service_test.rb | 14 +++- .../v1/os_login_service/rest/service_stub.rb | 9 +++ .../v1/os_login_service_paths_test.rb | 16 ++++- .../os_login/v1/os_login_service_rest_test.rb | 11 ++- .../os_login/v1/os_login_service_test.rb | 11 ++- .../os_login_service/rest/service_stub.rb | 9 +++ .../v1beta/os_login_service_paths_test.rb | 16 ++++- .../v1beta/os_login_service_rest_test.rb | 11 ++- .../os_login/v1beta/os_login_service_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../phishing_protection_service_paths_test.rb | 12 +++- .../phishing_protection_service_rest_test.rb | 11 ++- .../phishing_protection_service_test.rb | 11 ++- .../v1/simulator/rest/service_stub.rb | 9 +++ .../v1/simulator_operations_test.rb | 11 ++- .../v1/simulator_paths_test.rb | 12 +++- .../v1/simulator_rest_test.rb | 11 ++- .../policy_simulator/v1/simulator_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../iam/v3/policy_troubleshooter_rest_test.rb | 11 ++- .../iam/v3/policy_troubleshooter_test.rb | 11 ++- .../v1/iam_checker/rest/service_stub.rb | 9 +++ .../v1/iam_checker_rest_test.rb | 11 ++- .../v1/iam_checker_test.rb | 11 ++- .../private_catalog/rest/service_stub.rb | 9 +++ .../v1beta1/private_catalog_rest_test.rb | 11 ++- .../v1beta1/private_catalog_test.rb | 11 ++- .../v2/export_service/rest/service_stub.rb | 9 +++ .../v2/profiler_service/rest/service_stub.rb | 9 +++ .../profiler/v2/export_service_paths_test.rb | 12 +++- .../profiler/v2/export_service_rest_test.rb | 11 ++- .../cloud/profiler/v2/export_service_test.rb | 11 ++- .../v2/profiler_service_paths_test.rb | 14 +++- .../profiler/v2/profiler_service_rest_test.rb | 11 ++- .../profiler/v2/profiler_service_test.rb | 11 ++- .../cloud/pubsub/v1/publisher/client.rb | 14 ++-- .../cloud/pubsub/v1/schema_service/client.rb | 14 ++-- .../cloud/pubsub/v1/subscriber/client.rb | 14 ++-- .../cloud/pubsub/v1/publisher/helpers_test.rb | 12 +++- .../cloud/pubsub/v1/publisher_paths_test.rb | 18 +++-- .../google/cloud/pubsub/v1/publisher_test.rb | 11 ++- .../pubsub/v1/schema_service_paths_test.rb | 14 +++- .../cloud/pubsub/v1/schema_service_test.rb | 11 ++- .../pubsub/v1/subscriber/helpers_test.rb | 12 +++- .../cloud/pubsub/v1/subscriber_paths_test.rb | 18 +++-- .../google/cloud/pubsub/v1/subscriber_test.rb | 11 ++- .../v1/rapid_migration_assessment/client.rb | 14 ++-- .../rapid_migration_assessment/rest/client.rb | 16 ++--- .../rest/service_stub.rb | 9 +++ ...id_migration_assessment_operations_test.rb | 11 ++- .../rapid_migration_assessment_paths_test.rb | 16 ++++- .../rapid_migration_assessment_rest_test.rb | 11 ++- .../v1/rapid_migration_assessment_test.rb | 14 +++- ...recaptcha_enterprise_service_paths_test.rb | 22 ++++-- .../v1/recaptcha_enterprise_service_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ ...recaptcha_enterprise_service_paths_test.rb | 14 +++- .../recaptcha_enterprise_service_rest_test.rb | 11 ++- .../recaptcha_enterprise_service_test.rb | 11 ++- .../catalog_service/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../prediction_service/rest/service_stub.rb | 9 +++ .../user_event_service/rest/service_stub.rb | 9 +++ .../catalog_service_operations_test.rb | 11 ++- .../v1beta1/catalog_service_paths_test.rb | 14 +++- .../v1beta1/catalog_service_rest_test.rb | 11 ++- .../v1beta1/catalog_service_test.rb | 14 +++- .../prediction_api_key_registry_paths_test.rb | 14 +++- .../prediction_api_key_registry_rest_test.rb | 11 ++- .../prediction_api_key_registry_test.rb | 11 ++- .../v1beta1/prediction_service_paths_test.rb | 12 +++- .../v1beta1/prediction_service_rest_test.rb | 11 ++- .../v1beta1/prediction_service_test.rb | 11 ++- .../user_event_service_operations_test.rb | 11 ++- .../v1beta1/user_event_service_paths_test.rb | 12 +++- .../v1beta1/user_event_service_rest_test.rb | 11 ++- .../v1beta1/user_event_service_test.rb | 14 +++- .../v1/recommender/rest/service_stub.rb | 9 +++ .../recommender/v1/recommender_paths_test.rb | 22 ++++-- .../recommender/v1/recommender_rest_test.rb | 11 ++- .../cloud/recommender/v1/recommender_test.rb | 11 ++- .../cluster/v1/cloud_redis_cluster/client.rb | 14 ++-- .../v1/cloud_redis_cluster/rest/client.rb | 16 ++--- .../cloud_redis_cluster/rest/service_stub.rb | 9 +++ .../v1/cloud_redis_cluster_operations_test.rb | 11 ++- .../v1/cloud_redis_cluster_paths_test.rb | 14 +++- .../v1/cloud_redis_cluster_rest_test.rb | 11 ++- .../cluster/v1/cloud_redis_cluster_test.rb | 14 +++- .../cloud/redis/v1/cloud_redis/client.rb | 14 ++-- .../cloud/redis/v1/cloud_redis/rest/client.rb | 16 ++--- .../redis/v1/cloud_redis/rest/service_stub.rb | 9 +++ .../redis/v1/cloud_redis_operations_test.rb | 11 ++- .../cloud/redis/v1/cloud_redis_paths_test.rb | 14 +++- .../cloud/redis/v1/cloud_redis_rest_test.rb | 11 ++- .../google/cloud/redis/v1/cloud_redis_test.rb | 14 +++- .../v1beta1/cloud_redis/rest/service_stub.rb | 9 +++ .../v1beta1/cloud_redis_operations_test.rb | 11 ++- .../redis/v1beta1/cloud_redis_paths_test.rb | 14 +++- .../redis/v1beta1/cloud_redis_rest_test.rb | 11 ++- .../cloud/redis/v1beta1/cloud_redis_test.rb | 14 +++- .../v3/folders/rest/service_stub.rb | 9 +++ .../v3/organizations/rest/service_stub.rb | 9 +++ .../v3/projects/rest/service_stub.rb | 9 +++ .../v3/tag_bindings/rest/service_stub.rb | 9 +++ .../v3/tag_holds/rest/service_stub.rb | 9 +++ .../v3/tag_keys/rest/service_stub.rb | 9 +++ .../v3/tag_values/rest/service_stub.rb | 9 +++ .../v3/folders_operations_test.rb | 11 ++- .../resource_manager/v3/folders_paths_test.rb | 12 +++- .../resource_manager/v3/folders_rest_test.rb | 11 ++- .../cloud/resource_manager/v3/folders_test.rb | 14 +++- .../v3/organizations_paths_test.rb | 12 +++- .../v3/organizations_rest_test.rb | 11 ++- .../resource_manager/v3/organizations_test.rb | 11 ++- .../v3/projects_operations_test.rb | 11 ++- .../v3/projects_paths_test.rb | 12 +++- .../resource_manager/v3/projects_rest_test.rb | 11 ++- .../resource_manager/v3/projects_test.rb | 14 +++- .../v3/tag_bindings_operations_test.rb | 11 ++- .../v3/tag_bindings_paths_test.rb | 12 +++- .../v3/tag_bindings_rest_test.rb | 11 ++- .../resource_manager/v3/tag_bindings_test.rb | 14 +++- .../v3/tag_holds_operations_test.rb | 11 ++- .../v3/tag_holds_paths_test.rb | 14 +++- .../v3/tag_holds_rest_test.rb | 11 ++- .../resource_manager/v3/tag_holds_test.rb | 14 +++- .../v3/tag_keys_operations_test.rb | 11 ++- .../v3/tag_keys_paths_test.rb | 12 +++- .../resource_manager/v3/tag_keys_rest_test.rb | 11 ++- .../resource_manager/v3/tag_keys_test.rb | 14 +++- .../v3/tag_values_operations_test.rb | 11 ++- .../v3/tag_values_paths_test.rb | 12 +++- .../v3/tag_values_rest_test.rb | 11 ++- .../resource_manager/v3/tag_values_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../resource_settings_service_paths_test.rb | 12 +++- .../v1/resource_settings_service_rest_test.rb | 11 ++- .../v1/resource_settings_service_test.rb | 11 ++- .../cloud/retail/v2/catalog_service/client.rb | 14 ++-- .../retail/v2/catalog_service/rest/client.rb | 14 ++-- .../v2/catalog_service/rest/service_stub.rb | 9 +++ .../retail/v2/completion_service/client.rb | 14 ++-- .../v2/completion_service/rest/client.rb | 14 ++-- .../completion_service/rest/service_stub.rb | 9 +++ .../cloud/retail/v2/control_service/client.rb | 14 ++-- .../retail/v2/control_service/rest/client.rb | 14 ++-- .../v2/control_service/rest/service_stub.rb | 9 +++ .../cloud/retail/v2/model_service/client.rb | 14 ++-- .../retail/v2/model_service/rest/client.rb | 14 ++-- .../v2/model_service/rest/service_stub.rb | 9 +++ .../retail/v2/prediction_service/client.rb | 14 ++-- .../v2/prediction_service/rest/client.rb | 14 ++-- .../prediction_service/rest/service_stub.rb | 9 +++ .../cloud/retail/v2/product_service/client.rb | 14 ++-- .../retail/v2/product_service/rest/client.rb | 14 ++-- .../v2/product_service/rest/service_stub.rb | 9 +++ .../cloud/retail/v2/search_service/client.rb | 14 ++-- .../retail/v2/search_service/rest/client.rb | 14 ++-- .../v2/search_service/rest/service_stub.rb | 9 +++ .../v2/serving_config_service/client.rb | 14 ++-- .../v2/serving_config_service/rest/client.rb | 14 ++-- .../rest/service_stub.rb | 9 +++ .../retail/v2/user_event_service/client.rb | 14 ++-- .../v2/user_event_service/rest/client.rb | 14 ++-- .../user_event_service/rest/service_stub.rb | 9 +++ .../retail/v2/catalog_service_paths_test.rb | 20 ++++-- .../retail/v2/catalog_service_rest_test.rb | 11 ++- .../cloud/retail/v2/catalog_service_test.rb | 11 ++- .../v2/completion_service_operations_test.rb | 11 ++- .../v2/completion_service_paths_test.rb | 12 +++- .../retail/v2/completion_service_rest_test.rb | 11 ++- .../retail/v2/completion_service_test.rb | 14 +++- .../retail/v2/control_service_paths_test.rb | 14 +++- .../retail/v2/control_service_rest_test.rb | 11 ++- .../cloud/retail/v2/control_service_test.rb | 11 ++- .../v2/model_service_operations_test.rb | 11 ++- .../retail/v2/model_service_paths_test.rb | 14 +++- .../retail/v2/model_service_rest_test.rb | 11 ++- .../cloud/retail/v2/model_service_test.rb | 14 +++- .../v2/prediction_service_paths_test.rb | 12 +++- .../retail/v2/prediction_service_rest_test.rb | 11 ++- .../retail/v2/prediction_service_test.rb | 11 ++- .../v2/product_service_operations_test.rb | 11 ++- .../retail/v2/product_service_paths_test.rb | 14 +++- .../retail/v2/product_service_rest_test.rb | 11 ++- .../cloud/retail/v2/product_service_test.rb | 14 +++- .../retail/v2/search_service_paths_test.rb | 12 +++- .../retail/v2/search_service_rest_test.rb | 11 ++- .../cloud/retail/v2/search_service_test.rb | 11 ++- .../v2/serving_config_service_paths_test.rb | 14 +++- .../v2/serving_config_service_rest_test.rb | 11 ++- .../retail/v2/serving_config_service_test.rb | 11 ++- .../v2/user_event_service_operations_test.rb | 11 ++- .../v2/user_event_service_paths_test.rb | 14 +++- .../retail/v2/user_event_service_rest_test.rb | 11 ++- .../retail/v2/user_event_service_test.rb | 14 +++- .../google/cloud/run/v2/executions/client.rb | 14 ++-- .../cloud/run/v2/executions/rest/client.rb | 14 ++-- .../run/v2/executions/rest/service_stub.rb | 9 +++ .../lib/google/cloud/run/v2/jobs/client.rb | 14 ++-- .../google/cloud/run/v2/jobs/rest/client.rb | 14 ++-- .../cloud/run/v2/jobs/rest/service_stub.rb | 9 +++ .../google/cloud/run/v2/revisions/client.rb | 14 ++-- .../cloud/run/v2/revisions/rest/client.rb | 14 ++-- .../run/v2/revisions/rest/service_stub.rb | 9 +++ .../google/cloud/run/v2/services/client.rb | 14 ++-- .../cloud/run/v2/services/rest/client.rb | 14 ++-- .../run/v2/services/rest/service_stub.rb | 9 +++ .../lib/google/cloud/run/v2/tasks/client.rb | 14 ++-- .../google/cloud/run/v2/tasks/rest/client.rb | 14 ++-- .../cloud/run/v2/tasks/rest/service_stub.rb | 9 +++ .../run/v2/executions_operations_test.rb | 11 ++- .../cloud/run/v2/executions_paths_test.rb | 14 +++- .../cloud/run/v2/executions_rest_test.rb | 11 ++- .../google/cloud/run/v2/executions_test.rb | 14 +++- .../cloud/run/v2/jobs_operations_test.rb | 11 ++- .../google/cloud/run/v2/jobs_paths_test.rb | 24 +++++-- .../google/cloud/run/v2/jobs_rest_test.rb | 11 ++- .../test/google/cloud/run/v2/jobs_test.rb | 14 +++- .../cloud/run/v2/revisions_operations_test.rb | 11 ++- .../cloud/run/v2/revisions_paths_test.rb | 14 +++- .../cloud/run/v2/revisions_rest_test.rb | 11 ++- .../google/cloud/run/v2/revisions_test.rb | 14 +++- .../cloud/run/v2/services_operations_test.rb | 11 ++- .../cloud/run/v2/services_paths_test.rb | 24 +++++-- .../google/cloud/run/v2/services_rest_test.rb | 11 ++- .../test/google/cloud/run/v2/services_test.rb | 14 +++- .../google/cloud/run/v2/tasks_paths_test.rb | 14 +++- .../google/cloud/run/v2/tasks_rest_test.rb | 11 ++- .../test/google/cloud/run/v2/tasks_test.rb | 11 ++- .../scheduler/v1/cloud_scheduler/client.rb | 14 ++-- .../v1/cloud_scheduler/rest/client.rb | 16 ++--- .../v1/cloud_scheduler/rest/service_stub.rb | 9 +++ .../v1/cloud_scheduler_paths_test.rb | 16 ++++- .../scheduler/v1/cloud_scheduler_rest_test.rb | 11 ++- .../scheduler/v1/cloud_scheduler_test.rb | 11 ++- .../v1beta1/cloud_scheduler/client.rb | 14 ++-- .../v1beta1/cloud_scheduler/rest/client.rb | 16 ++--- .../cloud_scheduler/rest/service_stub.rb | 9 +++ .../v1beta1/cloud_scheduler_paths_test.rb | 16 ++++- .../v1beta1/cloud_scheduler_rest_test.rb | 11 ++- .../scheduler/v1beta1/cloud_scheduler_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../v1/secret_manager_service_paths_test.rb | 18 +++-- .../v1/secret_manager_service_rest_test.rb | 11 ++- .../v1/secret_manager_service_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ .../secret_manager_service_paths_test.rb | 16 ++++- .../secret_manager_service_rest_test.rb | 11 ++- .../v1beta1/secret_manager_service_test.rb | 11 ++- .../v1/secure_source_manager/client.rb | 28 ++++---- .../v1/secure_source_manager/rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ .../secure_source_manager_operations_test.rb | 11 ++- .../v1/secure_source_manager_paths_test.rb | 18 +++-- .../v1/secure_source_manager_rest_test.rb | 11 ++- .../v1/secure_source_manager_test.rb | 14 +++- .../certificate_authority_service/client.rb | 28 ++++---- .../rest/client.rb | 22 +++--- .../rest/service_stub.rb | 9 +++ ...icate_authority_service_operations_test.rb | 11 ++- ...ertificate_authority_service_paths_test.rb | 22 ++++-- ...certificate_authority_service_rest_test.rb | 11 ++- .../v1/certificate_authority_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...icate_authority_service_operations_test.rb | 11 ++- ...ertificate_authority_service_paths_test.rb | 20 ++++-- ...certificate_authority_service_rest_test.rb | 11 ++- .../certificate_authority_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...ertificate_authority_service_paths_test.rb | 14 +++- ...certificate_authority_service_rest_test.rb | 11 ++- ...blic_certificate_authority_service_test.rb | 11 ++- .../v1/security_center/rest/service_stub.rb | 9 +++ .../v1/security_center_operations_test.rb | 11 ++- .../v1/security_center_paths_test.rb | 44 +++++++----- .../v1/security_center_rest_test.rb | 11 ++- .../v1/security_center_test.rb | 14 +++- .../security_center/rest/service_stub.rb | 9 +++ .../security_center_operations_test.rb | 11 ++- .../v1p1beta1/security_center_paths_test.rb | 28 +++++--- .../v1p1beta1/security_center_rest_test.rb | 11 ++- .../v1p1beta1/security_center_test.rb | 14 +++- .../v1/quota_controller/rest/service_stub.rb | 9 +++ .../service_controller/rest/service_stub.rb | 9 +++ .../v1/quota_controller_rest_test.rb | 11 ++- .../v1/quota_controller_test.rb | 11 ++- .../v1/service_controller_rest_test.rb | 11 ++- .../v1/service_controller_test.rb | 11 ++- .../v1/lookup_service/client.rb | 14 ++-- .../v1/lookup_service/rest/client.rb | 16 ++--- .../v1/lookup_service/rest/service_stub.rb | 9 +++ .../v1/registration_service/client.rb | 14 ++-- .../v1/registration_service/rest/client.rb | 16 ++--- .../registration_service/rest/service_stub.rb | 9 +++ .../v1/lookup_service_paths_test.rb | 12 +++- .../v1/lookup_service_rest_test.rb | 11 ++- .../v1/lookup_service_test.rb | 11 ++- .../v1/registration_service_paths_test.rb | 20 ++++-- .../v1/registration_service_rest_test.rb | 11 ++- .../v1/registration_service_test.rb | 11 ++- .../v1beta1/lookup_service/client.rb | 14 ++-- .../v1beta1/lookup_service/rest/client.rb | 16 ++--- .../lookup_service/rest/service_stub.rb | 9 +++ .../v1beta1/registration_service/client.rb | 14 ++-- .../registration_service/rest/client.rb | 16 ++--- .../registration_service/rest/service_stub.rb | 9 +++ .../v1beta1/lookup_service_paths_test.rb | 12 +++- .../v1beta1/lookup_service_rest_test.rb | 11 ++- .../v1beta1/lookup_service_test.rb | 11 ++- .../registration_service_paths_test.rb | 20 ++++-- .../v1beta1/registration_service_rest_test.rb | 11 ++- .../v1beta1/registration_service_test.rb | 11 ++- .../v1/service_manager/client.rb | 14 ++-- .../v1/service_manager/rest/client.rb | 16 ++--- .../v1/service_manager/rest/service_stub.rb | 9 +++ .../v1/service_manager_operations_test.rb | 11 ++- .../v1/service_manager_rest_test.rb | 11 ++- .../v1/service_manager_test.rb | 14 +++- .../v1/service_usage/rest/service_stub.rb | 9 +++ .../v1/service_usage_operations_test.rb | 11 ++- .../v1/service_usage_rest_test.rb | 11 ++- .../service_usage/v1/service_usage_test.rb | 14 +++- .../cloud_shell_service/rest/service_stub.rb | 9 +++ .../v1/cloud_shell_service_operations_test.rb | 11 ++- .../v1/cloud_shell_service_paths_test.rb | 12 +++- .../shell/v1/cloud_shell_service_rest_test.rb | 11 ++- .../shell/v1/cloud_shell_service_test.rb | 14 +++- .../v1/database_admin/rest/service_stub.rb | 9 +++ .../v1/database_admin_operations_test.rb | 11 ++- .../database/v1/database_admin_paths_test.rb | 20 ++++-- .../database/v1/database_admin_rest_test.rb | 11 ++- .../admin/database/v1/database_admin_test.rb | 14 +++- .../v1/instance_admin/rest/service_stub.rb | 9 +++ .../v1/instance_admin_operations_test.rb | 11 ++- .../instance/v1/instance_admin_paths_test.rb | 16 ++++- .../instance/v1/instance_admin_rest_test.rb | 11 ++- .../admin/instance/v1/instance_admin_test.rb | 14 +++- .../cloud/spanner/v1/spanner_paths_test.rb | 14 +++- .../google/cloud/spanner/v1/spanner_test.rb | 11 ++- .../speech/v1/adaptation/rest/service_stub.rb | 9 +++ .../speech/v1/speech/rest/service_stub.rb | 9 +++ .../cloud/speech/v1/adaptation_paths_test.rb | 16 ++++- .../cloud/speech/v1/adaptation_rest_test.rb | 11 ++- .../google/cloud/speech/v1/adaptation_test.rb | 11 ++- .../cloud/speech/v1/speech_operations_test.rb | 11 ++- .../cloud/speech/v1/speech_paths_test.rb | 14 +++- .../cloud/speech/v1/speech_rest_test.rb | 11 ++- .../google/cloud/speech/v1/speech_test.rb | 14 +++- .../v1p1beta1/adaptation/rest/service_stub.rb | 9 +++ .../v1p1beta1/speech/rest/service_stub.rb | 9 +++ .../speech/v1p1beta1/adaptation_paths_test.rb | 16 ++++- .../speech/v1p1beta1/adaptation_rest_test.rb | 11 ++- .../cloud/speech/v1p1beta1/adaptation_test.rb | 11 ++- .../v1p1beta1/speech_operations_test.rb | 11 ++- .../speech/v1p1beta1/speech_paths_test.rb | 14 +++- .../speech/v1p1beta1/speech_rest_test.rb | 11 ++- .../cloud/speech/v1p1beta1/speech_test.rb | 14 +++- .../google/cloud/speech/v2/speech/client.rb | 14 ++-- .../cloud/speech/v2/speech/rest/client.rb | 16 ++--- .../speech/v2/speech/rest/service_stub.rb | 9 +++ .../cloud/speech/v2/speech_operations_test.rb | 11 ++- .../cloud/speech/v2/speech_paths_test.rb | 24 +++++-- .../cloud/speech/v2/speech_rest_test.rb | 11 ++- .../google/cloud/speech/v2/speech_test.rb | 14 +++- .../v1/storage_insights/client.rb | 14 ++-- .../v1/storage_insights/rest/client.rb | 16 ++--- .../v1/storage_insights/rest/service_stub.rb | 9 +++ .../v1/storage_insights_paths_test.rb | 16 ++++- .../v1/storage_insights_rest_test.rb | 11 ++- .../v1/storage_insights_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ ...torage_transfer_service_operations_test.rb | 11 ++- .../v1/storage_transfer_service_paths_test.rb | 12 +++- .../v1/storage_transfer_service_rest_test.rb | 11 ++- .../v1/storage_transfer_service_test.rb | 14 +++- .../v2/case_attachment_service_paths_test.rb | 12 +++- .../v2/case_attachment_service_test.rb | 11 ++- .../support/v2/case_service_paths_test.rb | 16 ++++- .../cloud/support/v2/case_service_test.rb | 11 ++- .../support/v2/comment_service_paths_test.rb | 14 +++- .../cloud/support/v2/comment_service_test.rb | 11 ++- .../v4/company_service/rest/service_stub.rb | 9 +++ .../talent/v4/completion/rest/service_stub.rb | 9 +++ .../v4/event_service/rest/service_stub.rb | 9 +++ .../v4/job_service/rest/service_stub.rb | 9 +++ .../v4/tenant_service/rest/service_stub.rb | 9 +++ .../talent/v4/company_service_paths_test.rb | 14 +++- .../talent/v4/company_service_rest_test.rb | 11 ++- .../cloud/talent/v4/company_service_test.rb | 11 ++- .../cloud/talent/v4/completion_paths_test.rb | 14 +++- .../cloud/talent/v4/completion_rest_test.rb | 11 ++- .../google/cloud/talent/v4/completion_test.rb | 11 ++- .../talent/v4/event_service_paths_test.rb | 12 +++- .../talent/v4/event_service_rest_test.rb | 11 ++- .../cloud/talent/v4/event_service_test.rb | 11 ++- .../talent/v4/job_service_operations_test.rb | 11 ++- .../cloud/talent/v4/job_service_paths_test.rb | 16 ++++- .../cloud/talent/v4/job_service_rest_test.rb | 11 ++- .../cloud/talent/v4/job_service_test.rb | 14 +++- .../talent/v4/tenant_service_paths_test.rb | 14 +++- .../talent/v4/tenant_service_rest_test.rb | 11 ++- .../cloud/talent/v4/tenant_service_test.rb | 11 ++- .../company_service/rest/service_stub.rb | 9 +++ .../v4beta1/completion/rest/service_stub.rb | 9 +++ .../event_service/rest/service_stub.rb | 9 +++ .../v4beta1/job_service/rest/service_stub.rb | 9 +++ .../tenant_service/rest/service_stub.rb | 9 +++ .../v4beta1/company_service_paths_test.rb | 16 ++++- .../v4beta1/company_service_rest_test.rb | 11 ++- .../talent/v4beta1/company_service_test.rb | 11 ++- .../talent/v4beta1/completion_paths_test.rb | 16 ++++- .../talent/v4beta1/completion_rest_test.rb | 11 ++- .../cloud/talent/v4beta1/completion_test.rb | 11 ++- .../v4beta1/event_service_paths_test.rb | 14 +++- .../talent/v4beta1/event_service_rest_test.rb | 11 ++- .../talent/v4beta1/event_service_test.rb | 11 ++- .../v4beta1/job_service_operations_test.rb | 11 ++- .../talent/v4beta1/job_service_paths_test.rb | 18 +++-- .../talent/v4beta1/job_service_rest_test.rb | 11 ++- .../cloud/talent/v4beta1/job_service_test.rb | 14 +++- .../v4beta1/tenant_service_paths_test.rb | 14 +++- .../v4beta1/tenant_service_rest_test.rb | 11 ++- .../talent/v4beta1/tenant_service_test.rb | 11 ++- .../cloud/tasks/v2/cloud_tasks/client.rb | 14 ++-- .../cloud/tasks/v2/cloud_tasks/rest/client.rb | 16 ++--- .../tasks/v2/cloud_tasks/rest/service_stub.rb | 9 +++ .../cloud/tasks/v2/cloud_tasks_paths_test.rb | 16 ++++- .../cloud/tasks/v2/cloud_tasks_rest_test.rb | 11 ++- .../google/cloud/tasks/v2/cloud_tasks_test.rb | 11 ++- .../cloud/tasks/v2beta2/cloud_tasks/client.rb | 14 ++-- .../tasks/v2beta2/cloud_tasks/rest/client.rb | 16 ++--- .../v2beta2/cloud_tasks/rest/service_stub.rb | 9 +++ .../tasks/v2beta2/cloud_tasks_paths_test.rb | 16 ++++- .../tasks/v2beta2/cloud_tasks_rest_test.rb | 11 ++- .../cloud/tasks/v2beta2/cloud_tasks_test.rb | 11 ++- .../cloud/tasks/v2beta3/cloud_tasks/client.rb | 14 ++-- .../tasks/v2beta3/cloud_tasks/rest/client.rb | 16 ++--- .../v2beta3/cloud_tasks/rest/service_stub.rb | 9 +++ .../tasks/v2beta3/cloud_tasks_paths_test.rb | 16 ++++- .../tasks/v2beta3/cloud_tasks_rest_test.rb | 11 ++- .../cloud/tasks/v2beta3/cloud_tasks_test.rb | 11 ++- .../v1/telco_automation/client.rb | 14 ++-- .../v1/telco_automation/rest/client.rb | 16 ++--- .../v1/telco_automation/rest/service_stub.rb | 9 +++ .../v1/telco_automation_operations_test.rb | 11 ++- .../v1/telco_automation_paths_test.rb | 24 +++++-- .../v1/telco_automation_rest_test.rb | 11 ++- .../v1/telco_automation_test.rb | 14 +++- .../v1/text_to_speech/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ ...h_long_audio_synthesize_operations_test.rb | 11 ++- ...speech_long_audio_synthesize_paths_test.rb | 12 +++- ..._speech_long_audio_synthesize_rest_test.rb | 11 ++- ...xt_to_speech_long_audio_synthesize_test.rb | 14 +++- .../v1/text_to_speech_paths_test.rb | 12 +++- .../v1/text_to_speech_rest_test.rb | 11 ++- .../text_to_speech/v1/text_to_speech_test.rb | 11 ++- .../text_to_speech/rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ ...h_long_audio_synthesize_operations_test.rb | 11 ++- ...speech_long_audio_synthesize_paths_test.rb | 12 +++- ..._speech_long_audio_synthesize_rest_test.rb | 11 ++- ...xt_to_speech_long_audio_synthesize_test.rb | 14 +++- .../v1beta1/text_to_speech_paths_test.rb | 12 +++- .../v1beta1/text_to_speech_rest_test.rb | 11 ++- .../v1beta1/text_to_speech_test.rb | 11 ++- .../lib/google/cloud/tpu/v1/tpu/client.rb | 14 ++-- .../cloud/tpu/v1/tpu_operations_test.rb | 11 ++- .../google/cloud/tpu/v1/tpu_paths_test.rb | 18 +++-- .../test/google/cloud/tpu/v1/tpu_test.rb | 14 +++- .../v1/trace_service/rest/service_stub.rb | 9 +++ .../cloud/trace/v1/trace_service_rest_test.rb | 11 ++- .../cloud/trace/v1/trace_service_test.rb | 11 ++- .../v2/trace_service/rest/service_stub.rb | 9 +++ .../trace/v2/trace_service_paths_test.rb | 14 +++- .../cloud/trace/v2/trace_service_rest_test.rb | 11 ++- .../cloud/trace/v2/trace_service_test.rb | 11 ++- .../translation_service/rest/service_stub.rb | 9 +++ .../v3/translation_service_operations_test.rb | 11 ++- .../v3/translation_service_paths_test.rb | 18 +++-- .../v3/translation_service_rest_test.rb | 11 ++- .../translate/v3/translation_service_test.rb | 14 +++- .../v1/livestream_service/client.rb | 14 ++-- .../v1/livestream_service/rest/client.rb | 16 ++--- .../livestream_service/rest/service_stub.rb | 9 +++ .../v1/livestream_service_operations_test.rb | 11 ++- .../v1/livestream_service_paths_test.rb | 26 ++++--- .../v1/livestream_service_rest_test.rb | 11 ++- .../live_stream/v1/livestream_service_test.rb | 14 +++- .../video_stitcher_service_operations_test.rb | 11 ++- .../v1/video_stitcher_service_paths_test.rb | 28 +++++--- .../v1/video_stitcher_service_test.rb | 14 +++- .../transcoder_service/rest/service_stub.rb | 9 +++ .../v1/transcoder_service_paths_test.rb | 16 ++++- .../v1/transcoder_service_rest_test.rb | 11 ++- .../transcoder/v1/transcoder_service_test.rb | 11 ++- .../rest/service_stub.rb | 9 +++ ...eo_intelligence_service_operations_test.rb | 11 ++- .../video_intelligence_service_rest_test.rb | 11 ++- .../v1/video_intelligence_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...eo_intelligence_service_operations_test.rb | 11 ++- .../video_intelligence_service_rest_test.rb | 11 ++- .../video_intelligence_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...eo_intelligence_service_operations_test.rb | 11 ++- .../video_intelligence_service_rest_test.rb | 11 ++- .../video_intelligence_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...eo_intelligence_service_operations_test.rb | 11 ++- .../video_intelligence_service_rest_test.rb | 11 ++- .../video_intelligence_service_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ ...reaming_video_intelligence_service_test.rb | 11 ++- ...eo_intelligence_service_operations_test.rb | 11 ++- .../video_intelligence_service_rest_test.rb | 11 ++- .../video_intelligence_service_test.rb | 14 +++- .../v1/image_annotator/rest/service_stub.rb | 9 +++ .../v1/product_search/rest/service_stub.rb | 9 +++ .../v1/image_annotator_operations_test.rb | 11 ++- .../vision/v1/image_annotator_paths_test.rb | 12 +++- .../vision/v1/image_annotator_rest_test.rb | 11 ++- .../cloud/vision/v1/image_annotator_test.rb | 14 +++- .../v1/product_search_operations_test.rb | 11 ++- .../vision/v1/product_search_paths_test.rb | 18 +++-- .../vision/v1/product_search_rest_test.rb | 11 ++- .../cloud/vision/v1/product_search_test.rb | 14 +++- .../image_annotator/rest/service_stub.rb | 9 +++ .../product_search/rest/service_stub.rb | 9 +++ .../image_annotator_operations_test.rb | 11 ++- .../v1p3beta1/image_annotator_paths_test.rb | 12 +++- .../v1p3beta1/image_annotator_rest_test.rb | 11 ++- .../vision/v1p3beta1/image_annotator_test.rb | 14 +++- .../product_search_operations_test.rb | 11 ++- .../v1p3beta1/product_search_paths_test.rb | 18 +++-- .../v1p3beta1/product_search_rest_test.rb | 11 ++- .../vision/v1p3beta1/product_search_test.rb | 14 +++- .../image_annotator/rest/service_stub.rb | 9 +++ .../product_search/rest/service_stub.rb | 9 +++ .../image_annotator_operations_test.rb | 11 ++- .../v1p4beta1/image_annotator_paths_test.rb | 12 +++- .../v1p4beta1/image_annotator_rest_test.rb | 11 ++- .../vision/v1p4beta1/image_annotator_test.rb | 14 +++- .../product_search_operations_test.rb | 11 ++- .../v1p4beta1/product_search_paths_test.rb | 18 +++-- .../v1p4beta1/product_search_rest_test.rb | 11 ++- .../vision/v1p4beta1/product_search_test.rb | 14 +++- .../vm_migration/v1/vm_migration/client.rb | 28 ++++---- .../v1/vm_migration/rest/client.rb | 22 +++--- .../v1/vm_migration/rest/service_stub.rb | 9 +++ .../v1/vm_migration_operations_test.rb | 11 ++- .../v1/vm_migration_paths_test.rb | 30 +++++--- .../vm_migration/v1/vm_migration_rest_test.rb | 11 ++- .../vm_migration/v1/vm_migration_test.rb | 14 +++- .../vmware_engine/v1/vmware_engine/client.rb | 28 ++++---- .../v1/vmware_engine/rest/client.rb | 22 +++--- .../v1/vmware_engine/rest/service_stub.rb | 9 +++ .../v1/vmware_engine_operations_test.rb | 11 ++- .../v1/vmware_engine_paths_test.rb | 30 +++++--- .../v1/vmware_engine_rest_test.rb | 11 ++- .../vmware_engine/v1/vmware_engine_test.rb | 14 +++- .../v1/vpc_access_service/client.rb | 14 ++-- .../v1/vpc_access_service/rest/client.rb | 16 ++--- .../vpc_access_service/rest/service_stub.rb | 9 +++ .../v1/vpc_access_service_operations_test.rb | 11 ++- .../v1/vpc_access_service_paths_test.rb | 14 +++- .../v1/vpc_access_service_rest_test.rb | 11 ++- .../vpc_access/v1/vpc_access_service_test.rb | 14 +++- .../v1/web_risk_service/rest/service_stub.rb | 9 +++ .../v1/web_risk_service_operations_test.rb | 11 ++- .../v1/web_risk_service_paths_test.rb | 12 +++- .../web_risk/v1/web_risk_service_rest_test.rb | 11 ++- .../web_risk/v1/web_risk_service_test.rb | 14 +++- .../web_risk_service/rest/service_stub.rb | 9 +++ .../v1beta1/web_risk_service_rest_test.rb | 11 ++- .../web_risk/v1beta1/web_risk_service_test.rb | 11 ++- .../web_security_scanner/rest/service_stub.rb | 9 +++ .../v1/web_security_scanner_rest_test.rb | 11 ++- .../v1/web_security_scanner_test.rb | 11 ++- .../web_security_scanner/rest/service_stub.rb | 9 +++ .../v1beta/web_security_scanner_paths_test.rb | 18 +++-- .../v1beta/web_security_scanner_rest_test.rb | 11 ++- .../v1beta/web_security_scanner_test.rb | 11 ++- .../v1/executions/rest/service_stub.rb | 9 +++ .../executions/v1/executions_paths_test.rb | 14 +++- .../executions/v1/executions_rest_test.rb | 11 ++- .../executions/v1/executions_test.rb | 11 ++- .../v1beta/executions_paths_test.rb | 14 +++- .../executions/v1beta/executions_test.rb | 11 ++- .../cloud/workflows/v1/workflows/client.rb | 14 ++-- .../workflows/v1/workflows/rest/client.rb | 16 ++--- .../v1/workflows/rest/service_stub.rb | 9 +++ .../workflows/v1/workflows_operations_test.rb | 11 ++- .../workflows/v1/workflows_paths_test.rb | 16 ++++- .../cloud/workflows/v1/workflows_rest_test.rb | 11 ++- .../cloud/workflows/v1/workflows_test.rb | 14 +++- .../v1beta/workflows/rest/service_stub.rb | 9 +++ .../v1beta/workflows_operations_test.rb | 11 ++- .../workflows/v1beta/workflows_paths_test.rb | 14 +++- .../workflows/v1beta/workflows_rest_test.rb | 11 ++- .../cloud/workflows/v1beta/workflows_test.rb | 14 +++- .../v1/iam_credentials/rest/service_stub.rb | 9 +++ .../v1/iam_credentials_paths_test.rb | 12 +++- .../v1/iam_credentials_rest_test.rb | 11 ++- .../credentials/v1/iam_credentials_test.rb | 11 ++- .../iam/v1/iam_policy/rest/service_stub.rb | 9 +++ .../google/iam/v1/iam_policy_rest_test.rb | 11 ++- .../test/google/iam/v1/iam_policy_test.rb | 11 ++- ...workload_identity_pools_operations_test.rb | 11 ++- .../workload_identity_pools_paths_test.rb | 16 ++++- .../v1beta/workload_identity_pools_test.rb | 14 +++- .../iam/v2/policies/rest/service_stub.rb | 9 +++ .../google/iam/v2/policies_operations_test.rb | 11 ++- .../test/google/iam/v2/policies_rest_test.rb | 11 ++- .../test/google/iam/v2/policies_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../access_context_manager_operations_test.rb | 11 ++- .../v1/access_context_manager_paths_test.rb | 20 ++++-- .../v1/access_context_manager_rest_test.rb | 11 ++- .../v1/access_context_manager_test.rb | 14 +++- .../rest/service_stub.rb | 9 +++ .../rest/service_stub.rb | 9 +++ .../local_inventory_service_paths_test.rb | 12 +++- .../local_inventory_service_rest_test.rb | 11 ++- .../v1beta/local_inventory_service_test.rb | 11 ++- .../regional_inventory_service_paths_test.rb | 12 +++- .../regional_inventory_service_rest_test.rb | 11 ++- .../v1beta/regional_inventory_service_test.rb | 11 ++- .../report_service/rest/service_stub.rb | 9 +++ .../v1beta/report_service_rest_test.rb | 11 ++- .../reports/v1beta/report_service_test.rb | 11 ++- .../test/grafeas/v1/grafeas_paths_test.rb | 16 ++++- grafeas-v1/test/grafeas/v1/grafeas_test.rb | 11 ++- 1983 files changed, 20604 insertions(+), 5009 deletions(-) diff --git a/google-analytics-admin-v1alpha/lib/google/analytics/admin/v1alpha/analytics_admin_service/rest/service_stub.rb b/google-analytics-admin-v1alpha/lib/google/analytics/admin/v1alpha/analytics_admin_service/rest/service_stub.rb index 802d8ed8b8e0..7809cbd7fe74 100644 --- a/google-analytics-admin-v1alpha/lib/google/analytics/admin/v1alpha/analytics_admin_service/rest/service_stub.rb +++ b/google-analytics-admin-v1alpha/lib/google/analytics/admin/v1alpha/analytics_admin_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_account REST call # diff --git a/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_paths_test.rb b/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_paths_test.rb index 7dfd857a6960..482dd633a866 100644 --- a/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_paths_test.rb +++ b/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/analytics/admin/v1alpha/analytics_admin_service" class ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_access_binding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_access_binding_path def test_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_account_path def test_ad_sense_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -64,7 +74,7 @@ def test_ad_sense_link_path def test_attribution_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -76,7 +86,7 @@ def test_attribution_settings_path def test_audience_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -88,7 +98,7 @@ def test_audience_path def test_big_query_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -100,7 +110,7 @@ def test_big_query_link_path def test_channel_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -112,7 +122,7 @@ def test_channel_group_path def test_conversion_event_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -124,7 +134,7 @@ def test_conversion_event_path def test_custom_dimension_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -136,7 +146,7 @@ def test_custom_dimension_path def test_custom_metric_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -148,7 +158,7 @@ def test_custom_metric_path def test_data_redaction_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -160,7 +170,7 @@ def test_data_redaction_settings_path def test_data_retention_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -172,7 +182,7 @@ def test_data_retention_settings_path def test_data_sharing_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -184,7 +194,7 @@ def test_data_sharing_settings_path def test_data_stream_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -196,7 +206,7 @@ def test_data_stream_path def test_display_video360_advertiser_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -208,7 +218,7 @@ def test_display_video360_advertiser_link_path def test_display_video360_advertiser_link_proposal_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -220,7 +230,7 @@ def test_display_video360_advertiser_link_proposal_path def test_enhanced_measurement_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -232,7 +242,7 @@ def test_enhanced_measurement_settings_path def test_event_create_rule_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -244,7 +254,7 @@ def test_event_create_rule_path def test_expanded_data_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -256,7 +266,7 @@ def test_expanded_data_set_path def test_firebase_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -268,7 +278,7 @@ def test_firebase_link_path def test_global_site_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -280,7 +290,7 @@ def test_global_site_tag_path def test_google_ads_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -292,7 +302,7 @@ def test_google_ads_link_path def test_google_signals_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -304,7 +314,7 @@ def test_google_signals_settings_path def test_measurement_protocol_secret_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -316,7 +326,7 @@ def test_measurement_protocol_secret_path def test_property_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -328,7 +338,7 @@ def test_property_path def test_rollup_property_source_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -340,7 +350,7 @@ def test_rollup_property_source_link_path def test_sk_ad_network_conversion_value_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -352,7 +362,7 @@ def test_sk_ad_network_conversion_value_schema_path def test_search_ads360_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -364,7 +374,7 @@ def test_search_ads360_link_path def test_subproperty_event_filter_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_rest_test.rb b/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_rest_test.rb index f9bf2a1f9d31..82b7ad6d532d 100644 --- a/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_rest_test.rb +++ b/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_account @@ -7258,7 +7266,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_test.rb b/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_test.rb index d5e3739b803c..d1bec6f2bd2e 100644 --- a/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_test.rb +++ b/google-analytics-admin-v1alpha/test/google/analytics/admin/v1alpha/analytics_admin_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_account @@ -8005,7 +8013,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-analytics-data-v1beta/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb b/google-analytics-data-v1beta/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb index 695428264192..04c17ec6400d 100644 --- a/google-analytics-data-v1beta/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb +++ b/google-analytics-data-v1beta/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the run_report REST call # diff --git a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_operations_test.rb b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_operations_test.rb index 8ab69be72812..c42a91a39fe2 100644 --- a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_operations_test.rb +++ b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_paths_test.rb b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_paths_test.rb index c097409036bb..482e5e7f123f 100644 --- a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_paths_test.rb +++ b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_paths_test.rb @@ -23,9 +23,19 @@ require "google/analytics/data/v1beta/analytics_data" class ::Google::Analytics::Data::V1beta::AnalyticsData::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_audience_export_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_audience_export_path def test_metadata_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_metadata_path def test_property_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_rest_test.rb b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_rest_test.rb index d1264229aad1..a658a5126836 100644 --- a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_rest_test.rb +++ b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_run_report @@ -704,7 +712,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_test.rb b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_test.rb index 214642696a59..1ace14307966 100644 --- a/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_test.rb +++ b/google-analytics-data-v1beta/test/google/analytics/data/v1beta/analytics_data_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_run_report @@ -787,7 +795,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config| config.credentials = grpc_channel end @@ -805,7 +814,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/conference_records_service/rest/service_stub.rb b/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/conference_records_service/rest/service_stub.rb index 8343161ed9fb..74706dda7f45 100644 --- a/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/conference_records_service/rest/service_stub.rb +++ b/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/conference_records_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_conference_record REST call # diff --git a/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/spaces_service/rest/service_stub.rb b/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/spaces_service/rest/service_stub.rb index bba236f7ff99..197a534f737a 100644 --- a/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/spaces_service/rest/service_stub.rb +++ b/google-apps-meet-v2beta/lib/google/apps/meet/v2beta/spaces_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_space REST call # diff --git a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_paths_test.rb b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_paths_test.rb index 5f4f6400acd0..6caab22c0633 100644 --- a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_paths_test.rb +++ b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/apps/meet/v2beta/conference_records_service" class ::Google::Apps::Meet::V2beta::ConferenceRecordsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_conference_record_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_conference_record_path def test_participant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_participant_path def test_participant_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_participant_session_path def test_recording_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_recording_path def test_transcript_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_transcript_path def test_transcript_entry_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_rest_test.rb b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_rest_test.rb index 3751450bafff..c1daefe67c9f 100644 --- a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_rest_test.rb +++ b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_conference_record @@ -728,7 +736,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_test.rb b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_test.rb index 21cc2ee4dbc8..598220103515 100644 --- a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_test.rb +++ b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/conference_records_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_conference_record @@ -805,7 +813,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Apps::Meet::V2beta::ConferenceRecordsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_paths_test.rb b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_paths_test.rb index 0238ffc1cdd9..aa9e390add14 100644 --- a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_paths_test.rb +++ b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/apps/meet/v2beta/spaces_service" class ::Google::Apps::Meet::V2beta::SpacesService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_conference_record_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::SpacesService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_conference_record_path def test_space_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Apps::Meet::V2beta::SpacesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_rest_test.rb b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_rest_test.rb index cc7d5d55ead0..4d5603d3d23f 100644 --- a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_rest_test.rb +++ b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_space @@ -283,7 +291,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Apps::Meet::V2beta::SpacesService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_test.rb b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_test.rb index 64a533e12199..6aa3917ed22e 100644 --- a/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_test.rb +++ b/google-apps-meet-v2beta/test/google/apps/meet/v2beta/spaces_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_space @@ -285,7 +293,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Apps::Meet::V2beta::SpacesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-area120-tables-v1alpha1/lib/google/area120/tables/v1alpha1/tables_service/rest/service_stub.rb b/google-area120-tables-v1alpha1/lib/google/area120/tables/v1alpha1/tables_service/rest/service_stub.rb index 5ba8d6ec6a05..cd51a7786de4 100644 --- a/google-area120-tables-v1alpha1/lib/google/area120/tables/v1alpha1/tables_service/rest/service_stub.rb +++ b/google-area120-tables-v1alpha1/lib/google/area120/tables/v1alpha1/tables_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_table REST call # diff --git a/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_paths_test.rb b/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_paths_test.rb index d98e8c008c68..2cb1aaf70ffb 100644 --- a/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_paths_test.rb +++ b/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/area120/tables/v1alpha1/tables_service" class ::Google::Area120::Tables::V1alpha1::TablesService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_row_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Area120::Tables::V1alpha1::TablesService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_row_path def test_table_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Area120::Tables::V1alpha1::TablesService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_table_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Area120::Tables::V1alpha1::TablesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_rest_test.rb b/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_rest_test.rb index 7568855818da..abb35a4d7380 100644 --- a/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_rest_test.rb +++ b/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_table @@ -728,7 +736,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Area120::Tables::V1alpha1::TablesService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_test.rb b/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_test.rb index c62d9e095aad..3b8803680b99 100644 --- a/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_test.rb +++ b/google-area120-tables-v1alpha1/test/google/area120/tables/v1alpha1/tables_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_table @@ -790,7 +798,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Area120::Tables::V1alpha1::TablesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-access_approval-v1/lib/google/cloud/access_approval/v1/access_approval/rest/service_stub.rb b/google-cloud-access_approval-v1/lib/google/cloud/access_approval/v1/access_approval/rest/service_stub.rb index 231c202c7fcc..d40856ff583d 100644 --- a/google-cloud-access_approval-v1/lib/google/cloud/access_approval/v1/access_approval/rest/service_stub.rb +++ b/google-cloud-access_approval-v1/lib/google/cloud/access_approval/v1/access_approval/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_approval_requests REST call # diff --git a/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_paths_test.rb b/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_paths_test.rb index 9c368a946db5..463e017fd054 100644 --- a/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_paths_test.rb +++ b/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/access_approval/v1/access_approval" class ::Google::Cloud::AccessApproval::V1::AccessApproval::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_access_approval_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_access_approval_settings_path def test_approval_request_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_approval_request_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_rest_test.rb b/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_rest_test.rb index 954cab710787..a19a37d58a83 100644 --- a/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_rest_test.rb +++ b/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_approval_requests @@ -557,7 +565,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_test.rb b/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_test.rb index bb425f8a31cd..7d720e9a6917 100644 --- a/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_test.rb +++ b/google-cloud-access_approval-v1/test/google/cloud/access_approval/v1/access_approval_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_approval_requests @@ -588,7 +596,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AccessApproval::V1::AccessApproval::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-advisory_notifications-v1/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/service_stub.rb b/google-cloud-advisory_notifications-v1/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/service_stub.rb index 48a7b1ee3ab7..d59f6cd72af5 100644 --- a/google-cloud-advisory_notifications-v1/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/service_stub.rb +++ b/google-cloud-advisory_notifications-v1/lib/google/cloud/advisory_notifications/v1/advisory_notifications_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_notifications REST call # diff --git a/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_paths_test.rb b/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_paths_test.rb index cc683b88ef71..abf4a4738bd6 100644 --- a/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_paths_test.rb +++ b/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/advisory_notifications/v1/advisory_notifications_service" class ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_location_path def test_notification_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_notification_path def test_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_rest_test.rb b/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_rest_test.rb index bf6e90ce7579..fb77c0a48cb1 100644 --- a/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_rest_test.rb +++ b/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_notifications @@ -287,7 +295,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_test.rb b/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_test.rb index 5378c36d85b3..e318d192e59b 100644 --- a/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_test.rb +++ b/google-cloud-advisory_notifications-v1/test/google/cloud/advisory_notifications/v1/advisory_notifications_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_notifications @@ -298,7 +306,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AdvisoryNotifications::V1::AdvisoryNotificationsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/client.rb b/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/client.rb index 7bd934d41531..af705604324b 100644 --- a/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/client.rb +++ b/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/client.rb @@ -202,20 +202,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @alloy_db_admin_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Stub, credentials: credentials, @@ -226,6 +212,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + end end ## diff --git a/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/client.rb b/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/client.rb index 2524c1269423..9c6dbee788da 100644 --- a/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/client.rb +++ b/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/client.rb @@ -199,27 +199,27 @@ def initialize config.universe_domain = @config.universe_domain end + @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain end - - @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/service_stub.rb b/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/service_stub.rb index a44633a139fe..03cfb59767a7 100644 --- a/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/service_stub.rb +++ b/google-cloud-alloy_db-v1/lib/google/cloud/alloy_db/v1/alloy_db_admin/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_clusters REST call # diff --git a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_operations_test.rb b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_operations_test.rb index 73e372a6b9e3..9b0608b4c627 100644 --- a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_operations_test.rb +++ b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_paths_test.rb b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_paths_test.rb index bde4622d54b5..ff17f8908e70 100644 --- a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_paths_test.rb +++ b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/alloy_db/v1/alloy_db_admin" class ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_cluster_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_version_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_network_path def test_user_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_rest_test.rb b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_rest_test.rb index a4ce2307a828..d96b77f2ceb5 100644 --- a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_rest_test.rb +++ b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -1834,7 +1842,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_test.rb b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_test.rb index f2be8d82ffff..506264bc1e7c 100644 --- a/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_test.rb +++ b/google-cloud-alloy_db-v1/test/google/cloud/alloy_db/v1/alloy_db_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -2148,7 +2156,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -2166,7 +2175,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1alpha/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb b/google-cloud-alloy_db-v1alpha/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb index 13bd3e586717..4ae2bba1be77 100644 --- a/google-cloud-alloy_db-v1alpha/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb +++ b/google-cloud-alloy_db-v1alpha/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb @@ -217,20 +217,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @alloy_db_admin_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Stub, credentials: credentials, @@ -241,6 +227,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + end end ## diff --git a/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_operations_test.rb b/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_operations_test.rb index 5cc8a3d300f7..36e47d429038 100644 --- a/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_operations_test.rb +++ b/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_paths_test.rb b/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_paths_test.rb index e47ce4a2de45..609904327a09 100644 --- a/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_paths_test.rb +++ b/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/alloy_db/v1alpha/alloy_db_admin" class ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_cluster_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_version_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_network_path def test_user_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_test.rb b/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_test.rb index ce6eea1bb377..f46069e3a102 100644 --- a/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_test.rb +++ b/google-cloud-alloy_db-v1alpha/test/google/cloud/alloy_db/v1alpha/alloy_db_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -2219,7 +2227,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -2237,7 +2246,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb index 31fad945bfee..6dbab7941b71 100644 --- a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb +++ b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb @@ -212,20 +212,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @alloy_db_admin_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Stub, credentials: credentials, @@ -236,6 +222,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + end end ## diff --git a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb index 429bda2e21f2..08e89acdeb7b 100644 --- a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb +++ b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb @@ -209,27 +209,27 @@ def initialize config.universe_domain = @config.universe_domain end + @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain end - - @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb index 61f269459eaf..79963274d908 100644 --- a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb +++ b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_clusters REST call # diff --git a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb index 704f20da0cef..95ba13eafc1f 100644 --- a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb +++ b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb index b7522d90db5e..8aa9a1d6efb4 100644 --- a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb +++ b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/alloy_db/v1beta/alloy_db_admin" class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_cluster_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_version_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_network_path def test_user_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb index d11f4a9fde99..abff4731acf1 100644 --- a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb +++ b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -1835,7 +1843,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb index a3dc15764ebf..840a569267bb 100644 --- a/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb +++ b/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -2150,7 +2158,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -2168,7 +2177,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-api_gateway-v1/lib/google/cloud/api_gateway/v1/api_gateway_service/rest/service_stub.rb b/google-cloud-api_gateway-v1/lib/google/cloud/api_gateway/v1/api_gateway_service/rest/service_stub.rb index fc86d19029aa..8061f2d99561 100644 --- a/google-cloud-api_gateway-v1/lib/google/cloud/api_gateway/v1/api_gateway_service/rest/service_stub.rb +++ b/google-cloud-api_gateway-v1/lib/google/cloud/api_gateway/v1/api_gateway_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_gateways REST call # diff --git a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_operations_test.rb b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_operations_test.rb index f43ed7a5f562..e2d127e220dd 100644 --- a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_operations_test.rb +++ b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_paths_test.rb b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_paths_test.rb index 487bfb65b182..e17d0d4e0c1a 100644 --- a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_paths_test.rb +++ b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/api_gateway/v1/api_gateway_service" class ::Google::Cloud::ApiGateway::V1::ApiGatewayService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_api_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_api_path def test_api_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_api_config_path def test_gateway_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_gateway_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_managed_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_managed_service_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_service_path def test_service_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_rest_test.rb b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_rest_test.rb index 0c447dd11422..9c4452a94056 100644 --- a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_rest_test.rb +++ b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_gateways @@ -898,7 +906,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_test.rb b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_test.rb index 181c30c37158..7a8cb5308121 100644 --- a/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_test.rb +++ b/google-cloud-api_gateway-v1/test/google/cloud/api_gateway/v1/api_gateway_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_gateways @@ -1025,7 +1033,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end @@ -1043,7 +1052,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-api_keys-v2/lib/google/cloud/api_keys/v2/api_keys/rest/service_stub.rb b/google-cloud-api_keys-v2/lib/google/cloud/api_keys/v2/api_keys/rest/service_stub.rb index 59cead7eb2e5..1c95d176fe4f 100644 --- a/google-cloud-api_keys-v2/lib/google/cloud/api_keys/v2/api_keys/rest/service_stub.rb +++ b/google-cloud-api_keys-v2/lib/google/cloud/api_keys/v2/api_keys/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_key REST call # diff --git a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_operations_test.rb b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_operations_test.rb index 6c04210b77b3..dcd3a179503b 100644 --- a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_operations_test.rb +++ b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_paths_test.rb b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_paths_test.rb index d9cee5f22f70..312199b37c92 100644 --- a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_paths_test.rb +++ b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/api_keys/v2/api_keys" class ::Google::Cloud::ApiKeys::V2::ApiKeys::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_rest_test.rb b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_rest_test.rb index 13a8371eb467..8b35ea3f354e 100644 --- a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_rest_test.rb +++ b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_key @@ -505,7 +513,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_test.rb b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_test.rb index c7d51682f13e..4cb280b784d6 100644 --- a/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_test.rb +++ b/google-cloud-api_keys-v2/test/google/cloud/api_keys/v2/api_keys_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_key @@ -554,7 +562,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Client.new do |config| config.credentials = grpc_channel end @@ -572,7 +581,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_connect-v1/lib/google/cloud/apigee_connect/v1/connection_service/rest/service_stub.rb b/google-cloud-apigee_connect-v1/lib/google/cloud/apigee_connect/v1/connection_service/rest/service_stub.rb index f89b13fd6d27..f88a493dc1fa 100644 --- a/google-cloud-apigee_connect-v1/lib/google/cloud/apigee_connect/v1/connection_service/rest/service_stub.rb +++ b/google-cloud-apigee_connect-v1/lib/google/cloud/apigee_connect/v1/connection_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_connections REST call # diff --git a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_paths_test.rb b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_paths_test.rb index b5786f290f68..8e1d7b1ad9e7 100644 --- a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_paths_test.rb +++ b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/apigee_connect/v1/connection_service" class ::Google::Cloud::ApigeeConnect::V1::ConnectionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_endpoint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeConnect::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_rest_test.rb b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_rest_test.rb index 9d77bd03dc6e..5c0775d77199 100644 --- a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_rest_test.rb +++ b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connections @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeConnect::V1::ConnectionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_test.rb b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_test.rb index befc7cf21f0a..cc255d32937c 100644 --- a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_test.rb +++ b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/connection_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connections @@ -118,7 +126,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeConnect::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/tether_test.rb b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/tether_test.rb index 4f7121c672de..86c7e936105c 100644 --- a/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/tether_test.rb +++ b/google-cloud-apigee_connect-v1/test/google/cloud/apigee_connect/v1/tether_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_egress @@ -151,7 +159,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeConnect::V1::Tether::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/client.rb b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/client.rb index b5b7d2c4b193..42304510c209 100644 --- a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/client.rb +++ b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/client.rb @@ -156,20 +156,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @provisioning_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Stub, credentials: credentials, @@ -180,6 +166,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @provisioning_stub.endpoint + config.universe_domain = @provisioning_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @provisioning_stub.endpoint + config.universe_domain = @provisioning_stub.universe_domain + end end ## diff --git a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/client.rb b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/client.rb index e3126ef95769..80d91b2a55c1 100644 --- a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/client.rb +++ b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/client.rb @@ -153,28 +153,28 @@ def initialize config.universe_domain = @config.universe_domain end + @provisioning_stub = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @provisioning_stub.endpoint + config.universe_domain = @provisioning_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @provisioning_stub.endpoint + config.universe_domain = @provisioning_stub.universe_domain config.bindings_override = @config.bindings_override end - - @provisioning_stub = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/service_stub.rb b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/service_stub.rb index 61a5ed6d0ed0..a337e07dc231 100644 --- a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/service_stub.rb +++ b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/provisioning/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_instance REST call # diff --git a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/client.rb b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/client.rb index 4a7b2ec472d4..eb12ff2b4cad 100644 --- a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/client.rb +++ b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/client.rb @@ -317,20 +317,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @registry_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ApigeeRegistry::V1::Registry::Stub, credentials: credentials, @@ -341,6 +327,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registry_stub.endpoint + config.universe_domain = @registry_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registry_stub.endpoint + config.universe_domain = @registry_stub.universe_domain + end end ## diff --git a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/client.rb b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/client.rb index 03b41ce1f823..c68c13caeead 100644 --- a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/client.rb +++ b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/client.rb @@ -314,28 +314,28 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @registry_stub = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @registry_stub.endpoint + config.universe_domain = @registry_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @registry_stub.endpoint + config.universe_domain = @registry_stub.universe_domain config.bindings_override = @config.bindings_override end - - @registry_stub = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/service_stub.rb b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/service_stub.rb index 6fc2ec10f377..069866d73024 100644 --- a/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/service_stub.rb +++ b/google-cloud-apigee_registry-v1/lib/google/cloud/apigee_registry/v1/registry/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_apis REST call # diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_operations_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_operations_test.rb index 4ea59d1be5c6..dbda1ecbb319 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_operations_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_paths_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_paths_test.rb index d9ab3ece308b..86adbb74c9be 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_paths_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/apigee_registry/v1/provisioning" class ::Google::Cloud::ApigeeRegistry::V1::Provisioning::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_rest_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_rest_test.rb index 29b31b8a64de..e914b92dabc1 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_rest_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_instance @@ -230,7 +238,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_test.rb index 2b2d108b716f..fca65b79629a 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/provisioning_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_instance @@ -239,7 +247,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new do |config| config.credentials = grpc_channel end @@ -257,7 +266,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_paths_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_paths_test.rb index a02d41fba5d2..7e80adba50f4 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_paths_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/apigee_registry/v1/registry" class ::Google::Cloud::ApigeeRegistry::V1::Registry::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_api_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_api_path def test_api_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_api_deployment_path def test_api_spec_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_api_spec_path def test_api_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_api_version_path def test_artifact_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_artifact_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_rest_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_rest_test.rb index bc530e0c2baf..5879338a8ad7 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_rest_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_apis @@ -2001,7 +2009,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_test.rb b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_test.rb index 3b17f0c2ec1b..8dcfafb39136 100644 --- a/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_test.rb +++ b/google-cloud-apigee_registry-v1/test/google/cloud/apigee_registry/v1/registry_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_apis @@ -2206,7 +2214,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ApigeeRegistry::V1::Registry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb index 3907e67d9c3a..ce66a444c830 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_application REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb index f233061d36b2..52509a2abe5c 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_authorized_certificates REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb index ec122efb2a81..9bdfc9c32a21 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_authorized_domains REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb index 85192aa508e4..3fe096817771 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_domain_mappings REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb index 5470399c8edb..c43877846c60 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_ingress_rules REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb index da5dc8d0993c..3f345033cb80 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb index 65e46c271adf..7e841062c3f3 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_services REST call # diff --git a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb index 30c70f91c90c..0807f5817e45 100644 --- a/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +++ b/google-cloud-app_engine-v1/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_versions REST call # diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_operations_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_operations_test.rb index 8fc693ee7063..a0d8a5ac9c5a 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_operations_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Applications::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_rest_test.rb index bc7e5b36618b..4112d638c4cd 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_application @@ -284,7 +292,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Applications::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_test.rb index d6b127fe376f..23e93254a4ec 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/applications_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_application @@ -302,7 +310,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Applications::Client.new do |config| config.credentials = grpc_channel end @@ -320,7 +329,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Applications::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_rest_test.rb index e8d48c1cda0e..59543944abf6 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_authorized_certificates @@ -343,7 +351,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::AuthorizedCertificates::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_test.rb index 84976dcb555a..bae57dde037d 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_certificates_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_authorized_certificates @@ -360,7 +368,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_rest_test.rb index 0c035eef0e1a..94a434ec7f61 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_authorized_domains @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_test.rb index 1019252c017d..62830d87ed27 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/authorized_domains_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_authorized_domains @@ -118,7 +126,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_operations_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_operations_test.rb index 4526bc94f1ec..d7083d146172 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_operations_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::DomainMappings::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_rest_test.rb index 459825201a8e..4797e704af62 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_domain_mappings @@ -342,7 +350,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::DomainMappings::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_test.rb index 5761398e8033..cf92e7c391ff 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/domain_mappings_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_domain_mappings @@ -373,7 +381,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::DomainMappings::Client.new do |config| config.credentials = grpc_channel end @@ -391,7 +400,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::DomainMappings::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_rest_test.rb index 300c31a2988e..9e5594f95f75 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_ingress_rules @@ -397,7 +405,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Firewall::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_test.rb index da73387f2812..7f8f3c97806a 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/firewall_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_ingress_rules @@ -418,7 +426,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Firewall::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_operations_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_operations_test.rb index 57ffa0f5119d..fef2c9b9dd1a 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_operations_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Instances::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_rest_test.rb index 725563c02e91..c5ed53504e28 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -285,7 +293,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Instances::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_test.rb index 4dd40089ff9a..cf0c63e089f6 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/instances_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -304,7 +312,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Instances::Client.new do |config| config.credentials = grpc_channel end @@ -322,7 +331,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Instances::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_operations_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_operations_test.rb index 51c46c18692e..d846b0259367 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_operations_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Services::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_rest_test.rb index c2e09680bfad..91e4e4b51b05 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -287,7 +295,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Services::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_test.rb index ef6359f01a65..fa9bb31a3521 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/services_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -308,7 +316,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Services::Client.new do |config| config.credentials = grpc_channel end @@ -326,7 +335,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Services::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_operations_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_operations_test.rb index edeb6ee75d96..23baef5200dd 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_operations_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Versions::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_rest_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_rest_test.rb index c63df8c2074a..cccc9fdff041 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_rest_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_versions @@ -343,7 +351,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Versions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_test.rb b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_test.rb index b8b43fdfd1a1..7c58f6c8cf07 100644 --- a/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_test.rb +++ b/google-cloud-app_engine-v1/test/google/cloud/app_engine/v1/versions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_versions @@ -375,7 +383,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Versions::Client.new do |config| config.credentials = grpc_channel end @@ -393,7 +402,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AppEngine::V1::Versions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb b/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb index 6570c1cfe67a..ac99262b1b52 100644 --- a/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb +++ b/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb @@ -168,13 +168,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @artifact_registry_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Stub, credentials: credentials, @@ -185,6 +178,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @artifact_registry_stub.endpoint + config.universe_domain = @artifact_registry_stub.universe_domain + end end ## diff --git a/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb b/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb index 5926b18d090e..d74e2c5cdd52 100644 --- a/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb +++ b/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb @@ -165,20 +165,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @artifact_registry_stub = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @artifact_registry_stub.endpoint + config.universe_domain = @artifact_registry_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/service_stub.rb b/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/service_stub.rb index e0076467ffc4..74cfb9f4bc87 100644 --- a/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/service_stub.rb +++ b/google-cloud-artifact_registry-v1/lib/google/cloud/artifact_registry/v1/artifact_registry/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_docker_images REST call # diff --git a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_operations_test.rb b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_operations_test.rb index fd9694fcd502..f69febcea7c4 100644 --- a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_operations_test.rb +++ b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_paths_test.rb b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_paths_test.rb index ff91e3a9a5a4..b607bd0b7d33 100644 --- a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_paths_test.rb +++ b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/artifact_registry/v1/artifact_registry" class ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_docker_image_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_docker_image_path def test_file_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_file_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_maven_artifact_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_maven_artifact_path def test_npm_package_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_npm_package_path def test_package_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_package_path def test_project_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_project_settings_path def test_python_package_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_python_package_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_repository_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_secret_version_path def test_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -157,7 +167,7 @@ def test_tag_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -169,7 +179,7 @@ def test_version_path def test_vpcsc_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_rest_test.rb b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_rest_test.rb index c3601ad3183f..66f43117748f 100644 --- a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_rest_test.rb +++ b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_docker_images @@ -2052,7 +2060,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_test.rb b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_test.rb index 2a917a005457..49a8325b8a49 100644 --- a/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_test.rb +++ b/google-cloud-artifact_registry-v1/test/google/cloud/artifact_registry/v1/artifact_registry_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_docker_images @@ -2305,7 +2313,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -2323,7 +2332,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb b/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb index 0a19507e1f52..0e663b7f8822 100644 --- a/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb +++ b/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/client.rb @@ -251,13 +251,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @artifact_registry_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Stub, credentials: credentials, @@ -268,6 +261,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @artifact_registry_stub.endpoint + config.universe_domain = @artifact_registry_stub.universe_domain + end end ## diff --git a/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/client.rb b/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/client.rb index 763986ffa217..8e9c1d1f1c97 100644 --- a/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/client.rb +++ b/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/client.rb @@ -248,20 +248,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @artifact_registry_stub = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @artifact_registry_stub.endpoint + config.universe_domain = @artifact_registry_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/service_stub.rb b/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/service_stub.rb index a3327e07bc41..dd459c2c3233 100644 --- a/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/service_stub.rb +++ b/google-cloud-artifact_registry-v1beta2/lib/google/cloud/artifact_registry/v1beta2/artifact_registry/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the import_apt_artifacts REST call # diff --git a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_operations_test.rb b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_operations_test.rb index cb067c21962b..c8d34f968d58 100644 --- a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_operations_test.rb +++ b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_paths_test.rb b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_paths_test.rb index c13c2b21b46b..467a9503e9af 100644 --- a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_paths_test.rb +++ b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/artifact_registry/v1beta2/artifact_registry" class ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_project_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_project_settings_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_repository_path def test_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_rest_test.rb b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_rest_test.rb index d4f4dcd054fd..cdf0ac6e3ba6 100644 --- a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_rest_test.rb +++ b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_import_apt_artifacts @@ -1445,7 +1453,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_test.rb b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_test.rb index f3bc38a16133..b4ed59bcc0f1 100644 --- a/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_test.rb +++ b/google-cloud-artifact_registry-v1beta2/test/google/cloud/artifact_registry/v1beta2/artifact_registry_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_import_apt_artifacts @@ -1616,7 +1624,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -1634,7 +1643,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/rest/service_stub.rb b/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/rest/service_stub.rb index 7706e0a9058c..e2d9b25262d5 100644 --- a/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/rest/service_stub.rb +++ b/google-cloud-asset-v1/lib/google/cloud/asset/v1/asset_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the export_assets REST call # diff --git a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_operations_test.rb b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_operations_test.rb index de44307c96b1..7a1276d4caaa 100644 --- a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_operations_test.rb +++ b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Asset::V1::AssetService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_paths_test.rb b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_paths_test.rb index 32d1997fa8ff..15d532297525 100644 --- a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_paths_test.rb +++ b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/asset/v1/asset_service" class ::Google::Cloud::Asset::V1::AssetService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_feed_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_feed_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_project_path def test_saved_query_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_rest_test.rb b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_rest_test.rb index bda989398449..da92f072f1dd 100644 --- a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_rest_test.rb +++ b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_export_assets @@ -1368,7 +1376,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Asset::V1::AssetService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_test.rb b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_test.rb index e1a9e346047d..6d91f3c0a35f 100644 --- a/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_test.rb +++ b/google-cloud-asset-v1/test/google/cloud/asset/v1/asset_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_export_assets @@ -1555,7 +1563,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end @@ -1573,7 +1582,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-assured_workloads-v1/lib/google/cloud/assured_workloads/v1/assured_workloads_service/rest/service_stub.rb b/google-cloud-assured_workloads-v1/lib/google/cloud/assured_workloads/v1/assured_workloads_service/rest/service_stub.rb index 706495fdf8fc..8552f08af695 100644 --- a/google-cloud-assured_workloads-v1/lib/google/cloud/assured_workloads/v1/assured_workloads_service/rest/service_stub.rb +++ b/google-cloud-assured_workloads-v1/lib/google/cloud/assured_workloads/v1/assured_workloads_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_workload REST call # diff --git a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_operations_test.rb b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_operations_test.rb index 81a03c93580b..e62f0ac4d3c0 100644 --- a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_operations_test.rb +++ b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_paths_test.rb b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_paths_test.rb index 3acc6e8d2f71..adcd77b01042 100644 --- a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_paths_test.rb +++ b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/assured_workloads/v1/assured_workloads_service" class ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_violation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_violation_path def test_workload_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_rest_test.rb b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_rest_test.rb index 6f42f5855238..b670026aef6e 100644 --- a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_rest_test.rb +++ b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_workload @@ -398,7 +406,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_test.rb b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_test.rb index 36d64bd6e621..f41d58ee4ac5 100644 --- a/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_test.rb +++ b/google-cloud-assured_workloads-v1/test/google/cloud/assured_workloads/v1/assured_workloads_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_workload @@ -616,7 +624,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end @@ -634,7 +643,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-assured_workloads-v1beta1/lib/google/cloud/assured_workloads/v1beta1/assured_workloads_service/rest/service_stub.rb b/google-cloud-assured_workloads-v1beta1/lib/google/cloud/assured_workloads/v1beta1/assured_workloads_service/rest/service_stub.rb index 1ff72106d8e9..a156191becd6 100644 --- a/google-cloud-assured_workloads-v1beta1/lib/google/cloud/assured_workloads/v1beta1/assured_workloads_service/rest/service_stub.rb +++ b/google-cloud-assured_workloads-v1beta1/lib/google/cloud/assured_workloads/v1beta1/assured_workloads_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_workload REST call # diff --git a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_operations_test.rb b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_operations_test.rb index 0e51a715bee7..ee5847b74603 100644 --- a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_operations_test.rb +++ b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_paths_test.rb b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_paths_test.rb index 5f19b6276240..fef48313e406 100644 --- a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_paths_test.rb +++ b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/assured_workloads/v1beta1/assured_workloads_service" class ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_workload_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_rest_test.rb b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_rest_test.rb index 7849a7527b51..34a01cfc74b6 100644 --- a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_rest_test.rb +++ b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_workload @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_test.rb b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_test.rb index 9a9ed84e5143..e31227f11027 100644 --- a/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_test.rb +++ b/google-cloud-assured_workloads-v1beta1/test/google/cloud/assured_workloads/v1beta1/assured_workloads_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_workload @@ -486,7 +494,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end @@ -504,7 +513,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb index 9fd8fb0502d2..c10d10c9bd24 100644 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb +++ b/google-cloud-automl-v1/lib/google/cloud/automl/v1/automl/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_dataset REST call # diff --git a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb index 061bdabbabb7..eb78d6a4012d 100644 --- a/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb +++ b/google-cloud-automl-v1/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the predict REST call # diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb index c35f4895b216..e3600bf7e395 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::AutoML::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb index 5e8941e3ea17..36c2ee63dc69 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/automl/v1/automl" class ::Google::Cloud::AutoML::V1::AutoML::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_annotation_spec_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_annotation_spec_path def test_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_dataset_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_model_path def test_model_evaluation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb index ac2389b1ebdf..86693ac6f3a0 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dataset @@ -1055,7 +1063,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::AutoML::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb index 3260ddbb705c..628e9422154e 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/automl_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dataset @@ -1190,7 +1198,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -1208,7 +1217,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb index becc085d2b7d..16bea98adf7a 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::PredictionService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb index 1ba8e601a564..91eddbac2988 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/automl/v1/prediction_service" class ::Google::Cloud::AutoML::V1::PredictionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb index f9b689c251fa..a682562f38cc 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -179,7 +187,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb index 3c698786f9b6..054de0ef8c82 100644 --- a/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb +++ b/google-cloud-automl-v1/test/google/cloud/automl/v1/prediction_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -182,7 +190,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| config.credentials = grpc_channel end @@ -200,7 +209,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb b/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb index 24e7c765e652..bedd45f2c8dc 100644 --- a/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +++ b/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_dataset REST call # diff --git a/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb b/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb index b637156ec842..091f34db6d68 100644 --- a/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb +++ b/google-cloud-automl-v1beta1/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the predict REST call # diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_operations_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_operations_test.rb index 54a67d96d4c1..577e2280aba1 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_operations_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_paths_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_paths_test.rb index eb51983b4519..1e07df749a08 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_paths_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/automl/v1beta1/automl" class ::Google::Cloud::AutoML::V1beta1::AutoML::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_annotation_spec_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_annotation_spec_path def test_column_spec_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_column_spec_path def test_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_dataset_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_model_path def test_model_evaluation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_model_evaluation_path def test_table_spec_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_rest_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_rest_test.rb index 8afea3698020..523742538b91 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_rest_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dataset @@ -1391,7 +1399,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_test.rb index fc222aa98ad6..785fd24a068a 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/automl_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dataset @@ -1572,7 +1580,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end @@ -1590,7 +1599,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_operations_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_operations_test.rb index 41becaf9a7b6..6984bdc021ba 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_operations_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_paths_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_paths_test.rb index 4af355f0d7d3..b0d88b127b87 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_paths_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/automl/v1beta1/prediction_service" class ::Google::Cloud::AutoML::V1beta1::PredictionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_rest_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_rest_test.rb index 2ce9b5ea8b8f..5ab0243fa6ef 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_rest_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -179,7 +187,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_test.rb b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_test.rb index b16a6c744061..7b821573edb7 100644 --- a/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_test.rb +++ b/google-cloud-automl-v1beta1/test/google/cloud/automl/v1beta1/prediction_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -182,7 +190,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config| config.credentials = grpc_channel end @@ -200,7 +209,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/client.rb b/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/client.rb index 0cdeea01a911..b33e7056e566 100644 --- a/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/client.rb +++ b/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/client.rb @@ -164,20 +164,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @bare_metal_solution_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Stub, credentials: credentials, @@ -188,6 +174,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @bare_metal_solution_stub.endpoint + config.universe_domain = @bare_metal_solution_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @bare_metal_solution_stub.endpoint + config.universe_domain = @bare_metal_solution_stub.universe_domain + end end ## diff --git a/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb b/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb index bea21d8c423c..33d0bdcb6ad2 100644 --- a/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb +++ b/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb @@ -161,27 +161,27 @@ def initialize config.universe_domain = @config.universe_domain end + @bare_metal_solution_stub = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @bare_metal_solution_stub.endpoint + config.universe_domain = @bare_metal_solution_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @bare_metal_solution_stub.endpoint + config.universe_domain = @bare_metal_solution_stub.universe_domain end - - @bare_metal_solution_stub = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/service_stub.rb b/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/service_stub.rb index 62e59d6eab65..9fd855de0402 100644 --- a/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/service_stub.rb +++ b/google-cloud-bare_metal_solution-v2/lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_operations_test.rb b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_operations_test.rb index 926248285dcc..d99f9a8ff5e8 100644 --- a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_operations_test.rb +++ b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_paths_test.rb b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_paths_test.rb index 3867c1467317..a3544d87aff1 100644 --- a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_paths_test.rb +++ b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bare_metal_solution/v2/bare_metal_solution" class ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_instance_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_config_path def test_interconnect_attachment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_interconnect_attachment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_lun_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_lun_path def test_nfs_share_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_nfs_share_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_network_path def test_network_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_network_config_path def test_provisioning_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_provisioning_config_path def test_server_network_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_server_network_template_path def test_ssh_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -157,7 +167,7 @@ def test_ssh_key_path def test_volume_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -169,7 +179,7 @@ def test_volume_path def test_volume_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -181,7 +191,7 @@ def test_volume_config_path def test_volume_snapshot_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_rest_test.rb b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_rest_test.rb index db25a8dad5cc..f6445d266baa 100644 --- a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_rest_test.rb +++ b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -2485,7 +2493,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_test.rb b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_test.rb index baba9b262413..5800f9f34ba6 100644 --- a/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_test.rb +++ b/google-cloud-bare_metal_solution-v2/test/google/cloud/bare_metal_solution/v2/bare_metal_solution_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -2814,7 +2822,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end @@ -2832,7 +2841,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb b/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb index a1783442d2b5..9c962372409b 100644 --- a/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb +++ b/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb @@ -180,13 +180,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @batch_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Batch::V1::BatchService::Stub, credentials: credentials, @@ -197,6 +190,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_service_stub.endpoint + config.universe_domain = @batch_service_stub.universe_domain + end end ## diff --git a/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb b/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb index 365cb039d2c8..ab89b0028812 100644 --- a/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb +++ b/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb @@ -177,20 +177,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @batch_service_stub = ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_service_stub.endpoint + config.universe_domain = @batch_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb b/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb index c7d3a822c2c3..597524a260d2 100644 --- a/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb +++ b/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb b/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb index 316ee56883ee..49ab821c4c20 100644 --- a/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb +++ b/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb @@ -169,13 +169,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @iam_policy_stub = ::Gapic::ServiceStub.new( ::Google::Iam::V1::IAMPolicy::Stub, credentials: credentials, @@ -186,6 +179,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @iam_policy_stub.endpoint + config.universe_domain = @iam_policy_stub.universe_domain + end end ## diff --git a/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb index 6ee059301f3f..2d5074884a88 100644 --- a/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb +++ b/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb @@ -166,20 +166,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @iam_policy_stub.endpoint + config.universe_domain = @iam_policy_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb index 2269e10b26f5..eee69ce2fdd5 100644 --- a/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb +++ b/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb @@ -51,6 +51,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the set_iam_policy REST call # diff --git a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb index ae6c55935efa..f2882890b003 100644 --- a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb +++ b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb index 36b14ddd2833..103f0459cb85 100644 --- a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb +++ b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/batch/v1/batch_service" class ::Google::Cloud::Batch::V1::BatchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_job_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_task_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_task_path def test_task_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb index 9f8dd9ea6c5b..c5f69e271775 100644 --- a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb +++ b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -402,7 +410,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb index 6a95180184ea..750014809258 100644 --- a/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb +++ b/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -438,7 +446,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| config.credentials = grpc_channel end @@ -456,7 +465,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb b/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb index 28b7f766256f..96cbd79b10f1 100644 --- a/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb +++ b/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb b/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb index 5a88162e2ff5..832098ff64a5 100644 --- a/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb +++ b/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -233,7 +241,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb index 1d4b0fec4d70..d1fdc72cb586 100644 --- a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb +++ b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb @@ -169,20 +169,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @app_connections_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Stub, credentials: credentials, @@ -193,6 +179,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @app_connections_service_stub.endpoint + config.universe_domain = @app_connections_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @app_connections_service_stub.endpoint + config.universe_domain = @app_connections_service_stub.universe_domain + end end ## diff --git a/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_operations_test.rb b/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_operations_test.rb index 1ecf058e21f2..783688c7c5bd 100644 --- a/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_operations_test.rb +++ b/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_paths_test.rb b/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_paths_test.rb index e590a33066cf..86d1e8a2fa35 100644 --- a/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_paths_test.rb +++ b/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/beyond_corp/app_connections/v1/app_connections_service" class ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_app_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_app_connection_path def test_app_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_app_connector_path def test_app_gateway_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_app_gateway_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_test.rb b/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_test.rb index a684e4aaad24..b8cb33e517e7 100644 --- a/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_test.rb +++ b/google-cloud-beyond_corp-app_connections-v1/test/google/cloud/beyond_corp/app_connections/v1/app_connections_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_app_connections @@ -458,7 +466,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new do |config| config.credentials = grpc_channel end @@ -476,7 +485,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb index 52c3571574ec..d2b2383d80c1 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb @@ -169,20 +169,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @app_connectors_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Stub, credentials: credentials, @@ -193,6 +179,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @app_connectors_service_stub.endpoint + config.universe_domain = @app_connectors_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @app_connectors_service_stub.endpoint + config.universe_domain = @app_connectors_service_stub.universe_domain + end end ## diff --git a/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_operations_test.rb b/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_operations_test.rb index cccd8a69396b..7af04c6c6c4f 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_operations_test.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_paths_test.rb b/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_paths_test.rb index 2a9c14d8e9f0..97ce1e494e4d 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_paths_test.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/beyond_corp/app_connectors/v1/app_connectors_service" class ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_app_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_app_connector_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_test.rb b/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_test.rb index 7ce590f38990..119d1ba0f5f7 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_test.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/test/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_app_connectors @@ -456,7 +464,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new do |config| config.credentials = grpc_channel end @@ -474,7 +483,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb index 44d0ab731eaa..780a4ca3e6c1 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb @@ -169,20 +169,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @app_gateways_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Stub, credentials: credentials, @@ -193,6 +179,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @app_gateways_service_stub.endpoint + config.universe_domain = @app_gateways_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @app_gateways_service_stub.endpoint + config.universe_domain = @app_gateways_service_stub.universe_domain + end end ## diff --git a/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_operations_test.rb b/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_operations_test.rb index 1f4df500b47a..6040b83aa553 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_operations_test.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_paths_test.rb b/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_paths_test.rb index 0eb09e17fa95..68c1a243b9a4 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_paths_test.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/beyond_corp/app_gateways/v1/app_gateways_service" class ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_app_gateway_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_app_gateway_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_test.rb b/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_test.rb index 42b370ae5a18..8d678b9c9671 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_test.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/test/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_app_gateways @@ -318,7 +326,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new do |config| config.credentials = grpc_channel end @@ -336,7 +345,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb index 923eb1e6165d..d27edbfdf99b 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb @@ -166,20 +166,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @client_connector_services_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Stub, credentials: credentials, @@ -190,6 +176,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @client_connector_services_service_stub.endpoint + config.universe_domain = @client_connector_services_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @client_connector_services_service_stub.endpoint + config.universe_domain = @client_connector_services_service_stub.universe_domain + end end ## diff --git a/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_operations_test.rb b/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_operations_test.rb index 1f5d06ddfca6..1b5a023a6646 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_operations_test.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_paths_test.rb b/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_paths_test.rb index b26656db5415..61e57dd7f4b7 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_paths_test.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service" class ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_client_connector_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_client_connector_service_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_test.rb b/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_test.rb index 859f53e958b0..c45b402b5dc8 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_test.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/test/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_client_connector_services @@ -389,7 +397,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new do |config| config.credentials = grpc_channel end @@ -407,7 +416,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb index 4ed774e8c626..f41bf17fc705 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb @@ -166,20 +166,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @client_gateways_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Stub, credentials: credentials, @@ -190,6 +176,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @client_gateways_service_stub.endpoint + config.universe_domain = @client_gateways_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @client_gateways_service_stub.endpoint + config.universe_domain = @client_gateways_service_stub.universe_domain + end end ## diff --git a/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_operations_test.rb b/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_operations_test.rb index f0e63bc3ba64..53f8fd1e8a19 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_operations_test.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_paths_test.rb b/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_paths_test.rb index 593231cb7da0..a0bd41e010cb 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_paths_test.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/beyond_corp/client_gateways/v1/client_gateways_service" class ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_client_gateway_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_client_gateway_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_test.rb b/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_test.rb index fefa67c2696d..9189d8f1e44a 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_test.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/test/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_client_gateways @@ -318,7 +326,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new do |config| config.credentials = grpc_channel end @@ -336,7 +345,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-analytics_hub-v1/lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/service_stub.rb b/google-cloud-bigquery-analytics_hub-v1/lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/service_stub.rb index d0d04417ea0f..293161a1718c 100644 --- a/google-cloud-bigquery-analytics_hub-v1/lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/service_stub.rb +++ b/google-cloud-bigquery-analytics_hub-v1/lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_data_exchanges REST call # diff --git a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_operations_test.rb b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_operations_test.rb index b6cac42bd235..84257cd72bd0 100644 --- a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_operations_test.rb +++ b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_paths_test.rb b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_paths_test.rb index 58a8dacd0213..fc2f090797c7 100644 --- a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_paths_test.rb +++ b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/analytics_hub/v1/analytics_hub_service" class ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_exchange_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_data_exchange_path def test_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_dataset_path def test_listing_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_listing_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_subscription_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_rest_test.rb b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_rest_test.rb index ac73ebc94d15..0273c3133e3c 100644 --- a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_rest_test.rb +++ b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_data_exchanges @@ -1280,7 +1288,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_test.rb b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_test.rb index 9e36fce44cc2..ab9a25ad265b 100644 --- a/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_test.rb +++ b/google-cloud-bigquery-analytics_hub-v1/test/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_data_exchanges @@ -1420,7 +1428,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -1438,7 +1447,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-connection-v1/lib/google/cloud/bigquery/connection/v1/connection_service/rest/service_stub.rb b/google-cloud-bigquery-connection-v1/lib/google/cloud/bigquery/connection/v1/connection_service/rest/service_stub.rb index 28970baa240e..d18fe21fbb35 100644 --- a/google-cloud-bigquery-connection-v1/lib/google/cloud/bigquery/connection/v1/connection_service/rest/service_stub.rb +++ b/google-cloud-bigquery-connection-v1/lib/google/cloud/bigquery/connection/v1/connection_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_connection REST call # diff --git a/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_paths_test.rb b/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_paths_test.rb index b483328a1235..48cf4bfa4861 100644 --- a/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_paths_test.rb +++ b/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/connection/v1/connection_service" class ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cluster_path def test_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_connection_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_rest_test.rb b/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_rest_test.rb index dacfc5a8587c..77d531a7227f 100644 --- a/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_rest_test.rb +++ b/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_connection @@ -508,7 +516,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_test.rb b/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_test.rb index 97309d746ebf..a145798b5dac 100644 --- a/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_test.rb +++ b/google-cloud-bigquery-connection-v1/test/google/cloud/bigquery/connection/v1/connection_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_connection @@ -540,7 +548,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_exchange-v1beta1/lib/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service/client.rb b/google-cloud-bigquery-data_exchange-v1beta1/lib/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service/client.rb index 6defcd4ce02a..8b5a5029c394 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/lib/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service/client.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/lib/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service/client.rb @@ -158,13 +158,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @analytics_hub_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Stub, credentials: credentials, @@ -175,6 +168,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @analytics_hub_service_stub.endpoint + config.universe_domain = @analytics_hub_service_stub.universe_domain + end end ## diff --git a/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_paths_test.rb b/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_paths_test.rb index 02914ad2ea4c..384fffa5a71c 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_paths_test.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service" class ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_exchange_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_data_exchange_path def test_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_dataset_path def test_listing_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_listing_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_test.rb b/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_test.rb index f7d4030618fe..6a96094b07e3 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_test.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/test/google/cloud/bigquery/data_exchange/v1beta1/analytics_hub_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_data_exchanges @@ -971,7 +979,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_policies-v1/lib/google/cloud/bigquery/data_policies/v1/data_policy_service/rest/service_stub.rb b/google-cloud-bigquery-data_policies-v1/lib/google/cloud/bigquery/data_policies/v1/data_policy_service/rest/service_stub.rb index cbde8efb76f4..be109616ed0f 100644 --- a/google-cloud-bigquery-data_policies-v1/lib/google/cloud/bigquery/data_policies/v1/data_policy_service/rest/service_stub.rb +++ b/google-cloud-bigquery-data_policies-v1/lib/google/cloud/bigquery/data_policies/v1/data_policy_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_data_policy REST call # diff --git a/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_paths_test.rb b/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_paths_test.rb index 692164377346..86f1a655561a 100644 --- a/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_paths_test.rb +++ b/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/data_policies/v1/data_policy_service" class ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_data_policy_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_rest_test.rb b/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_rest_test.rb index 34c3d8dc394b..77aaaa28ea93 100644 --- a/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_rest_test.rb +++ b/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_policy @@ -562,7 +570,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_test.rb b/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_test.rb index 7831d97570fd..d75549d6f4f3 100644 --- a/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_test.rb +++ b/google-cloud-bigquery-data_policies-v1/test/google/cloud/bigquery/data_policies/v1/data_policy_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_policy @@ -598,7 +606,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::DataPolicies::V1::DataPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_paths_test.rb b/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_paths_test.rb index 3140d1005b9c..fb0d56423d27 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_paths_test.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/data_policies/v1beta1/data_policy_service" class ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_data_policy_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_test.rb b/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_test.rb index e8eb5d495654..4a1a6a661325 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_test.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/test/google/cloud/bigquery/data_policies/v1beta1/data_policy_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_policy @@ -536,7 +544,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb index beddfc95cb99..6235ef715768 100644 --- a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb +++ b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb @@ -204,13 +204,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_transfer_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Stub, credentials: credentials, @@ -221,6 +214,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_transfer_service_stub.endpoint + config.universe_domain = @data_transfer_service_stub.universe_domain + end end ## diff --git a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/client.rb b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/client.rb index 7812b5eb80e0..70d4828646e2 100644 --- a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/client.rb +++ b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/client.rb @@ -201,20 +201,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @data_transfer_service_stub = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_transfer_service_stub.endpoint + config.universe_domain = @data_transfer_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/service_stub.rb b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/service_stub.rb index a9339c0878d1..af0a70c5ca69 100644 --- a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/service_stub.rb +++ b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_data_source REST call # diff --git a/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_paths_test.rb b/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_paths_test.rb index 6c9c641b7eff..6d0f3e818937 100644 --- a/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_paths_test.rb +++ b/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/data_transfer/v1/data_transfer_service" class ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_source_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_data_source_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config| config.credentials = grpc_channel end @@ -64,7 +74,7 @@ def test_project_path def test_run_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_run_path def test_transfer_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_rest_test.rb b/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_rest_test.rb index a8d870ae1a53..4060b13d8c36 100644 --- a/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_rest_test.rb +++ b/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_data_source @@ -900,7 +908,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_test.rb b/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_test.rb index 6decebaa5c68..89b6072194a5 100644 --- a/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_test.rb +++ b/google-cloud-bigquery-data_transfer-v1/test/google/cloud/bigquery/data_transfer/v1/data_transfer_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_data_source @@ -990,7 +998,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_paths_test.rb b/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_paths_test.rb index a63e4ead09f9..8e203c9528d1 100644 --- a/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_paths_test.rb +++ b/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/migration/v2/migration_service" class ::Google::Cloud::Bigquery::Migration::V2::MigrationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_migration_subtask_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_migration_subtask_path def test_migration_workflow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_test.rb b/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_test.rb index 01642a34089a..2ba23df8db52 100644 --- a/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_test.rb +++ b/google-cloud-bigquery-migration-v2/test/google/cloud/bigquery/migration/v2/migration_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_migration_workflow @@ -487,7 +495,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb b/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb index 902c75488c4f..214ad328b0c9 100644 --- a/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb +++ b/google-cloud-bigquery-reservation-v1/lib/google/cloud/bigquery/reservation/v1/reservation_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_reservation REST call # diff --git a/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb b/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb index f590b2f2805d..9937526ac810 100644 --- a/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb +++ b/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/reservation/v1/reservation_service" class ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_assignment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_assignment_path def test_bi_reservation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_bi_reservation_path def test_capacity_commitment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_capacity_commitment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_reservation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb b/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb index 9f7df6fdd276..b4d7183e9ee4 100644 --- a/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb +++ b/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_reservation @@ -1228,7 +1236,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb b/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb index 3fdd5f67ef32..86d4dc930b46 100644 --- a/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb +++ b/google-cloud-bigquery-reservation-v1/test/google/cloud/bigquery/reservation/v1/reservation_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_reservation @@ -1350,7 +1358,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_paths_test.rb b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_paths_test.rb index da245f800694..1b7bd1696467 100644 --- a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_paths_test.rb +++ b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/storage/v1/big_query_read" class ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_read_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_read_session_path def test_read_stream_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_read_stream_path def test_table_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_test.rb b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_test.rb index f5625af16ce6..fea9356ca29e 100644 --- a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_test.rb +++ b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_read_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_read_session @@ -250,7 +258,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_paths_test.rb b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_paths_test.rb index 4a710e7b2622..3bfb077ff5bd 100644 --- a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_paths_test.rb +++ b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigquery/storage/v1/big_query_write" class ::Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_table_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_table_path def test_write_stream_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb index 17319251fc98..bd1441529c1b 100644 --- a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb +++ b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_write_stream @@ -448,7 +456,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_operations_test.rb b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_operations_test.rb index 47d3c14230a1..46864ba2fab3 100644 --- a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_operations_test.rb +++ b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_paths_test.rb b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_paths_test.rb index d43388957480..a3510445d7bd 100644 --- a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_paths_test.rb +++ b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigtable/admin/v2/bigtable_instance_admin" class ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_app_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_app_profile_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_cluster_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_test.rb b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_test.rb index 601c346406ea..64c29f56d873 100644 --- a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_test.rb +++ b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_instance_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_instance @@ -1385,7 +1393,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -1403,7 +1412,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_operations_test.rb b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_operations_test.rb index c6d62d284460..d2dd12501e1c 100644 --- a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_operations_test.rb +++ b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_paths_test.rb b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_paths_test.rb index 08dd0a4f9c59..d0a763d319eb 100644 --- a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_paths_test.rb +++ b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigtable/admin/v2/bigtable_table_admin" class ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_cluster_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_version_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_instance_path def test_snapshot_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_snapshot_path def test_table_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_test.rb b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_test.rb index 3521381c5fd8..bbbfcae759b3 100644 --- a/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_test.rb +++ b/google-cloud-bigtable-admin-v2/test/google/cloud/bigtable/admin/v2/bigtable_table_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_table @@ -1625,7 +1633,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -1643,7 +1652,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_paths_test.rb b/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_paths_test.rb index aada4d5913d4..3175299ed513 100644 --- a/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_paths_test.rb +++ b/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/bigtable/v2/bigtable" class ::Google::Cloud::Bigtable::V2::Bigtable::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::V2::Bigtable::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_table_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Bigtable::V2::Bigtable::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_test.rb b/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_test.rb index b532d8851fc4..eebcef5bb6dd 100644 --- a/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_test.rb +++ b/google-cloud-bigtable-v2/test/google/cloud/bigtable/v2/bigtable_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_read_rows @@ -703,7 +711,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Bigtable::V2::Bigtable::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-budgets-v1/lib/google/cloud/billing/budgets/v1/budget_service/rest/service_stub.rb b/google-cloud-billing-budgets-v1/lib/google/cloud/billing/budgets/v1/budget_service/rest/service_stub.rb index b7852f230686..7a165b2ab390 100644 --- a/google-cloud-billing-budgets-v1/lib/google/cloud/billing/budgets/v1/budget_service/rest/service_stub.rb +++ b/google-cloud-billing-budgets-v1/lib/google/cloud/billing/budgets/v1/budget_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_budget REST call # diff --git a/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_paths_test.rb b/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_paths_test.rb index 9ee523e59fb6..fe84ca374ea4 100644 --- a/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_paths_test.rb +++ b/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/billing/budgets/v1/budget_service" class ::Google::Cloud::Billing::Budgets::V1::BudgetService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_billing_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_billing_account_path def test_budget_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_rest_test.rb b/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_rest_test.rb index 2c48d31e8ca8..ff17fcd36f67 100644 --- a/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_rest_test.rb +++ b/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_budget @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::Budgets::V1::BudgetService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_test.rb b/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_test.rb index 399b9faf15b2..225631130f78 100644 --- a/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_test.rb +++ b/google-cloud-billing-budgets-v1/test/google/cloud/billing/budgets/v1/budget_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_budget @@ -356,7 +364,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_paths_test.rb b/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_paths_test.rb index 61b106cf9a7e..a005817346d1 100644 --- a/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_paths_test.rb +++ b/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/billing/budgets/v1beta1/budget_service" class ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_billing_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_billing_account_path def test_budget_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_test.rb b/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_test.rb index 18b81d13db7b..7af12e4fbac7 100644 --- a/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_test.rb +++ b/google-cloud-billing-budgets-v1beta1/test/google/cloud/billing/budgets/v1beta1/budget_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_budget @@ -356,7 +364,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/rest/service_stub.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/rest/service_stub.rb index 6266ddae0e3c..88fd325246b7 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/rest/service_stub.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_billing_account REST call # diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/rest/service_stub.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/rest/service_stub.rb index 7ad6b2c5e6b2..bdf580a508a1 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/rest/service_stub.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_services REST call # diff --git a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_paths_test.rb b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_paths_test.rb index 5ad1f18430e7..2e3bd4aa2c13 100644 --- a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_paths_test.rb +++ b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/billing/v1/cloud_billing" class ::Google::Cloud::Billing::V1::CloudBilling::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_billing_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_billing_account_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config| config.credentials = grpc_channel end @@ -64,7 +74,7 @@ def test_project_path def test_project_billing_info_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_rest_test.rb b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_rest_test.rb index 5eb12ef7cbd9..1a84e33ec155 100644 --- a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_rest_test.rb +++ b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_billing_account @@ -674,7 +682,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::V1::CloudBilling::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_test.rb b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_test.rb index ad3de22aea7b..5f014c1d2fd8 100644 --- a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_test.rb +++ b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_billing_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_billing_account @@ -727,7 +735,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_paths_test.rb b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_paths_test.rb index d22d8287b110..58a1d7e422a0 100644 --- a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_paths_test.rb +++ b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/billing/v1/cloud_catalog" class ::Google::Cloud::Billing::V1::CloudCatalog::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Billing::V1::CloudCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_rest_test.rb b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_rest_test.rb index 6a77f9b6ed32..2f1108b01f67 100644 --- a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_rest_test.rb +++ b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -180,7 +188,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::V1::CloudCatalog::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_test.rb b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_test.rb index 191ea2081ff4..89baf83dc066 100644 --- a/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_test.rb +++ b/google-cloud-billing-v1/test/google/cloud/billing/v1/cloud_catalog_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -189,7 +197,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Billing::V1::CloudCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest/service_stub.rb b/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest/service_stub.rb index d2d779a4158e..9476619461db 100644 --- a/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest/service_stub.rb +++ b/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_policy REST call # diff --git a/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/system_policy/rest/service_stub.rb b/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/system_policy/rest/service_stub.rb index 1a2ce390634d..f1f1ecb2e40d 100644 --- a/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/system_policy/rest/service_stub.rb +++ b/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/system_policy/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_system_policy REST call # diff --git a/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/validation_helper/rest/service_stub.rb b/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/validation_helper/rest/service_stub.rb index 90d4e324ef0e..274580013c12 100644 --- a/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/validation_helper/rest/service_stub.rb +++ b/google-cloud-binary_authorization-v1/lib/google/cloud/binary_authorization/v1/validation_helper/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the validate_attestation_occurrence REST call # diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_paths_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_paths_test.rb index 6ba6c45898f0..a33f0d4e2446 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_paths_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/binary_authorization/v1/binauthz_management_service" class ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_attestor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_attestor_path def test_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_policy_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_rest_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_rest_test.rb index af34f3c43f65..ea12e2a15a2e 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_rest_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_policy @@ -448,7 +456,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_test.rb index 52423f654239..d6cdc6bcde17 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/binauthz_management_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_policy @@ -470,7 +478,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_paths_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_paths_test.rb index 096556ed491f..c234cb966057 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_paths_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/binary_authorization/v1/system_policy" class ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_rest_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_rest_test.rb index 9c044ab846ea..79ae9e4c4dfa 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_rest_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_system_policy @@ -120,7 +128,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_test.rb index 35431ca20cbd..9d3e4c58ffcc 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/system_policy_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_system_policy @@ -109,7 +117,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_rest_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_rest_test.rb index 0d06ab302d3a..80ec30ee640c 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_rest_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_validate_attestation_occurrence @@ -123,7 +131,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_test.rb b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_test.rb index 45ad89c03250..bd7f820f7730 100644 --- a/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_test.rb +++ b/google-cloud-binary_authorization-v1/test/google/cloud/binary_authorization/v1/validation_helper_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_validate_attestation_occurrence @@ -115,7 +123,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/service_stub.rb b/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/service_stub.rb index 79a2415f0fa9..5e90d02b9dd7 100644 --- a/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/service_stub.rb +++ b/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_policy REST call # diff --git a/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest/service_stub.rb b/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest/service_stub.rb index 02982147c05e..08a9601339d4 100644 --- a/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest/service_stub.rb +++ b/google-cloud-binary_authorization-v1beta1/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_system_policy REST call # diff --git a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_paths_test.rb b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_paths_test.rb index 54fe2db4e106..f3c4310ede4d 100644 --- a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_paths_test.rb +++ b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/binary_authorization/v1beta1/binauthz_management_service" class ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_attestor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_attestor_path def test_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_policy_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_rest_test.rb b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_rest_test.rb index db8f08a003bd..34ef46233e1b 100644 --- a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_rest_test.rb +++ b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_policy @@ -448,7 +456,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_test.rb b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_test.rb index c0ee42582aa0..84e89d77b4e2 100644 --- a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_test.rb +++ b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/binauthz_management_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_policy @@ -470,7 +478,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_paths_test.rb b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_paths_test.rb index 7ca5c6860edd..ce283e9c2505 100644 --- a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_paths_test.rb +++ b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/binary_authorization/v1beta1/system_policy" class ::Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_rest_test.rb b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_rest_test.rb index 8c7950e0baec..b72c316a00f3 100644 --- a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_rest_test.rb +++ b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_system_policy @@ -120,7 +128,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_test.rb b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_test.rb index 12a69fb8a871..e48fb76b23c5 100644 --- a/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_test.rb +++ b/google-cloud-binary_authorization-v1beta1/test/google/cloud/binary_authorization/v1beta1/system_policy_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_system_policy @@ -109,7 +117,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-build-v1/lib/google/cloud/build/v1/cloud_build/rest/service_stub.rb b/google-cloud-build-v1/lib/google/cloud/build/v1/cloud_build/rest/service_stub.rb index 4566160d86ba..218bd52f22bc 100644 --- a/google-cloud-build-v1/lib/google/cloud/build/v1/cloud_build/rest/service_stub.rb +++ b/google-cloud-build-v1/lib/google/cloud/build/v1/cloud_build/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_build REST call # diff --git a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_operations_test.rb b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_operations_test.rb index 25dc7d94bffa..17b96cb22715 100644 --- a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_operations_test.rb +++ b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V1::CloudBuild::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_paths_test.rb b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_paths_test.rb index 9fc24f8b48d9..09053f1f9143 100644 --- a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_paths_test.rb +++ b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/build/v1/cloud_build" class ::Google::Cloud::Build::V1::CloudBuild::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_build_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_build_path def test_build_trigger_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_build_trigger_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_crypto_key_path def test_github_enterprise_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -82,7 +92,7 @@ def test_github_enterprise_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -94,7 +104,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -106,7 +116,7 @@ def test_network_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -118,7 +128,7 @@ def test_project_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -130,7 +140,7 @@ def test_repository_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +152,7 @@ def test_secret_version_path def test_service_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -154,7 +164,7 @@ def test_service_account_path def test_subscription_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -166,7 +176,7 @@ def test_subscription_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -178,7 +188,7 @@ def test_topic_path def test_worker_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_rest_test.rb b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_rest_test.rb index d74e9d48b462..a1dab6e29561 100644 --- a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_rest_test.rb +++ b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_build @@ -1080,7 +1088,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V1::CloudBuild::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_test.rb b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_test.rb index 6498535ec5fc..1686eda4e0e3 100644 --- a/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_test.rb +++ b/google-cloud-build-v1/test/google/cloud/build/v1/cloud_build_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_build @@ -1229,7 +1237,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end @@ -1247,7 +1256,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-build-v2/lib/google/cloud/build/v2/repository_manager/client.rb b/google-cloud-build-v2/lib/google/cloud/build/v2/repository_manager/client.rb index 484cb09c40c1..ec77f39dff1b 100644 --- a/google-cloud-build-v2/lib/google/cloud/build/v2/repository_manager/client.rb +++ b/google-cloud-build-v2/lib/google/cloud/build/v2/repository_manager/client.rb @@ -200,20 +200,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @repository_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Build::V2::RepositoryManager::Stub, credentials: credentials, @@ -224,6 +210,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @repository_manager_stub.endpoint + config.universe_domain = @repository_manager_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @repository_manager_stub.endpoint + config.universe_domain = @repository_manager_stub.universe_domain + end end ## diff --git a/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_operations_test.rb b/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_operations_test.rb index 25facea54e63..e5c8d12c6732 100644 --- a/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_operations_test.rb +++ b/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V2::RepositoryManager::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_paths_test.rb b/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_paths_test.rb index c54bfe911529..bc509afa1409 100644 --- a/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_paths_test.rb +++ b/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/build/v2/repository_manager" class ::Google::Cloud::Build::V2::RepositoryManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connection_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_repository_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_secret_version_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_test.rb b/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_test.rb index 9e3c75b81bee..fa0374a00d09 100644 --- a/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_test.rb +++ b/google-cloud-build-v2/test/google/cloud/build/v2/repository_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_connection @@ -948,7 +956,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end @@ -966,7 +975,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Build::V2::RepositoryManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/client.rb b/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/client.rb index 0c14e6099fbc..f4c49795a7fd 100644 --- a/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/client.rb +++ b/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/client.rb @@ -299,13 +299,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @certificate_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::CertificateManager::V1::CertificateManager::Stub, credentials: credentials, @@ -316,6 +309,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_manager_stub.endpoint + config.universe_domain = @certificate_manager_stub.universe_domain + end end ## diff --git a/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/client.rb b/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/client.rb index d52313640136..197eafb3bc3c 100644 --- a/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/client.rb +++ b/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/client.rb @@ -296,20 +296,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @certificate_manager_stub = ::Google::Cloud::CertificateManager::V1::CertificateManager::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_manager_stub.endpoint + config.universe_domain = @certificate_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/service_stub.rb b/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/service_stub.rb index 2453f34c79e5..2cd85745ec06 100644 --- a/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/service_stub.rb +++ b/google-cloud-certificate_manager-v1/lib/google/cloud/certificate_manager/v1/certificate_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_certificates REST call # diff --git a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_operations_test.rb b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_operations_test.rb index 4398b0ff9c19..19c0f953e077 100644 --- a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_operations_test.rb +++ b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_paths_test.rb b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_paths_test.rb index 4e9fb62d6ed1..e3c7232ba99b 100644 --- a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_paths_test.rb +++ b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/certificate_manager/v1/certificate_manager" class ::Google::Cloud::CertificateManager::V1::CertificateManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_ca_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_ca_pool_path def test_certificate_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_certificate_path def test_certificate_issuance_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_certificate_issuance_config_path def test_certificate_map_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_certificate_map_path def test_certificate_map_entry_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_certificate_map_entry_path def test_dns_authorization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_dns_authorization_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_rest_test.rb b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_rest_test.rb index 5fe4cfad5a09..df724865f738 100644 --- a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_rest_test.rb +++ b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_certificates @@ -1396,7 +1404,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_test.rb b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_test.rb index aec2ce2dd591..d1d92aa4c6e1 100644 --- a/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_test.rb +++ b/google-cloud-certificate_manager-v1/test/google/cloud/certificate_manager/v1/certificate_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_certificates @@ -1606,7 +1614,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end @@ -1624,7 +1633,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CertificateManager::V1::CertificateManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/service_stub.rb b/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/service_stub.rb index e3788d3e38dc..98ac3f27056d 100644 --- a/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/service_stub.rb +++ b/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_reports_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the run_report_job REST call # diff --git a/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_service/rest/service_stub.rb b/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_service/rest/service_stub.rb index cd92fd4dc3a0..ee036364eb8f 100644 --- a/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_service/rest/service_stub.rb +++ b/google-cloud-channel-v1/lib/google/cloud/channel/v1/cloud_channel_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_customers REST call # diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_operations_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_operations_test.rb index 2e9d61456e73..7ab08c2da6e0 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_operations_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_paths_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_paths_test.rb index 394b2d5379ff..651993f3b39b 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_paths_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/channel/v1/cloud_channel_reports_service" class ::Google::Cloud::Channel::V1::CloudChannelReportsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_report_path def test_report_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_rest_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_rest_test.rb index 8173a9bc58e1..514f760d75ba 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_rest_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_run_report_job @@ -237,7 +245,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_test.rb index 0f7c5254554d..abe9d9da045c 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_reports_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_run_report_job @@ -258,7 +266,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new do |config| config.credentials = grpc_channel end @@ -276,7 +285,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_operations_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_operations_test.rb index 703ee46027f6..c0ee9794fc53 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_operations_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_paths_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_paths_test.rb index eecc2a3c62a7..93d5db3253dd 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_paths_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/channel/v1/cloud_channel_service" class ::Google::Cloud::Channel::V1::CloudChannelService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_channel_partner_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_channel_partner_link_path def test_channel_partner_repricing_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_channel_partner_repricing_config_path def test_customer_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_customer_path def test_customer_repricing_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_customer_repricing_config_path def test_entitlement_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_entitlement_path def test_offer_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_offer_path def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_product_path def test_sku_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_rest_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_rest_test.rb index 186eb977c35c..aa28cd930476 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_rest_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_customers @@ -2807,7 +2815,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_test.rb b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_test.rb index 3978b2b669e0..2948d5dc2678 100644 --- a/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_test.rb +++ b/google-cloud-channel-v1/test/google/cloud/channel/v1/cloud_channel_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_customers @@ -3218,7 +3226,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -3236,7 +3245,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-cloud_dms-v1/lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb b/google-cloud-cloud_dms-v1/lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb index 7af9cca8af22..a77b3150cab6 100644 --- a/google-cloud-cloud_dms-v1/lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb +++ b/google-cloud-cloud_dms-v1/lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb @@ -232,20 +232,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_migration_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::CloudDMS::V1::DataMigrationService::Stub, credentials: credentials, @@ -256,6 +242,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_migration_service_stub.endpoint + config.universe_domain = @data_migration_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_migration_service_stub.endpoint + config.universe_domain = @data_migration_service_stub.universe_domain + end end ## diff --git a/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_operations_test.rb b/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_operations_test.rb index 3b415fa92531..c3257045b36f 100644 --- a/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_operations_test.rb +++ b/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_paths_test.rb b/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_paths_test.rb index 9dacd03c8235..a20f270274a3 100644 --- a/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_paths_test.rb +++ b/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/cloud_dms/v1/data_migration_service" class ::Google::Cloud::CloudDMS::V1::DataMigrationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connection_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connection_profile_path def test_conversion_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_conversion_workspace_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_mapping_rule_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_mapping_rule_path def test_migration_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_migration_job_path def test_networks_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_networks_path def test_private_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_test.rb b/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_test.rb index b1935ac27c39..40290a9907c4 100644 --- a/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_test.rb +++ b/google-cloud-cloud_dms-v1/test/google/cloud/cloud_dms/v1/data_migration_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_migration_jobs @@ -2753,7 +2761,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end @@ -2771,7 +2780,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-cloud_quotas-v1/lib/google/cloud/cloud_quotas/v1/cloud_quotas/rest/service_stub.rb b/google-cloud-cloud_quotas-v1/lib/google/cloud/cloud_quotas/v1/cloud_quotas/rest/service_stub.rb index 7387dabf1ebd..19d80bb5422a 100644 --- a/google-cloud-cloud_quotas-v1/lib/google/cloud/cloud_quotas/v1/cloud_quotas/rest/service_stub.rb +++ b/google-cloud-cloud_quotas-v1/lib/google/cloud/cloud_quotas/v1/cloud_quotas/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_quota_infos REST call # diff --git a/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_paths_test.rb b/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_paths_test.rb index e6bca34c2d03..190d651dd01e 100644 --- a/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_paths_test.rb +++ b/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/cloud_quotas/v1/cloud_quotas" class ::Google::Cloud::CloudQuotas::V1::CloudQuotas::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudQuotas::V1::CloudQuotas::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_location_path def test_quota_info_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudQuotas::V1::CloudQuotas::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_quota_info_path def test_quota_preference_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudQuotas::V1::CloudQuotas::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_quota_preference_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::CloudQuotas::V1::CloudQuotas::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_rest_test.rb b/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_rest_test.rb index a3d9f543926f..6e5811c299ec 100644 --- a/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_rest_test.rb +++ b/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_quota_infos @@ -403,7 +411,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::CloudQuotas::V1::CloudQuotas::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_test.rb b/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_test.rb index bf8415e3d5a0..81cb9d6172c6 100644 --- a/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_test.rb +++ b/google-cloud-cloud_quotas-v1/test/google/cloud/cloud_quotas/v1/cloud_quotas_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_quota_infos @@ -435,7 +443,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::CloudQuotas::V1::CloudQuotas::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-commerce-consumer-procurement-v1/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/service_stub.rb b/google-cloud-commerce-consumer-procurement-v1/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/service_stub.rb index 23f81554ca85..b432835242cb 100644 --- a/google-cloud-commerce-consumer-procurement-v1/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/service_stub.rb +++ b/google-cloud-commerce-consumer-procurement-v1/lib/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service/rest/service_stub.rb @@ -54,6 +54,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the place_order REST call # diff --git a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_operations_test.rb b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_operations_test.rb index 785a5616edfd..b13a380ceacc 100644 --- a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_operations_test.rb +++ b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_paths_test.rb b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_paths_test.rb index 167160ad83dc..0e50603f5108 100644 --- a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_paths_test.rb +++ b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service" class ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_billing_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_billing_account_path def test_offer_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_rest_test.rb b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_rest_test.rb index 4b560af81688..56b6ff8f8293 100644 --- a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_rest_test.rb +++ b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_place_order @@ -234,7 +242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_test.rb b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_test.rb index da3556087dd6..a11b9085890c 100644 --- a/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_test.rb +++ b/google-cloud-commerce-consumer-procurement-v1/test/google/cloud/commerce/consumer/procurement/v1/consumer_procurement_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_place_order @@ -247,7 +255,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client.new do |config| config.credentials = grpc_channel end @@ -265,7 +274,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Commerce::Consumer::Procurement::V1::ConsumerProcurementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb index 724835110c1f..a894cb098c37 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb index c9523b204113..916f9996b3b4 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb index 0fea33860642..1ea172bd40a1 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb index f7d4949d6300..bdaaa93e4428 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_signed_url_key REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb index 0f35f537355c..fff8e51cf7e1 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_signed_url_key REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb index c3d49bd442c8..090ccd3d6715 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/disks/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/disks/rest/service_stub.rb index 708228a99f59..896297517981 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/disks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_resource_policies REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb index fe1ba4fbe1e0..eb51b3b63010 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb index f3e6409c9bc4..9f52ed352e7d 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_association REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb index 3a21b076aa44..14bfea928ab6 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb index 78172ce42b08..665af80fee0c 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb index 2a95509ab3da..e45cd4081c6b 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb index 6fa31060285c..2c08ff4b4d2b 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb index e7cff7240955..8c0d776fec49 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the attach_network_endpoints REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb index 4eb112a381ef..4c43abf03e8a 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb index 32d982d09c2f..8993fd138f0b 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb index 3fe4776c3b45..a8e032069b39 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb index d17030dc2772..759c3804493a 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb index 2480d53153f8..f4d5e4eba5d8 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/images/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/images/rest/service_stub.rb index f679d0c4c5d1..9043665a2a49 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/images/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/images/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb index 4943e2917e8f..a54b1805614f 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the abandon_instances REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb index ad75a3a37cc0..41eeb42abb90 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_instances REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb index 27ed45facc6a..84640f6ea5f6 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instances/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instances/rest/service_stub.rb index bcc3e37c9307..82f87be8ef81 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/instances/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_access_config REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb index 2764fb9db529..f4ece3fa33e2 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb index 9f9a9f898fc1..c07c6c9a6255 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb index 2bcec6626c2f..3981a7f0d8dc 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb index 165cd9f31469..d53657b9aa21 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb index 9cf47794130a..1701e92d3f43 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb index b427db5f098a..da0b0dabafb1 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb index 9ace2d169045..ba4e5a8ce325 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb index aaea12230939..3901d7139377 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb index 9dc48b7c47e1..0e8d5bd04973 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb index d2ddd0e17672..43871527e433 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb index e1a9b9e8606e..ce783aef4118 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb index 2de8c2cf986c..2bcb5f3e0f70 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_association REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/networks/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/networks/rest/service_stub.rb index d659773e606a..44ea164fb092 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/networks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_peering REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb index 19d466fcdf68..c67270793f5a 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_nodes REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb index baf3a4a9a9b5..c34b495672c1 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb index 65b5aac8f408..b0fd281b57db 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb index b4caa137cff7..30f29d8f64ca 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/projects/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/projects/rest/service_stub.rb index 8be2f417b5ee..5586840335ee 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/projects/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the disable_xpn_host REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb index b3c80a09c0fb..2647f4dbe7b8 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the announce REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb index 1fad82c49646..bd60f6b742c7 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb index fa37d138f787..99cc6bc67ed7 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb index ad6c2c5d7535..de45805235b4 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb index 1b044638971d..8ba14a56b1c0 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb index c9bc2fcce0a6..ebf722651a73 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb index 834dfba70eee..f4f2396ad8b0 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_resource_policies REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb index 10cf9df5409c..351582cf2eb4 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb index d4cf8467000e..11a25f9baeef 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb index 1ffa6dfac2ee..9bd3c3c8743e 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the abandon_instances REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb index 5489f8a4afff..fc072aab74d2 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb index eb514d592922..45119f7a25d0 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb index 38b23d5d35b3..35706c8db35c 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the bulk_insert REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb index a527aaf8fe5f..3c3e2cde3544 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the attach_network_endpoints REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb index 2e362c4af71a..2a83db69da0b 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_association REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb index 5914bc30ca2b..5746c7399350 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb index 28bffb11ce14..37dcc855b861 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb index 84a16f3caf49..c206ca65e3e9 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_rule REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb index 9cd2a7b1c145..eef7629de5fc 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb index 843ef72c5fb1..1f8b8ae04498 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb index e326ea3cb626..e90b5bc76ca5 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb index d423537e6a19..7f20b8c9d2fb 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb index c062a883f415..9a5f52e93c35 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb index 74725f8057d8..e3022896f949 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/regions/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/regions/rest/service_stub.rb index ce66f8706116..1032dfad6558 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/regions/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb index a14207a23e9a..7345f95ea9ec 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb index a09691eee7fa..024b32e8c10b 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/routers/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/routers/rest/service_stub.rb index 4f12cc02e9d9..a61520ef6063 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/routers/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/routes/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/routes/rest/service_stub.rb index 614b30ccb356..72ce6697ebf6 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/routes/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb index e3345bc24b71..750c0072d398 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_rule REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb index f0f890597bf5..d803e85e3fc7 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb index b3d3e7833f40..40291ad0d7f2 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb index 8e2ce47e2248..d5e17632f475 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb index 21a032e8a59c..c3818b688bfa 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb index ac4aff3bf28e..2c9f199b5748 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb index a34e2600463a..dd2f1c69321e 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb index cc17de2358c2..788b4050b974 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb index fbb56d7870c8..2d2cf61e1fc5 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb index 75d2ccc6c565..735488cc7b82 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb index 233a2c8a47f9..3944e81fce52 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb index 0b578997f1a1..dc8fdf1148b6 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the add_health_check REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb index 39a6b04b1731..96f1c8126a42 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb index 67f8c9289ece..2ae460d2d0f5 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb index f1e348406222..2bf71e42116d 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb index 6064a0ccb8bc..ac7729e4e5b1 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb index 1ef0cf7034c3..602030313f48 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb index 0ab58f27b3b3..f76e021bf2ee 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the aggregated_list REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb index 47d51b61f0f2..bfce0b243318 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the delete REST call # diff --git a/google-cloud-compute-v1/lib/google/cloud/compute/v1/zones/rest/service_stub.rb b/google-cloud-compute-v1/lib/google/cloud/compute/v1/zones/rest/service_stub.rb index fac04736af7d..54d86cbd9dcc 100644 --- a/google-cloud-compute-v1/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +++ b/google-cloud-compute-v1/lib/google/cloud/compute/v1/zones/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get REST call # diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/accelerator_types_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/accelerator_types_rest_test.rb index 0381b9b37fcc..3a430a6b62ab 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/accelerator_types_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/accelerator_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -243,7 +251,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/addresses_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/addresses_rest_test.rb index 3706aac70bec..d74681487649 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/addresses_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/addresses_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -473,7 +481,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Addresses::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/autoscalers_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/autoscalers_rest_test.rb index d47d50345642..3d262bbad203 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/autoscalers_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/autoscalers_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -473,7 +481,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Autoscalers::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_buckets_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_buckets_rest_test.rb index 47a3e1ae56d9..d8659c3ca967 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_buckets_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_buckets_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_signed_url_key @@ -745,7 +753,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::BackendBuckets::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_services_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_services_rest_test.rb index 10d8a1eec05b..a276ef839319 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_services_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/backend_services_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_signed_url_key @@ -978,7 +986,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::BackendServices::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/disk_types_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/disk_types_rest_test.rb index daf35866d2aa..13448245a6f2 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/disk_types_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/disk_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -243,7 +251,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::DiskTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/disks_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/disks_rest_test.rb index baba35e8961a..c7e6517099e2 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/disks_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/disks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_resource_policies @@ -1109,7 +1117,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Disks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/external_vpn_gateways_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/external_vpn_gateways_rest_test.rb index 959210042132..9709ed9b2003 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/external_vpn_gateways_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/external_vpn_gateways_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -404,7 +412,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::ExternalVpnGateways::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/firewall_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/firewall_policies_rest_test.rb index dd45f4589894..63d0ae83aec0 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/firewall_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/firewall_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_association @@ -1069,7 +1077,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::FirewallPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/firewalls_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/firewalls_rest_test.rb index 0c984a41e479..d0d167d56cc0 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/firewalls_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/firewalls_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -406,7 +414,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Firewalls::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/forwarding_rules_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/forwarding_rules_rest_test.rb index 4676723a66f3..b9509d5b2dbf 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/forwarding_rules_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/forwarding_rules_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -531,7 +539,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::ForwardingRules::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_addresses_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_addresses_rest_test.rb index 8bbdb54078e3..dbe8b528ad4d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_addresses_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_addresses_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -405,7 +413,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_forwarding_rules_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_forwarding_rules_rest_test.rb index e1644ae0bdd7..13fc1a77db80 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_forwarding_rules_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_forwarding_rules_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -462,7 +470,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_network_endpoint_groups_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_network_endpoint_groups_rest_test.rb index 89e6d27e60eb..55ca7b9775cb 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_network_endpoint_groups_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_network_endpoint_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_attach_network_endpoints @@ -466,7 +474,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_operations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_operations_rest_test.rb index f42c33b4c7cb..107044303736 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_operations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_operations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -351,7 +359,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_organization_operations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_organization_operations_rest_test.rb index 498a3c1226f5..3e7b427ced00 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_organization_operations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_organization_operations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -235,7 +243,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_public_delegated_prefixes_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_public_delegated_prefixes_rest_test.rb index 7a367de1c4e9..2534fda30827 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/global_public_delegated_prefixes_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/global_public_delegated_prefixes_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -349,7 +357,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/health_checks_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/health_checks_rest_test.rb index a2b117d08135..bcc9569353bf 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/health_checks_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/health_checks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -467,7 +475,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::HealthChecks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/image_family_views_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/image_family_views_rest_test.rb index e0c8803021c7..c592826c6552 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/image_family_views_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/image_family_views_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::ImageFamilyViews::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/images_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/images_rest_test.rb index 191471d18b76..2f69a94664dd 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/images_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/images_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -686,7 +694,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Images::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_group_managers_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_group_managers_rest_test.rb index d617341145b2..7566e7222aec 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_group_managers_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_group_managers_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_abandon_instances @@ -1234,7 +1242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_groups_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_groups_rest_test.rb index 1f32a0a29d3e..23e6879f0235 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_groups_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_instances @@ -593,7 +601,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::InstanceGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_templates_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_templates_rest_test.rb index df93a24747ca..b29e3306c034 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_templates_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/instance_templates_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -521,7 +529,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::InstanceTemplates::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/instances_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/instances_rest_test.rb index 134c6ef7f8e9..1decbe25151a 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/instances_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/instances_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_access_config @@ -2791,7 +2799,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_attachments_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_attachments_rest_test.rb index b1e9e4b8a061..f4d3d30ee581 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_attachments_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_attachments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -474,7 +482,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::InterconnectAttachments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_locations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_locations_rest_test.rb index 8eb6761d8562..081a4847f4ea 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_locations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_locations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -180,7 +188,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::InterconnectLocations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_remote_locations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_remote_locations_rest_test.rb index eaa1c9319824..150dd8b67292 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_remote_locations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnect_remote_locations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -180,7 +188,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::InterconnectRemoteLocations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnects_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnects_rest_test.rb index 5133cc8f1f36..841df008302d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnects_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/interconnects_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -515,7 +523,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Interconnects::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/license_codes_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/license_codes_rest_test.rb index 7191bdec758b..8d5cd6d77f37 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/license_codes_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/license_codes_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::LicenseCodes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/licenses_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/licenses_rest_test.rb index 17da32e20e2e..169a1d3f0977 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/licenses_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/licenses_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -460,7 +468,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Licenses::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_images_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_images_rest_test.rb index e7651e96d528..6debf9a15293 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_images_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_images_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -461,7 +469,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::MachineImages::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_types_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_types_rest_test.rb index 432e39d92166..a267dac060a0 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_types_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/machine_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -243,7 +251,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::MachineTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_attachments_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_attachments_rest_test.rb index cb7c0a445337..f77e1b67a9bb 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_attachments_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_attachments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -586,7 +594,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NetworkAttachments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_edge_security_services_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_edge_security_services_rest_test.rb index 0025b8799ed8..bc4639556b07 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_edge_security_services_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_edge_security_services_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -358,7 +366,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NetworkEdgeSecurityServices::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_endpoint_groups_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_endpoint_groups_rest_test.rb index 4c48e84693d7..c1dfe4b83361 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_endpoint_groups_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_endpoint_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -592,7 +600,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NetworkEndpointGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_firewall_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_firewall_policies_rest_test.rb index 15da4a2b5675..7592bbfd6169 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/network_firewall_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/network_firewall_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_association @@ -975,7 +983,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NetworkFirewallPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/networks_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/networks_rest_test.rb index ea8528e2655e..089eceb72b09 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/networks_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/networks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_peering @@ -694,7 +702,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Networks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/node_groups_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/node_groups_rest_test.rb index 650a1aa936cb..4764eb32f9e1 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/node_groups_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/node_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_nodes @@ -880,7 +888,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NodeGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/node_templates_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/node_templates_rest_test.rb index 5a6b73432e99..759f670aacab 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/node_templates_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/node_templates_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -528,7 +536,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NodeTemplates::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/node_types_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/node_types_rest_test.rb index 541778706f25..cfb2e0beaf59 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/node_types_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/node_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -243,7 +251,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::NodeTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/packet_mirrorings_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/packet_mirrorings_rest_test.rb index 586575cccb49..8e3dc1ebcba3 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/packet_mirrorings_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/packet_mirrorings_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -472,7 +480,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::PacketMirrorings::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/projects_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/projects_rest_test.rb index 441e876e21af..48bc86ba94fc 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/projects_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/projects_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_disable_xpn_host @@ -795,7 +803,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Projects::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/public_advertised_prefixes_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/public_advertised_prefixes_rest_test.rb index 468c82817cc5..2c80a65309ee 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/public_advertised_prefixes_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/public_advertised_prefixes_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_announce @@ -461,7 +469,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/public_delegated_prefixes_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/public_delegated_prefixes_rest_test.rb index 7c23a2c8ee29..ba399dd87086 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/public_delegated_prefixes_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/public_delegated_prefixes_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -529,7 +537,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_autoscalers_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_autoscalers_rest_test.rb index 139a7faaa106..3e019aae23cb 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_autoscalers_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_autoscalers_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -412,7 +420,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionAutoscalers::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_backend_services_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_backend_services_rest_test.rb index 094485ac4daa..30bf5370decf 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_backend_services_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_backend_services_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -758,7 +766,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_commitments_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_commitments_rest_test.rb index b5e1b34a7d4b..f437517add1e 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_commitments_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_commitments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -360,7 +368,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionCommitments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disk_types_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disk_types_rest_test.rb index 4f25ce9e984d..3700d43b1018 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disk_types_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disk_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -182,7 +190,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionDiskTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disks_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disks_rest_test.rb index ae0716918d72..eac2b31261e8 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disks_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_disks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_resource_policies @@ -1047,7 +1055,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionDisks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_check_services_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_check_services_rest_test.rb index 27021cbd423f..3cbe6f859eb5 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_check_services_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_check_services_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -354,7 +362,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionHealthCheckServices::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_checks_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_checks_rest_test.rb index 515d72f31aa0..ae9f1bc3914c 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_checks_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_health_checks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -412,7 +420,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionHealthChecks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_group_managers_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_group_managers_rest_test.rb index 1db56a337ab3..0cb3b719936f 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_group_managers_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_group_managers_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_abandon_instances @@ -1173,7 +1181,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_groups_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_groups_rest_test.rb index 9b6c0eb17231..f6d62716b4d0 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_groups_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -302,7 +310,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_templates_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_templates_rest_test.rb index 78a95c328b61..2cb70915151d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_templates_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instance_templates_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -296,7 +304,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instances_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instances_rest_test.rb index 7ca321d124b9..ca24c79d8439 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instances_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_instances_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_bulk_insert @@ -123,7 +131,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionInstances::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_endpoint_groups_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_endpoint_groups_rest_test.rb index 571c3fa8cba8..14f64806b70c 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_endpoint_groups_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_endpoint_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_attach_network_endpoints @@ -473,7 +481,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionNetworkEndpointGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_firewall_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_firewall_policies_rest_test.rb index da066d324dcf..da9f58042491 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_firewall_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_network_firewall_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_association @@ -1047,7 +1055,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionNetworkFirewallPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_notification_endpoints_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_notification_endpoints_rest_test.rb index 6ff58603aa24..9bfb82767d4b 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_notification_endpoints_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_notification_endpoints_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -296,7 +304,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionNotificationEndpoints::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_operations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_operations_rest_test.rb index cfcad20022c6..5984a9166e35 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_operations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_operations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -294,7 +302,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_security_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_security_policies_rest_test.rb index 8f125b73bb8c..2379b888d785 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_security_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_security_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_rule @@ -588,7 +596,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_certificates_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_certificates_rest_test.rb index 4c45405ae480..7d7ccbfe08f7 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_certificates_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_certificates_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -296,7 +304,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionSslCertificates::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_policies_rest_test.rb index f01258aee93d..4e4ae3efb52d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_ssl_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -414,7 +422,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_http_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_http_proxies_rest_test.rb index f1a0ace00c86..5d95e56bf3bd 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_http_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_http_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -354,7 +362,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_https_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_https_proxies_rest_test.rb index e37400558743..af5b631e0883 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_https_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_https_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -470,7 +478,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_tcp_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_tcp_proxies_rest_test.rb index 682581b53183..285e1e253e07 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_tcp_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_target_tcp_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -296,7 +304,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_url_maps_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_url_maps_rest_test.rb index 951cefbda220..cd914251d3a5 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/region_url_maps_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/region_url_maps_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -469,7 +477,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::RegionUrlMaps::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/regions_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/regions_rest_test.rb index 194752007988..eb7296487842 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/regions_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/regions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -180,7 +188,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Regions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/reservations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/reservations_rest_test.rb index cdaf8975a22b..8efae27b85b6 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/reservations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/reservations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -646,7 +654,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Reservations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/resource_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/resource_policies_rest_test.rb index d377f28b13d6..c8b92f4e4966 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/resource_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/resource_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -587,7 +595,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/routers_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/routers_rest_test.rb index 52bfb515f249..b5242565654b 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/routers_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/routers_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -705,7 +713,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Routers::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/routes_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/routes_rest_test.rb index 7e3d4c771a6f..5f61842b0b39 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/routes_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/routes_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -292,7 +300,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Routes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/security_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/security_policies_rest_test.rb index 4e47d68df7d8..aaf7fff0bf1e 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/security_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/security_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_rule @@ -755,7 +763,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/service_attachments_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/service_attachments_rest_test.rb index dc45a039f15f..5ee29d17d125 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/service_attachments_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/service_attachments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -586,7 +594,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshot_settings_service_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshot_settings_service_rest_test.rb index 1cf917a577c0..3c32c15fbfd9 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshot_settings_service_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshot_settings_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::SnapshotSettingsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshots_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshots_rest_test.rb index b292251c3d51..7f0612f091ba 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshots_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/snapshots_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -516,7 +524,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Snapshots::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_certificates_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_certificates_rest_test.rb index 648af6634fa4..19bf5ccedf8d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_certificates_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_certificates_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -353,7 +361,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::SslCertificates::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_policies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_policies_rest_test.rb index fed89cc4f103..ee0f380bb27a 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_policies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/ssl_policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -469,7 +477,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::SslPolicies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/subnetworks_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/subnetworks_rest_test.rb index 547f33ba3be7..c4dbfa10d41c 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/subnetworks_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/subnetworks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -762,7 +770,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Subnetworks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_grpc_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_grpc_proxies_rest_test.rb index dd52f02b9ed0..8395937bb3bc 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_grpc_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_grpc_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -349,7 +357,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetGrpcProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_http_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_http_proxies_rest_test.rb index 19f6f7f95abd..3d2d2d7ab78b 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_http_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_http_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -467,7 +475,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetHttpProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_https_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_https_proxies_rest_test.rb index 14726ed8df5b..7a4b6e79d10a 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_https_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_https_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -695,7 +703,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_instances_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_instances_rest_test.rb index f0053bf427dc..2dc547ab6205 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_instances_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_instances_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -415,7 +423,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_pools_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_pools_rest_test.rb index edd055fe23de..8893125e682d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_pools_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_pools_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_add_health_check @@ -763,7 +771,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetPools::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_ssl_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_ssl_proxies_rest_test.rb index fb352aababce..ccc6fd3fdb7c 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_ssl_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_ssl_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -577,7 +585,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetSslProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_tcp_proxies_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_tcp_proxies_rest_test.rb index ffa3ab897e83..1f13a9f61ada 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_tcp_proxies_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_tcp_proxies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -467,7 +475,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetTcpProxies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_vpn_gateways_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_vpn_gateways_rest_test.rb index 50d77bafb5d2..8bc28d3b13ef 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/target_vpn_gateways_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/target_vpn_gateways_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -415,7 +423,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::TargetVpnGateways::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/url_maps_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/url_maps_rest_test.rb index 7696d31d4771..26ac6b0a1cba 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/url_maps_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/url_maps_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -580,7 +588,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::UrlMaps::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_gateways_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_gateways_rest_test.rb index 284184989e47..f5d26d0e872a 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_gateways_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_gateways_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -528,7 +536,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::VpnGateways::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_tunnels_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_tunnels_rest_test.rb index aa92b1f81083..f8c2478d1ea7 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_tunnels_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/vpn_tunnels_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_aggregated_list @@ -415,7 +423,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::VpnTunnels::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/zone_operations_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/zone_operations_rest_test.rb index d7880736af77..78598dd53230 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/zone_operations_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/zone_operations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete @@ -294,7 +302,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-compute-v1/test/google/cloud/compute/v1/zones_rest_test.rb b/google-cloud-compute-v1/test/google/cloud/compute/v1/zones_rest_test.rb index 1ffead04ae18..9c62cdc0029d 100644 --- a/google-cloud-compute-v1/test/google/cloud/compute/v1/zones_rest_test.rb +++ b/google-cloud-compute-v1/test/google/cloud/compute/v1/zones_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get @@ -180,7 +188,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Compute::V1::Zones::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/client.rb b/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/client.rb index 05b89f41baa8..e8e5c825e6b4 100644 --- a/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/client.rb +++ b/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/client.rb @@ -159,13 +159,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @confidential_computing_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @confidential_computing_stub.endpoint + config.universe_domain = @confidential_computing_stub.universe_domain + end end ## diff --git a/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/client.rb b/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/client.rb index 4a23596d30ea..99fd6b1dcafd 100644 --- a/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/client.rb +++ b/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/client.rb @@ -156,20 +156,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @confidential_computing_stub = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @confidential_computing_stub.endpoint + config.universe_domain = @confidential_computing_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/service_stub.rb b/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/service_stub.rb index d61987c97f7a..fb1c916c9e30 100644 --- a/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/service_stub.rb +++ b/google-cloud-confidential_computing-v1/lib/google/cloud/confidential_computing/v1/confidential_computing/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_challenge REST call # diff --git a/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_paths_test.rb b/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_paths_test.rb index 4efef4f82d39..4a1128043413 100644 --- a/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_paths_test.rb +++ b/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/confidential_computing/v1/confidential_computing" class ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_challenge_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_challenge_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_rest_test.rb b/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_rest_test.rb index 714707667928..9c07580801d8 100644 --- a/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_rest_test.rb +++ b/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_challenge @@ -179,7 +187,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_test.rb b/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_test.rb index 23650ab00a41..fbd21206286c 100644 --- a/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_test.rb +++ b/google-cloud-confidential_computing-v1/test/google/cloud/confidential_computing/v1/confidential_computing_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_challenge @@ -177,7 +185,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ConfidentialComputing::V1::ConfidentialComputing::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/client.rb b/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/client.rb index 05590d01fecd..cf71687ae77b 100644 --- a/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/client.rb +++ b/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/client.rb @@ -156,20 +156,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @config_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ConfigService::V1::Config::Stub, credentials: credentials, @@ -180,6 +166,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config_stub.endpoint + config.universe_domain = @config_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config_stub.endpoint + config.universe_domain = @config_stub.universe_domain + end end ## diff --git a/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/client.rb b/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/client.rb index 52f66386914b..a8d4f5d6e52b 100644 --- a/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/client.rb +++ b/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/client.rb @@ -153,28 +153,28 @@ def initialize config.universe_domain = @config.universe_domain end + @config_stub = ::Google::Cloud::ConfigService::V1::Config::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @config_stub.endpoint + config.universe_domain = @config_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @config_stub.endpoint + config.universe_domain = @config_stub.universe_domain config.bindings_override = @config.bindings_override end - - @config_stub = ::Google::Cloud::ConfigService::V1::Config::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/service_stub.rb b/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/service_stub.rb index ec0de7b98d54..48c8a70f8a46 100644 --- a/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/service_stub.rb +++ b/google-cloud-config_service-v1/lib/google/cloud/config_service/v1/config/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_deployments REST call # diff --git a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_operations_test.rb b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_operations_test.rb index 66820e12736a..845d4c8aca02 100644 --- a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_operations_test.rb +++ b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ConfigService::V1::Config::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_paths_test.rb b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_paths_test.rb index 66f6302eeb6b..18d2846b8268 100644 --- a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_paths_test.rb +++ b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/config_service/v1/config" class ::Google::Cloud::ConfigService::V1::Config::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_deployment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_resource_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_resource_path def test_revision_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_revision_path def test_service_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_service_account_path def test_worker_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_rest_test.rb b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_rest_test.rb index cccc86fc41a1..a74348d1ece5 100644 --- a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_rest_test.rb +++ b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_deployments @@ -955,7 +963,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ConfigService::V1::Config::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_test.rb b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_test.rb index 7193f8956ae6..a41a7b36df0b 100644 --- a/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_test.rb +++ b/google-cloud-config_service-v1/test/google/cloud/config_service/v1/config_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_deployments @@ -1069,7 +1077,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end @@ -1087,7 +1096,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ConfigService::V1::Config::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-contact_center_insights-v1/lib/google/cloud/contact_center_insights/v1/contact_center_insights/rest/service_stub.rb b/google-cloud-contact_center_insights-v1/lib/google/cloud/contact_center_insights/v1/contact_center_insights/rest/service_stub.rb index 3550c3e09e48..891302e918de 100644 --- a/google-cloud-contact_center_insights-v1/lib/google/cloud/contact_center_insights/v1/contact_center_insights/rest/service_stub.rb +++ b/google-cloud-contact_center_insights-v1/lib/google/cloud/contact_center_insights/v1/contact_center_insights/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_conversation REST call # diff --git a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_operations_test.rb b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_operations_test.rb index 426ce267b3d3..e4e93c22817a 100644 --- a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_operations_test.rb +++ b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_paths_test.rb b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_paths_test.rb index 6ede381f542f..67226640849c 100644 --- a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_paths_test.rb +++ b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/contact_center_insights/v1/contact_center_insights" class ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_analysis_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_analysis_path def test_conversation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_conversation_path def test_conversation_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_conversation_profile_path def test_issue_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_issue_path def test_issue_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_issue_model_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_participant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -112,7 +122,7 @@ def test_participant_path def test_phrase_matcher_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -124,7 +134,7 @@ def test_phrase_matcher_path def test_recognizer_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -136,7 +146,7 @@ def test_recognizer_path def test_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -148,7 +158,7 @@ def test_settings_path def test_view_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_rest_test.rb b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_rest_test.rb index ad41efd8f68a..5d350c72eefb 100644 --- a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_rest_test.rb +++ b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation @@ -2218,7 +2226,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_test.rb b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_test.rb index 46683d8517da..fdfb7c1abcf6 100644 --- a/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_test.rb +++ b/google-cloud-contact_center_insights-v1/test/google/cloud/contact_center_insights/v1/contact_center_insights_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation @@ -2478,7 +2486,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end @@ -2496,7 +2505,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_paths_test.rb b/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_paths_test.rb index 090a8be55c83..dd32e7e099ac 100644 --- a/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_paths_test.rb +++ b/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/container/v1/cluster_manager" class ::Google::Cloud::Container::V1::ClusterManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Container::V1::ClusterManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb b/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb index db248eebc318..3e3babc12795 100644 --- a/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb +++ b/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -2306,7 +2314,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Container::V1::ClusterManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_paths_test.rb b/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_paths_test.rb index 10b4172303e6..b4688ca35c59 100644 --- a/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_paths_test.rb +++ b/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/container/v1beta1/cluster_manager" class ::Google::Cloud::Container::V1beta1::ClusterManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Container::V1beta1::ClusterManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb b/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb index 3180d5bc857d..b585bd7d928f 100644 --- a/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb +++ b/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -2364,7 +2372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Container::V1beta1::ClusterManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_paths_test.rb b/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_paths_test.rb index 39c45a65565e..5d57031cc5c0 100644 --- a/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_paths_test.rb +++ b/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/container_analysis/v1/container_analysis" class ::Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_test.rb b/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_test.rb index 413a5a6596bd..e6abe6e5e6df 100644 --- a/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_test.rb +++ b/google-cloud-container_analysis-v1/test/google/cloud/container_analysis/v1/container_analysis_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -293,7 +301,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-lineage-v1/lib/google/cloud/data_catalog/lineage/v1/lineage/rest/service_stub.rb b/google-cloud-data_catalog-lineage-v1/lib/google/cloud/data_catalog/lineage/v1/lineage/rest/service_stub.rb index ec6331285388..74d3b9590fbc 100644 --- a/google-cloud-data_catalog-lineage-v1/lib/google/cloud/data_catalog/lineage/v1/lineage/rest/service_stub.rb +++ b/google-cloud-data_catalog-lineage-v1/lib/google/cloud/data_catalog/lineage/v1/lineage/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the process_open_lineage_run_event REST call # diff --git a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_operations_test.rb b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_operations_test.rb index af74e6bff310..40a3c7c44ff0 100644 --- a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_operations_test.rb +++ b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_paths_test.rb b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_paths_test.rb index 4c23b6f93d8a..8aeef400a054 100644 --- a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_paths_test.rb +++ b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/lineage/v1/lineage" class ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_lineage_event_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_lineage_event_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_process_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_process_path def test_run_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_rest_test.rb b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_rest_test.rb index 54cde30c02b5..8caeda365183 100644 --- a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_rest_test.rb +++ b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_process_open_lineage_run_event @@ -1011,7 +1019,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_test.rb b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_test.rb index 021eb06149d1..d059f1dd85da 100644 --- a/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_test.rb +++ b/google-cloud-data_catalog-lineage-v1/test/google/cloud/data_catalog/lineage/v1/lineage_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_process_open_lineage_run_event @@ -1127,7 +1135,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Client.new do |config| config.credentials = grpc_channel end @@ -1145,7 +1154,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::Lineage::V1::Lineage::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb index c26db4f4a6c6..6e89bec3e0cf 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb @@ -160,13 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_catalog_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DataCatalog::V1::DataCatalog::Stub, credentials: credentials, @@ -177,6 +170,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_catalog_stub.endpoint + config.universe_domain = @data_catalog_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb index 5dd3035a4100..fb9079a16c4d 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb @@ -157,19 +157,19 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_catalog_stub = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_catalog_stub.endpoint + config.universe_domain = @data_catalog_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb index e50743207fa0..cb32d4e54456 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search_catalog REST call # diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb index 61b393cedb4a..d4edec5ef726 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb @@ -154,13 +154,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_stub.endpoint + config.universe_domain = @policy_tag_manager_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb index 20501cede80c..4d75bf08c035 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb @@ -151,19 +151,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_stub = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_stub.endpoint + config.universe_domain = @policy_tag_manager_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb index 60cf89387db5..e01543d55e78 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_taxonomy REST call # diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb index ed602312af0c..a25621988dee 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_serialization_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_serialization_stub.endpoint + config.universe_domain = @policy_tag_manager_serialization_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb index d72a39d220b8..0912e6d952c1 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_serialization_stub = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_serialization_stub.endpoint + config.universe_domain = @policy_tag_manager_serialization_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb index d70381e80645..0654c7610cd6 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the replace_taxonomy REST call # diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb index d09081c172de..55c0f07db26f 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb index a7d107087d0b..3877a1f30594 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/v1/data_catalog" class ::Google::Cloud::DataCatalog::V1::DataCatalog::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_entry_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_entry_path def test_entry_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_entry_group_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_tag_path def test_tag_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_tag_template_path def test_tag_template_field_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_tag_template_field_path def test_tag_template_field_enum_value_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb index 32463ed97019..15a9836076c4 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_catalog @@ -1948,7 +1956,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb index 206ee6d3af30..132952698d8c 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_catalog @@ -2147,7 +2155,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -2165,7 +2174,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb index f8871de488e1..0580f29c13d3 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/v1/policy_tag_manager" class ::Google::Cloud::DataCatalog::V1::PolicyTagManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_policy_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_policy_tag_path def test_taxonomy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb index a8dd02f55c64..aea8094c850b 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_taxonomy @@ -781,7 +789,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb index c04607577cb8..1a15b3a27b7c 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/v1/policy_tag_manager_serialization" class ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_taxonomy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb index 727cf130bfe8..e95a3bc8af34 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_replace_taxonomy @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb index 409b054c69ff..339bbaacf403 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_replace_taxonomy @@ -235,7 +243,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb index 3acb7ced82c1..1815cce58bc9 100644 --- a/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb +++ b/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_taxonomy @@ -841,7 +849,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/client.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/client.rb index 818c45814e73..54d100bf23ac 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/client.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_catalog_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_catalog_stub.endpoint + config.universe_domain = @data_catalog_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/client.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/client.rb index 01783e892b7c..118d813999f5 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/client.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/client.rb @@ -150,19 +150,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_catalog_stub = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_catalog_stub.endpoint + config.universe_domain = @data_catalog_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/service_stub.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/service_stub.rb index 5269dfba0e61..b63f61879732 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/service_stub.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/data_catalog/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search_catalog REST call # diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/client.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/client.rb index 4a476ddd2586..020a0bc34fe6 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/client.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/client.rb @@ -150,13 +150,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Stub, credentials: credentials, @@ -167,6 +160,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_stub.endpoint + config.universe_domain = @policy_tag_manager_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb index b3a607ba00c5..f3cc520df53b 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/client.rb @@ -147,19 +147,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_stub = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_stub.endpoint + config.universe_domain = @policy_tag_manager_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/service_stub.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/service_stub.rb index 316793659c8a..064c00cc89eb 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/service_stub.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_taxonomy REST call # diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/client.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/client.rb index 604d4d75fb93..fab283bc39b6 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/client.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/client.rb @@ -150,13 +150,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_serialization_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Stub, credentials: credentials, @@ -167,6 +160,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_serialization_stub.endpoint + config.universe_domain = @policy_tag_manager_serialization_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/client.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/client.rb index 4289fc7f982d..0e7028ea4b91 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/client.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/client.rb @@ -147,19 +147,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_tag_manager_serialization_stub = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_serialization_stub.endpoint + config.universe_domain = @policy_tag_manager_serialization_stub.universe_domain + end end ## diff --git a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/service_stub.rb b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/service_stub.rb index f01c703dd7b7..f3aced57ce50 100644 --- a/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/service_stub.rb +++ b/google-cloud-data_catalog-v1beta1/lib/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the import_taxonomies REST call # diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_paths_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_paths_test.rb index 51b3b907eca4..e3e13673d756 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_paths_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/v1beta1/data_catalog" class ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_entry_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_entry_path def test_entry_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_entry_group_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_tag_path def test_tag_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_tag_template_path def test_tag_template_field_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_tag_template_field_path def test_tag_template_field_enum_value_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_rest_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_rest_test.rb index 8865171cf644..0d398086b495 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_rest_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_catalog @@ -1614,7 +1622,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_test.rb index b96b7189c5e3..c2a2a3b2ebfe 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/data_catalog_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_catalog @@ -1768,7 +1776,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1beta1::DataCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_paths_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_paths_test.rb index 311bd019baa7..62aaaa45975c 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_paths_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/v1beta1/policy_tag_manager" class ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_policy_tag_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_policy_tag_path def test_taxonomy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_rest_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_rest_test.rb index b1168af73229..b5c24643463d 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_rest_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_taxonomy @@ -781,7 +789,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_paths_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_paths_test.rb index 5a7f5d7eb705..d33c8a327cba 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_paths_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization" class ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_taxonomy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_rest_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_rest_test.rb index 28767121f257..a865b568df5d 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_rest_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_import_taxonomies @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_test.rb index 7d35418d04ec..688ebda58aa6 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_serialization_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_import_taxonomies @@ -175,7 +183,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManagerSerialization::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_test.rb b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_test.rb index fd840d42d692..298947eeb3c8 100644 --- a/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_test.rb +++ b/google-cloud-data_catalog-v1beta1/test/google/cloud/data_catalog/v1beta1/policy_tag_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_taxonomy @@ -841,7 +849,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataCatalog::V1beta1::PolicyTagManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/service_stub.rb b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/service_stub.rb index 00615b5f1b8d..c990eb4d9cff 100644 --- a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/service_stub.rb +++ b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_available_versions REST call # diff --git a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_operations_test.rb b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_operations_test.rb index b9b498b12028..6062b0bc1894 100644 --- a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_operations_test.rb +++ b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataFusion::V1::DataFusion::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_paths_test.rb b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_paths_test.rb index 565756ef07f2..7c76c3b9bf3f 100644 --- a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_paths_test.rb +++ b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_fusion/v1/data_fusion" class ::Google::Cloud::DataFusion::V1::DataFusion::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataFusion::V1::DataFusion::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_crypto_key_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataFusion::V1::DataFusion::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataFusion::V1::DataFusion::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_rest_test.rb b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_rest_test.rb index cc8435cb7e02..17b3ca244c87 100644 --- a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_rest_test.rb +++ b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_available_versions @@ -454,7 +462,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_test.rb b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_test.rb index 70e9cd29333b..8dbe2a9cb2a2 100644 --- a/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_test.rb +++ b/google-cloud-data_fusion-v1/test/google/cloud/data_fusion/v1/data_fusion_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_available_versions @@ -507,7 +515,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataFusion::V1::DataFusion::Client.new do |config| config.credentials = grpc_channel end @@ -525,7 +534,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataFusion::V1::DataFusion::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_operations_test.rb b/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_operations_test.rb index 2d4ed224c6f8..9c38e3844827 100644 --- a/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_operations_test.rb +++ b/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_paths_test.rb b/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_paths_test.rb index 2b8c4e99149d..4d8c36beead4 100644 --- a/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_paths_test.rb +++ b/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/data_labeling/v1beta1/data_labeling_service" class ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_annotated_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_annotated_dataset_path def test_annotation_spec_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_annotation_spec_set_path def test_data_item_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_data_item_path def test_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_dataset_path def test_evaluation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_evaluation_path def test_evaluation_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_evaluation_job_path def test_example_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_example_path def test_instruction_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_instruction_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_test.rb b/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_test.rb index 90c65fb7eb46..1c99c1c252b8 100644 --- a/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_test.rb +++ b/google-cloud-data_labeling-v1beta1/test/google/cloud/data_labeling/v1beta1/data_labeling_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dataset @@ -2195,7 +2203,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end @@ -2213,7 +2222,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb index 86ee98e86092..b76769394324 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the launch_flex_template REST call # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb index 5c252ec9305e..9dffb7cc5b6c 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb index b9c338babc9d..cbad88395f9f 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_job_messages REST call # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb index f52e24d79d91..3e352bc750e4 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_job_metrics REST call # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb index 83c049c0604b..dde111e1f194 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_snapshot REST call # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb index 5ef337228cfb..ee90bb7440d6 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job_from_template REST call # diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_rest_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_rest_test.rb index 8f5fc904e25f..81f2253945e0 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_rest_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_launch_flex_template @@ -123,7 +131,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_test.rb index b1094deb717c..ef2336f4b638 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/flex_templates_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_launch_flex_template @@ -115,7 +123,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_rest_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_rest_test.rb index 2d7c751a220e..8ca19d0faedc 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_rest_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -415,7 +423,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_test.rb index ef220a85d136..30fa7e4c1ca5 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/jobs_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -517,7 +525,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Jobs::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_rest_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_rest_test.rb index 8d6605fe246d..d572df9a9aaf 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_rest_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_job_messages @@ -127,7 +135,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Messages::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_test.rb index ff8d0d856236..f9a4f52366bb 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/messages_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_job_messages @@ -128,7 +136,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Messages::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_rest_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_rest_test.rb index c41bdd4bdb42..7b3eaa8a022a 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_rest_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_job_metrics @@ -242,7 +250,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_test.rb index 6676a4f99e15..9b25b3f27596 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/metrics_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_job_metrics @@ -263,7 +271,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_rest_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_rest_test.rb index e41bf55ee47b..318cab0bf807 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_rest_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_snapshot @@ -234,7 +242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_test.rb index 03eab376d988..bf4001cbf765 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/snapshots_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_snapshot @@ -237,7 +245,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_rest_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_rest_test.rb index 1190801f81e8..4ce533eac3d9 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_rest_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job_from_template @@ -240,7 +248,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_test.rb b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_test.rb index 385278e80d9a..0ba4ebeac5c9 100644 --- a/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_test.rb +++ b/google-cloud-dataflow-v1beta3/test/google/cloud/dataflow/v1beta3/templates_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job_from_template @@ -252,7 +260,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb index 02b0ff9fbeb9..22631b53c479 100644 --- a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb +++ b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb @@ -149,20 +149,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dataform_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataform::V1beta1::Dataform::Stub, credentials: credentials, @@ -173,6 +159,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataform_stub.endpoint + config.universe_domain = @dataform_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataform_stub.endpoint + config.universe_domain = @dataform_stub.universe_domain + end end ## diff --git a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb index 9b5048e7eae2..26321ece0298 100644 --- a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb +++ b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb @@ -146,28 +146,28 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @dataform_stub = ::Google::Cloud::Dataform::V1beta1::Dataform::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataform_stub.endpoint + config.universe_domain = @dataform_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataform_stub.endpoint + config.universe_domain = @dataform_stub.universe_domain config.bindings_override = @config.bindings_override end - - @dataform_stub = ::Google::Cloud::Dataform::V1beta1::Dataform::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/service_stub.rb b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/service_stub.rb index 51b18ac5a4bb..0737986c49b4 100644 --- a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/service_stub.rb +++ b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_repositories REST call # diff --git a/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_paths_test.rb b/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_paths_test.rb index 9cf3078fa6b9..b60cfaa10d03 100644 --- a/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_paths_test.rb +++ b/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataform/v1beta1/dataform" class ::Google::Cloud::Dataform::V1beta1::Dataform::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_compilation_result_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_compilation_result_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_release_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_release_config_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_repository_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_secret_version_path def test_workflow_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_workflow_config_path def test_workflow_invocation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_workflow_invocation_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_rest_test.rb b/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_rest_test.rb index 0a08c0649823..bc70dc82c889 100644 --- a/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_rest_test.rb +++ b/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_repositories @@ -2891,7 +2899,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_test.rb b/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_test.rb index 799d7b8eb21a..36fd0ae4f7b4 100644 --- a/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_test.rb +++ b/google-cloud-dataform-v1beta1/test/google/cloud/dataform/v1beta1/dataform_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_repositories @@ -3206,7 +3214,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataform::V1beta1::Dataform::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb index 83766d147af0..c7eba7291ce5 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb @@ -176,20 +176,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @content_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataplex::V1::ContentService::Stub, credentials: credentials, @@ -200,6 +186,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @content_service_stub.endpoint + config.universe_domain = @content_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @content_service_stub.endpoint + config.universe_domain = @content_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb index dea5bbc2ad92..71c5abd065bd 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb @@ -173,28 +173,28 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @content_service_stub = ::Google::Cloud::Dataplex::V1::ContentService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @content_service_stub.endpoint + config.universe_domain = @content_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @content_service_stub.endpoint + config.universe_domain = @content_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @content_service_stub = ::Google::Cloud::Dataplex::V1::ContentService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/service_stub.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/service_stub.rb index 116adf7367a1..61be6a591fb6 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/service_stub.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_content REST call # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb index 5a1e01038281..539785d09d39 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb @@ -157,20 +157,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_scan_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataplex::V1::DataScanService::Stub, credentials: credentials, @@ -181,6 +167,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_scan_service_stub.endpoint + config.universe_domain = @data_scan_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_scan_service_stub.endpoint + config.universe_domain = @data_scan_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb index dec1c5151b5b..8ab79fd3151f 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb @@ -154,28 +154,28 @@ def initialize config.universe_domain = @config.universe_domain end + @data_scan_service_stub = ::Google::Cloud::Dataplex::V1::DataScanService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @data_scan_service_stub.endpoint + config.universe_domain = @data_scan_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @data_scan_service_stub.endpoint + config.universe_domain = @data_scan_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @data_scan_service_stub = ::Google::Cloud::Dataplex::V1::DataScanService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/service_stub.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/service_stub.rb index fab8ae43da95..40ab271faa70 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/service_stub.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_data_scan REST call # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb index c1e958f0864c..7af886571c41 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb @@ -156,20 +156,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @data_taxonomy_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Stub, credentials: credentials, @@ -180,6 +166,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_taxonomy_service_stub.endpoint + config.universe_domain = @data_taxonomy_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_taxonomy_service_stub.endpoint + config.universe_domain = @data_taxonomy_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb index 76d082aaa185..de4e9482fe37 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb @@ -153,28 +153,28 @@ def initialize config.universe_domain = @config.universe_domain end + @data_taxonomy_service_stub = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @data_taxonomy_service_stub.endpoint + config.universe_domain = @data_taxonomy_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @data_taxonomy_service_stub.endpoint + config.universe_domain = @data_taxonomy_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @data_taxonomy_service_stub = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/service_stub.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/service_stub.rb index 42d5d814a57b..ea2f117350cc 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/service_stub.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_data_taxonomy REST call # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb index 9ae8f9fe1e84..84266b327241 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb @@ -266,20 +266,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dataplex_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataplex::V1::DataplexService::Stub, credentials: credentials, @@ -290,6 +276,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataplex_service_stub.endpoint + config.universe_domain = @dataplex_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataplex_service_stub.endpoint + config.universe_domain = @dataplex_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb index b66b878971b3..5655cec9c665 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb @@ -263,28 +263,28 @@ def initialize config.universe_domain = @config.universe_domain end + @dataplex_service_stub = ::Google::Cloud::Dataplex::V1::DataplexService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataplex_service_stub.endpoint + config.universe_domain = @dataplex_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataplex_service_stub.endpoint + config.universe_domain = @dataplex_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @dataplex_service_stub = ::Google::Cloud::Dataplex::V1::DataplexService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/service_stub.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/service_stub.rb index 0f2438c45f86..7fd8a2a575b5 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/service_stub.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_lake REST call # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb index 752999c746a6..6a82e6d6a9a9 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb @@ -179,20 +179,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @metadata_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataplex::V1::MetadataService::Stub, credentials: credentials, @@ -203,6 +189,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb index cbaf5d39e57b..373559e8a916 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb @@ -176,28 +176,28 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @metadata_service_stub = ::Google::Cloud::Dataplex::V1::MetadataService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @metadata_service_stub.endpoint + config.universe_domain = @metadata_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @metadata_service_stub = ::Google::Cloud::Dataplex::V1::MetadataService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/service_stub.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/service_stub.rb index 9791cca1ba8d..cb459361eb92 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/service_stub.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_entity REST call # diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_paths_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_paths_test.rb index a76b19bf390c..368194a93682 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_paths_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataplex/v1/content_service" class ::Google::Cloud::Dataplex::V1::ContentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_content_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::ContentService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_content_path def test_lake_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::ContentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_rest_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_rest_test.rb index 3c1a085135c8..7782b743c5d0 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_rest_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_content @@ -510,7 +518,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_test.rb index 5944dcfeabdf..f5b7667e420a 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/content_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_content @@ -544,7 +552,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::ContentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_operations_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_operations_test.rb index b08ac8f8dd25..ca879f802cd2 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_operations_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataScanService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_paths_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_paths_test.rb index 8a1c29c6d317..3c4e075c83d4 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_paths_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataplex/v1/data_scan_service" class ::Google::Cloud::Dataplex::V1::DataScanService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_scan_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_data_scan_path def test_data_scan_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_data_scan_job_path def test_entity_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_entity_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_rest_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_rest_test.rb index 174dc068dea9..8243ffb2813f 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_rest_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_scan @@ -512,7 +520,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_test.rb index 1c4a415f415b..e3792bdb4861 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_scan_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_scan @@ -568,7 +576,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config| config.credentials = grpc_channel end @@ -586,7 +595,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataScanService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_operations_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_operations_test.rb index 7da5f99c0963..21b3a15f9911 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_operations_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_paths_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_paths_test.rb index a7c088bcd1cf..1244054142ac 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_paths_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataplex/v1/data_taxonomy_service" class ::Google::Cloud::Dataplex::V1::DataTaxonomyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_attribute_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_data_attribute_path def test_data_attribute_binding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_data_attribute_binding_path def test_data_taxonomy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_data_taxonomy_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_rest_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_rest_test.rb index bda63e9d9e23..066ceed37ab9 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_rest_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_taxonomy @@ -906,7 +914,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_test.rb index 244e84f9f0c7..ce63c522cbb1 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/data_taxonomy_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_data_taxonomy @@ -1041,7 +1049,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Client.new do |config| config.credentials = grpc_channel end @@ -1059,7 +1068,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataTaxonomyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_operations_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_operations_test.rb index 3982ad9be49e..b3f8b137d6b5 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_operations_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataplexService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_paths_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_paths_test.rb index 6261ff9fb1cb..3e280c9b5e5a 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_paths_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataplex/v1/dataplex_service" class ::Google::Cloud::Dataplex::V1::DataplexService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_asset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_asset_path def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_environment_path def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_job_path def test_lake_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_lake_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_task_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_task_path def test_zone_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_rest_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_rest_test.rb index 84b04ead4e04..04636beaa632 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_rest_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_lake @@ -1906,7 +1914,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_test.rb index 5c6cfd3fa2e7..fc4050b1e210 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/dataplex_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_lake @@ -2206,7 +2214,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end @@ -2224,7 +2233,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::DataplexService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_paths_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_paths_test.rb index dc596cbe5869..3ec7d9797a13 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_paths_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataplex/v1/metadata_service" class ::Google::Cloud::Dataplex::V1::MetadataService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_entity_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_entity_path def test_partition_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_partition_path def test_zone_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_rest_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_rest_test.rb index 5e4b75f247d9..f874baf579d2 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_rest_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_entity @@ -567,7 +575,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_test.rb b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_test.rb index 0266bac3789d..9504f1b9a829 100644 --- a/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_test.rb +++ b/google-cloud-dataplex-v1/test/google/cloud/dataplex/v1/metadata_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_entity @@ -613,7 +621,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb index e74d42ed7c2b..7fc01b29dbd3 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb @@ -167,13 +167,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @autoscaling_policy_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Stub, credentials: credentials, @@ -184,6 +177,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autoscaling_policy_service_stub.endpoint + config.universe_domain = @autoscaling_policy_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb index ac3f0f087606..f371c63f4dc0 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb @@ -164,20 +164,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @autoscaling_policy_service_stub = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autoscaling_policy_service_stub.endpoint + config.universe_domain = @autoscaling_policy_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb index faabede6db45..7592acda1c67 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_autoscaling_policy REST call # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb index 375e7eaf3395..ad539336b48b 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb @@ -154,13 +154,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @batch_controller_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataproc::V1::BatchController::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_controller_stub.endpoint + config.universe_domain = @batch_controller_stub.universe_domain + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb index 7d16c9b56ec1..54056588b235 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb @@ -151,20 +151,20 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @batch_controller_stub = ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_controller_stub.endpoint + config.universe_domain = @batch_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb index 9e04a33b50aa..fec99c2a7ead 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_batch REST call # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb index a3637414ba7a..3537faa504a3 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb @@ -185,13 +185,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cluster_controller_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataproc::V1::ClusterController::Stub, credentials: credentials, @@ -202,6 +195,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cluster_controller_stub.endpoint + config.universe_domain = @cluster_controller_stub.universe_domain + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb index 970dc34e777d..d9a44206b431 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb @@ -182,20 +182,20 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cluster_controller_stub = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cluster_controller_stub.endpoint + config.universe_domain = @cluster_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb index f16c313ef1f1..3180ef69bb2b 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_cluster REST call # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb index 83541acebf1c..49e062564f11 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb @@ -187,13 +187,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @job_controller_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataproc::V1::JobController::Stub, credentials: credentials, @@ -204,6 +197,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @job_controller_stub.endpoint + config.universe_domain = @job_controller_stub.universe_domain + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb index 4aa84f6fc9be..35b01dd4409e 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb @@ -184,20 +184,20 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @job_controller_stub = ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @job_controller_stub.endpoint + config.universe_domain = @job_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb index d441ccf8a339..bced525827aa 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the submit_job REST call # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb index e7cf1a19ee70..4149fd1cd8db 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb @@ -155,13 +155,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @node_group_controller_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataproc::V1::NodeGroupController::Stub, credentials: credentials, @@ -172,6 +165,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @node_group_controller_stub.endpoint + config.universe_domain = @node_group_controller_stub.universe_domain + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb index bee71fc44965..61e5b3b15e34 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb @@ -152,20 +152,20 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @node_group_controller_stub = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @node_group_controller_stub.endpoint + config.universe_domain = @node_group_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb index 6b15e0206257..5215433f7ae8 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_node_group REST call # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb index 50843a3fa723..c0fddbbe99bf 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb @@ -190,13 +190,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @workflow_template_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Stub, credentials: credentials, @@ -207,6 +200,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflow_template_service_stub.endpoint + config.universe_domain = @workflow_template_service_stub.universe_domain + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb index c2f181faee34..542b00544d35 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb @@ -187,20 +187,20 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @workflow_template_service_stub = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflow_template_service_stub.endpoint + config.universe_domain = @workflow_template_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb index 17e2ffa0bd67..61dde6cba4c7 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_workflow_template REST call # diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb index ae0b5520b762..cbe11c3f40fd 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataproc/v1/autoscaling_policy_service" class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_autoscaling_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_autoscaling_policy_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_location_path def test_region_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb index 1202531cf2c9..a18a70d12bbf 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_autoscaling_policy @@ -339,7 +347,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb index 935361ab9bf3..c3dbf19a9f62 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_autoscaling_policy @@ -352,7 +360,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb index 08117c06dd3f..eb44a67bd17a 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb index e9c3f4a3b3dc..35e1126597a3 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataproc/v1/batch_controller" class ::Google::Cloud::Dataproc::V1::BatchController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_batch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_batch_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb index c191101a0d80..426c34a6d830 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_batch @@ -289,7 +297,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb index 0342d3d37553..f9a97e9e74e4 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_batch @@ -307,7 +315,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| config.credentials = grpc_channel end @@ -325,7 +334,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb index f72d29904df2..798030e60b38 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb index a9ccdb30f8cb..e6972fc2801d 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataproc/v1/cluster_controller" class ::Google::Cloud::Dataproc::V1::ClusterController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cluster_path def test_node_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_node_group_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb index 2e0741f55ab8..307b23b4290d 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_cluster @@ -532,7 +540,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb index ebd56f8511ff..e087b024550c 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_cluster @@ -618,7 +626,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| config.credentials = grpc_channel end @@ -636,7 +645,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb index 57f9c7efe630..76f9a9a8ba3e 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb index 99b124dd5941..d2716cec75cf 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_submit_job @@ -466,7 +474,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb index 3724ca94cbb7..16b0e797be8f 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_submit_job @@ -511,7 +519,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| config.credentials = grpc_channel end @@ -529,7 +538,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb index ecc75a8e655f..4ed06ccc0dc8 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb index 1c494f28f5c8..295e8862addc 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataproc/v1/node_group_controller" class ::Google::Cloud::Dataproc::V1::NodeGroupController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cluster_region_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cluster_region_path def test_node_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb index 75cb603e8691..21a8e63bcd5a 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_node_group @@ -234,7 +242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb index 7fbc1bf8c41e..440a7b218a7e 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_node_group @@ -247,7 +255,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| config.credentials = grpc_channel end @@ -265,7 +274,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb index dbf370826e18..157c53a54053 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb index 7fe1e1bb08fd..be6ef0e9d04b 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataproc/v1/workflow_template_service" class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_node_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_node_group_path def test_region_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_region_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_service_path def test_workflow_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb index ddd7f12c9e52..ccbe4f01791f 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_workflow_template @@ -454,7 +462,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb index 9bc5e0e4e5cc..8b4d751d7040 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_workflow_template @@ -492,7 +500,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end @@ -510,7 +519,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_paths_test.rb b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_paths_test.rb index 64bf9fe24985..06237264bd52 100644 --- a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_paths_test.rb +++ b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataqna/v1alpha/auto_suggestion_service" class ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_test.rb b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_test.rb index d6ef184a433a..272abe67492a 100644 --- a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_test.rb +++ b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/auto_suggestion_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_suggest_queries @@ -115,7 +123,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_paths_test.rb b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_paths_test.rb index 396aeeec79be..2a79e3bb8350 100644 --- a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_paths_test.rb +++ b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dataqna/v1alpha/question_service" class ::Google::Cloud::DataQnA::V1alpha::QuestionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_question_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_question_path def test_user_feedback_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_test.rb b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_test.rb index 0cb2ba85aef8..8019a7073828 100644 --- a/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_test.rb +++ b/google-cloud-dataqna-v1alpha/test/google/cloud/dataqna/v1alpha/question_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_question @@ -349,7 +357,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/service_stub.rb b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/service_stub.rb index 829fdf374993..d2b4806d69df 100644 --- a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/service_stub.rb +++ b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the export_entities REST call # diff --git a/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_operations_test.rb b/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_operations_test.rb index 6fce0e47eaaf..952eeffb6507 100644 --- a/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_operations_test.rb +++ b/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_rest_test.rb b/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_rest_test.rb index 1874f6af6afe..e2322ea864e2 100644 --- a/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_rest_test.rb +++ b/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_export_entities @@ -402,7 +410,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_test.rb b/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_test.rb index d05e1d785f37..929c8e31194b 100644 --- a/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_test.rb +++ b/google-cloud-datastore-admin-v1/test/google/cloud/datastore/admin/v1/datastore_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_export_entities @@ -448,7 +456,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -466,7 +475,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb b/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb index bb550e03b0eb..ff26c8d2cdab 100644 --- a/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb +++ b/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the lookup REST call # diff --git a/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb b/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb index f90dadcb63be..d1db515aba4f 100644 --- a/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb +++ b/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_lookup @@ -523,7 +531,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastore::V1::Datastore::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb b/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb index e39b81e3405b..afcb57f7c81c 100644 --- a/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb +++ b/google-cloud-datastore-v1/test/google/cloud/datastore/v1/datastore_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_lookup @@ -568,7 +576,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastore::V1::Datastore::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb index ee2dc6ca5571..c7ee9f08d528 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb @@ -180,20 +180,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @datastream_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Datastream::V1::Datastream::Stub, credentials: credentials, @@ -204,6 +190,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @datastream_stub.endpoint + config.universe_domain = @datastream_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @datastream_stub.endpoint + config.universe_domain = @datastream_stub.universe_domain + end end ## diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb index a6902cc48f61..fd681f551b23 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb @@ -177,27 +177,27 @@ def initialize config.universe_domain = @config.universe_domain end + @datastream_stub = ::Google::Cloud::Datastream::V1::Datastream::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @datastream_stub.endpoint + config.universe_domain = @datastream_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @datastream_stub.endpoint + config.universe_domain = @datastream_stub.universe_domain end - - @datastream_stub = ::Google::Cloud::Datastream::V1::Datastream::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/service_stub.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/service_stub.rb index 3fe54d796319..b32f9d5308d8 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/service_stub.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_connection_profiles REST call # diff --git a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_operations_test.rb b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_operations_test.rb index fb6b6edb11bd..de8d36eae243 100644 --- a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_operations_test.rb +++ b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1::Datastream::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_paths_test.rb b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_paths_test.rb index 2f1b61a76b5a..36ca9d7da3b8 100644 --- a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_paths_test.rb +++ b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/datastream/v1/datastream" class ::Google::Cloud::Datastream::V1::Datastream::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connection_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connection_profile_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_networks_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_networks_path def test_private_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_private_connection_path def test_route_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_route_path def test_stream_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_stream_path def test_stream_object_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_rest_test.rb b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_rest_test.rb index 0c9c2e35ca86..8ac55c829b99 100644 --- a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_rest_test.rb +++ b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connection_profiles @@ -1470,7 +1478,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1::Datastream::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_test.rb b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_test.rb index e42e179210f4..6870c992a33f 100644 --- a/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_test.rb +++ b/google-cloud-datastream-v1/test/google/cloud/datastream/v1/datastream_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connection_profiles @@ -1687,7 +1695,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -1705,7 +1714,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/service_stub.rb b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/service_stub.rb index 2452056a0df5..88fd0c3bc59d 100644 --- a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/service_stub.rb +++ b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_connection_profiles REST call # diff --git a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_operations_test.rb b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_operations_test.rb index 71a1e480deb6..83567f829994 100644 --- a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_operations_test.rb +++ b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_paths_test.rb b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_paths_test.rb index 42e093313df9..80a4961627ff 100644 --- a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_paths_test.rb +++ b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/datastream/v1alpha1/datastream" class ::Google::Cloud::Datastream::V1alpha1::Datastream::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connection_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connection_profile_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_private_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_private_connection_path def test_route_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_route_path def test_stream_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_rest_test.rb b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_rest_test.rb index 379801e74bd0..1a47a445e324 100644 --- a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_rest_test.rb +++ b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connection_profiles @@ -1246,7 +1254,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_test.rb b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_test.rb index 04b9afd3ef3a..8082aa049b88 100644 --- a/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_test.rb +++ b/google-cloud-datastream-v1alpha1/test/google/cloud/datastream/v1alpha1/datastream_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connection_profiles @@ -1439,7 +1447,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end @@ -1457,7 +1466,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb index eb26e6bfc31d..464a72601a09 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb @@ -285,20 +285,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_deploy_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Deploy::V1::CloudDeploy::Stub, credentials: credentials, @@ -309,6 +295,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_deploy_stub.endpoint + config.universe_domain = @cloud_deploy_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_deploy_stub.endpoint + config.universe_domain = @cloud_deploy_stub.universe_domain + end end ## diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb index 7f8bfd1a897b..173575f5773e 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb @@ -282,28 +282,28 @@ def initialize config.universe_domain = @config.universe_domain end + @cloud_deploy_stub = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @cloud_deploy_stub.endpoint + config.universe_domain = @cloud_deploy_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @cloud_deploy_stub.endpoint + config.universe_domain = @cloud_deploy_stub.universe_domain config.bindings_override = @config.bindings_override end - - @cloud_deploy_stub = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/service_stub.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/service_stub.rb index c336252c6e2a..9d0188013333 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/service_stub.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_delivery_pipelines REST call # diff --git a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_operations_test.rb b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_operations_test.rb index 0ed894d17ee5..8cf2442067c7 100644 --- a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_operations_test.rb +++ b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_paths_test.rb b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_paths_test.rb index 93a2f9d9d421..c934943055f0 100644 --- a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_paths_test.rb +++ b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/deploy/v1/cloud_deploy" class ::Google::Cloud::Deploy::V1::CloudDeploy::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_automation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_automation_path def test_automation_run_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_automation_run_path def test_build_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_build_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_cluster_path def test_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_config_path def test_custom_target_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_custom_target_type_path def test_delivery_pipeline_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_delivery_pipeline_path def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_job_path def test_job_run_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_job_run_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_location_path def test_membership_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -157,7 +167,7 @@ def test_membership_path def test_release_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -169,7 +179,7 @@ def test_release_path def test_rollout_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -181,7 +191,7 @@ def test_rollout_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -193,7 +203,7 @@ def test_service_path def test_target_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -205,7 +215,7 @@ def test_target_path def test_worker_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_rest_test.rb b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_rest_test.rb index ed2d7e032594..a74b048725f4 100644 --- a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_rest_test.rb +++ b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_delivery_pipelines @@ -2328,7 +2336,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_test.rb b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_test.rb index 965765dd52c1..056086e11220 100644 --- a/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_test.rb +++ b/google-cloud-deploy-v1/test/google/cloud/deploy/v1/cloud_deploy_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_delivery_pipelines @@ -2685,7 +2693,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end @@ -2703,7 +2712,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb index 547854155f27..afbf9b80b2c1 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb @@ -165,13 +165,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @agents_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Agents::Stub, credentials: credentials, @@ -182,6 +175,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @agents_stub.endpoint + config.universe_domain = @agents_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb index 3982c277c390..2378e2f9e525 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb @@ -162,20 +162,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @agents_stub = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @agents_stub.endpoint + config.universe_domain = @agents_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb index de3675ff7299..205657b431f1 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_agents REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb index 85168eada3e7..6323c22e718f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @changelogs_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @changelogs_stub.endpoint + config.universe_domain = @changelogs_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb index 89135536dd60..8e49c47a87c6 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @changelogs_stub = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @changelogs_stub.endpoint + config.universe_domain = @changelogs_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb index ba18fbea14f8..ce55c2f8efea 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_changelogs REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb index ee80c8f4f42f..69b3370ee1ec 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @deployments_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Deployments::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @deployments_stub.endpoint + config.universe_domain = @deployments_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb index 00ce24d6352c..0f46b845141d 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @deployments_stub = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @deployments_stub.endpoint + config.universe_domain = @deployments_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb index 00f989b5c8d7..b97f34d6ff9d 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_deployments REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb index e4b7e860fef6..b81a4fec968f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @entity_types_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @entity_types_stub.endpoint + config.universe_domain = @entity_types_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb index d41c5883c74b..15b9ed0ce474 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @entity_types_stub = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @entity_types_stub.endpoint + config.universe_domain = @entity_types_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb index cbdcd48f1bb6..71cd6835b90b 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_entity_type REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb index 890de6e73b27..4eb4c7d3bc70 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb @@ -161,13 +161,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @environments_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Environments::Stub, credentials: credentials, @@ -178,6 +171,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @environments_stub.endpoint + config.universe_domain = @environments_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb index 1dc57dd8d7d0..033933c36052 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb @@ -158,20 +158,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @environments_stub = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @environments_stub.endpoint + config.universe_domain = @environments_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb index b5db1b1db357..669e3e32459d 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_environments REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb index aaac7fd53395..939ed81dd441 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @experiments_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Experiments::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @experiments_stub.endpoint + config.universe_domain = @experiments_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb index 1ebaa858ac8f..2247a292343d 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @experiments_stub = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @experiments_stub.endpoint + config.universe_domain = @experiments_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb index 5bc7fed7c980..7c11395fdf89 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_experiments REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb index 20c3fa567582..182406441a9b 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb @@ -160,13 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @flows_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Flows::Stub, credentials: credentials, @@ -177,6 +170,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @flows_stub.endpoint + config.universe_domain = @flows_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb index 1941180b182b..32e29810fa23 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb @@ -157,20 +157,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @flows_stub = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @flows_stub.endpoint + config.universe_domain = @flows_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb index dc7bf45fa1e0..0776f4aee5f0 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_flow REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb index 52c8f3e43a56..e129e6fe11ab 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @generators_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Generators::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @generators_stub.endpoint + config.universe_domain = @generators_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb index 6425c048221e..a5c8a9dca405 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @generators_stub = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @generators_stub.endpoint + config.universe_domain = @generators_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb index d453bfe8b549..d52eb7289ba7 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_generators REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb index 16e657c7c498..23a212bde0dd 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb @@ -160,13 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @intents_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Intents::Stub, credentials: credentials, @@ -177,6 +170,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @intents_stub.endpoint + config.universe_domain = @intents_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb index 0c92d0c3c874..df02d334bc61 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb @@ -157,20 +157,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @intents_stub = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @intents_stub.endpoint + config.universe_domain = @intents_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb index 3af7db5f1e76..739aa3d0eab6 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_intents REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb index 5665bd208b70..56ff4597a91e 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @pages_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Pages::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @pages_stub.endpoint + config.universe_domain = @pages_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb index b1000b9cfd10..97977bcf6cae 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @pages_stub = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @pages_stub.endpoint + config.universe_domain = @pages_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb index 423f6cba3a91..660c61957e35 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_pages REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb index b6f477fc32f4..f766a6cdb7ef 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @security_settings_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @security_settings_service_stub.endpoint + config.universe_domain = @security_settings_service_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb index 3f77b457771c..e8e3c40d6b6e 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @security_settings_service_stub = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @security_settings_service_stub.endpoint + config.universe_domain = @security_settings_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb index 570cf97f36fe..e4656235629a 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_security_settings REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb index 25544ace34ba..ee60d4706b74 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb @@ -154,13 +154,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @session_entity_types_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_entity_types_stub.endpoint + config.universe_domain = @session_entity_types_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb index 7c12f2e2a0dd..9c01d17a0b03 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb @@ -151,20 +151,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @session_entity_types_stub = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_entity_types_stub.endpoint + config.universe_domain = @session_entity_types_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb index 83bac1c9c32f..e0378948f07c 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_session_entity_types REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb index 3a766a5a2cd1..0258d732c1d0 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb @@ -163,13 +163,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @sessions_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Sessions::Stub, credentials: credentials, @@ -180,6 +173,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @sessions_stub.endpoint + config.universe_domain = @sessions_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb index 3b77588d5698..a1cfb4b240a0 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb @@ -158,20 +158,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @sessions_stub = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @sessions_stub.endpoint + config.universe_domain = @sessions_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb index 62c3a43c97a2..09959d17259f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the detect_intent REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb index 4e9043e510bf..f69a8b7a896f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb @@ -161,13 +161,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @test_cases_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::TestCases::Stub, credentials: credentials, @@ -178,6 +171,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @test_cases_stub.endpoint + config.universe_domain = @test_cases_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb index ae92a1ed68b1..03482c0619e6 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb @@ -158,20 +158,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @test_cases_stub = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @test_cases_stub.endpoint + config.universe_domain = @test_cases_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb index c35b9a2f9ae0..fe0bd13d69e3 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_test_cases REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb index 150ed1afed0c..ad53e053dbfb 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb @@ -154,13 +154,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @transition_route_groups_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @transition_route_groups_stub.endpoint + config.universe_domain = @transition_route_groups_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb index d0387897cecc..ce20c9140993 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb @@ -151,20 +151,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @transition_route_groups_stub = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @transition_route_groups_stub.endpoint + config.universe_domain = @transition_route_groups_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb index 3c89b0902c2c..4ef9f7ed01b8 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_transition_route_groups REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb index 2912c5b08c49..357848b9c584 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb @@ -160,13 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @versions_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Versions::Stub, credentials: credentials, @@ -177,6 +170,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @versions_stub.endpoint + config.universe_domain = @versions_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb index c3a1edb7584f..c4c829c78f1c 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb @@ -157,20 +157,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @versions_stub = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @versions_stub.endpoint + config.universe_domain = @versions_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb index a81003630cb1..fe36159ff7e5 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_versions REST call # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb index f96070882a31..49b7a75d666f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @webhooks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @webhooks_stub.endpoint + config.universe_domain = @webhooks_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb index 9f7206710ea2..4cdc848ad326 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @webhooks_stub = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @webhooks_stub.endpoint + config.universe_domain = @webhooks_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb index 230f9416c215..728dcb41fef5 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_webhooks REST call # diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb index b35037238061..f41085d22344 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb index a7021eb65105..8843e4857a71 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/agents" class ::Google::Cloud::Dialogflow::CX::V3::Agents::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_agent_generative_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_agent_generative_settings_path def test_agent_validation_result_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_agent_validation_result_path def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_environment_path def test_flow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_flow_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_security_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb index 105f0bc509a2..af80d0344d31 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_agents @@ -675,7 +683,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb index d70c6c4de366..e159203c30ce 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/agents_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_agents @@ -735,7 +743,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -753,7 +762,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Agents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb index 72bc5e80fe01..9663bbe1bb30 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/changelogs" class ::Google::Cloud::Dialogflow::CX::V3::Changelogs::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_changelog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb index 833f124e349d..4a0e32364bc9 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_changelogs @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb index 28a165fbc479..a07c00514b57 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/changelogs_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_changelogs @@ -178,7 +186,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb index 8e6f51e04777..9ba574aa4290 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/deployments" class ::Google::Cloud::Dialogflow::CX::V3::Deployments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_deployment_path def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb index 0a142263a30f..918456ea1a18 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_deployments @@ -176,7 +184,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb index 7cb3ff75e37b..c8d2341dcb59 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/deployments_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_deployments @@ -176,7 +184,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb index eaa7e9a73d56..4c5d81d349b3 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/entity_types" class ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb index a6d60d876cd4..128edc1edb10 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_entity_type @@ -345,7 +353,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb index e0dcab8c0965..317c0dabeb22 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/entity_types_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_entity_type @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb index c570df7261c9..6f48d76a0d24 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb index 0ff88dcf74f8..f4dd6715d56a 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/environments" class ::Google::Cloud::Dialogflow::CX::V3::Environments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_environment_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_service_path def test_test_case_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_test_case_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_version_path def test_webhook_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb index 5a7554562578..9353198ebc16 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_environments @@ -561,7 +569,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb index 50df59b43d0b..02bdcb7185c7 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/environments_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_environments @@ -626,7 +634,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -644,7 +653,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb index 31f8e5fbc145..878037fe0b3c 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/experiments" class ::Google::Cloud::Dialogflow::CX::V3::Experiments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_environment_path def test_experiment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_experiment_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb index 6d4756ac775f..32c4a8b54cb5 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_experiments @@ -448,7 +456,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb index 5337733757e5..9ad80eb394e3 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/experiments_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_experiments @@ -470,7 +478,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb index 4bb76f1e0d61..73949c80c4e2 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb index 0e6b80d436da..30382313edb1 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/flows" class ::Google::Cloud::Dialogflow::CX::V3::Flows::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_flow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_flow_path def test_flow_validation_result_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_flow_validation_result_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_intent_path def test_page_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_page_path def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -100,7 +110,7 @@ def test_transition_route_group_path def test_webhook_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb index c5c4d66cef44..8916efb97a31 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_flow @@ -622,7 +630,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb index e4ce80f1ab61..651289f11965 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/flows_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_flow @@ -684,7 +692,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end @@ -702,7 +711,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb index 7f0fc8eda0ae..a6eb2559b6f5 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/generators" class ::Google::Cloud::Dialogflow::CX::V3::Generators::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_generator_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb index 47fc9cb32bbd..48cb6b092e72 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_generators @@ -345,7 +353,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb index d914befbe00c..25a5dae7cfea 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/generators_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_generators @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb index c032635cd9a3..b7d988c5a9b4 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb index 5fbb94aaf054..08a6f07c2dce 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/intents" class ::Google::Cloud::Dialogflow::CX::V3::Intents::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_entity_type_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb index 19764a5691fa..e2b626bf357b 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_intents @@ -458,7 +466,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb index b5478ae82266..2396b77bd2a2 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/intents_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_intents @@ -502,7 +510,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| config.credentials = grpc_channel end @@ -520,7 +529,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb index d013c263da92..7ef23c83abf4 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/pages" class ::Google::Cloud::Dialogflow::CX::V3::Pages::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_entity_type_path def test_flow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_flow_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_intent_path def test_page_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_page_path def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end @@ -88,7 +98,7 @@ def test_transition_route_group_path def test_webhook_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb index 61527bef83d6..b1818bd160a0 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_pages @@ -345,7 +353,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb index 9959b26e133e..0b2e73997043 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/pages_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_pages @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb index b5610add04ea..f7bf20814933 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/security_settings_service" class ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_deidentify_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_deidentify_template_path def test_inspect_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_inspect_template_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_location_path def test_security_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb index 53cead102c23..37dabcf94449 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_security_settings @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb index 39a7e0772144..a318ddaef0ba 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/security_settings_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_security_settings @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb index eb7170d7d67f..1c111b290ede 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/session_entity_types" class ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_session_path def test_session_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb index 444431f627f9..3a4168ce23e6 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_session_entity_types @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb index e39d827cb525..df316f5b2076 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/session_entity_types_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_session_entity_types @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb index 31b4db05dfec..5ff247093add 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/sessions" class ::Google::Cloud::Dialogflow::CX::V3::Sessions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_data_store_path def test_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_entity_type_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -64,7 +74,7 @@ def test_intent_path def test_page_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -76,7 +86,7 @@ def test_page_path def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -91,7 +101,7 @@ def test_session_path def test_session_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -106,7 +116,7 @@ def test_session_entity_type_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb index 07ebd59949a7..caf61daf0d0a 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_detect_intent @@ -293,7 +301,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb index ecb0b0f5a561..daf36e603752 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/sessions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_detect_intent @@ -403,7 +411,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb index 1c2b81c6499f..ccf54e0c8d0e 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb index c0002c65d725..6fb7b46752c1 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/test_cases" class ::Google::Cloud::Dialogflow::CX::V3::TestCases::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_entity_type_path def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_environment_path def test_flow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_flow_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_intent_path def test_page_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_page_path def test_test_case_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_test_case_path def test_test_case_result_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_test_case_result_path def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -136,7 +146,7 @@ def test_transition_route_group_path def test_webhook_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb index 05496c9f07a3..cb557b7b0633 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_test_cases @@ -731,7 +739,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb index 55b5ea60b566..5104a6b164c5 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/test_cases_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_test_cases @@ -813,7 +821,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end @@ -831,7 +840,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb index d7fd390733e3..d9cacc65640b 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/transition_route_groups" class ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_flow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_flow_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_intent_path def test_page_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_page_path def test_transition_route_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end @@ -88,7 +98,7 @@ def test_transition_route_group_path def test_webhook_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb index 1c999a0a1a98..0884f02f7458 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_transition_route_groups @@ -345,7 +353,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb index be724abc059c..bb22f08ca1c7 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/transition_route_groups_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_transition_route_groups @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb index df5507b8bc2a..ffe09896b0f5 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb index 0b3f3ecbceca..d2599110fe1a 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/versions" class ::Google::Cloud::Dialogflow::CX::V3::Versions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_flow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_flow_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb index a91702c35fbf..f02985c083cd 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_versions @@ -451,7 +459,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb index 5243dd3dc154..64d3e3647e8d 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/versions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_versions @@ -486,7 +494,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| config.credentials = grpc_channel end @@ -504,7 +513,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb index 64af891b0bde..e7f431929d4f 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/cx/v3/webhooks" class ::Google::Cloud::Dialogflow::CX::V3::Webhooks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_agent_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_service_path def test_webhook_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb index 641e58daa708..db5f666de1b7 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_webhooks @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb index c3cccb772de4..bc3ec88368fa 100644 --- a/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb +++ b/google-cloud-dialogflow-cx-v3/test/google/cloud/dialogflow/cx/v3/webhooks_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_webhooks @@ -356,7 +364,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb index 3545e5d8acfe..ac697f47ba7c 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @agents_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Agents::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @agents_stub.endpoint + config.universe_domain = @agents_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb index 5dee2b71d078..420c6a701756 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb @@ -156,20 +156,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @agents_stub = ::Google::Cloud::Dialogflow::V2::Agents::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @agents_stub.endpoint + config.universe_domain = @agents_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb index 0fb65e88c81b..83e0e6cfde5d 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_agent REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb index 4b46644637f2..bd70be1473bb 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @answer_records_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::AnswerRecords::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @answer_records_stub.endpoint + config.universe_domain = @answer_records_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb index c32f87f028c8..4e52a2f52222 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @answer_records_stub = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @answer_records_stub.endpoint + config.universe_domain = @answer_records_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb index ee7735d11956..d399bb8926a2 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_answer_records REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb index 137fc3b7a9c7..13bcfcc7258f 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @contexts_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Contexts::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @contexts_stub.endpoint + config.universe_domain = @contexts_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb index cc9dabe2bbde..6a85bc8c6386 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb @@ -149,20 +149,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @contexts_stub = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @contexts_stub.endpoint + config.universe_domain = @contexts_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb index ac0c0c69e7a7..557822d6770a 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_contexts REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb index f1e7f72c74b3..0490f849c0a0 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb @@ -162,13 +162,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversation_datasets_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Stub, credentials: credentials, @@ -179,6 +172,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversation_datasets_stub.endpoint + config.universe_domain = @conversation_datasets_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb index e23888460a52..1fd8d5635a5e 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb @@ -159,20 +159,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @conversation_datasets_stub = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversation_datasets_stub.endpoint + config.universe_domain = @conversation_datasets_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb index bab492caaf33..fdbb76acc0d3 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_conversation_dataset REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb index 918c1b0fe358..0a1a052f8b7d 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversation_models_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::ConversationModels::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversation_models_stub.endpoint + config.universe_domain = @conversation_models_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb index 8f7d6438e578..c9635fa927b5 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb @@ -156,20 +156,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @conversation_models_stub = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversation_models_stub.endpoint + config.universe_domain = @conversation_models_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb index f970cd6eb2ce..c2a0ae8fbd60 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_conversation_model REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb index 93565cd7547e..a9b289c98114 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb @@ -160,13 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversation_profiles_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Stub, credentials: credentials, @@ -177,6 +170,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversation_profiles_stub.endpoint + config.universe_domain = @conversation_profiles_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb index 0123373d7a40..9046cf47add3 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb @@ -157,20 +157,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @conversation_profiles_stub = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversation_profiles_stub.endpoint + config.universe_domain = @conversation_profiles_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb index a1126909158b..c1f41fbc42cd 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_conversation_profiles REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb index 273114b6685b..35c41f8bed9b 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversations_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Conversations::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversations_stub.endpoint + config.universe_domain = @conversations_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb index a2195ca3842d..eaaa1c0587ee 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @conversations_stub = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversations_stub.endpoint + config.universe_domain = @conversations_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb index 046a9de17843..a48d7c2f5ff6 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_conversation REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb index 1137048f39e7..c142f9df7883 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb @@ -160,13 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @documents_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Documents::Stub, credentials: credentials, @@ -177,6 +170,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @documents_stub.endpoint + config.universe_domain = @documents_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb index e479b9b0c35c..db40ff1dd3d6 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb @@ -157,20 +157,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @documents_stub = ::Google::Cloud::Dialogflow::V2::Documents::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @documents_stub.endpoint + config.universe_domain = @documents_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb index 034c16048f5b..2c3298767be7 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_documents REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb index 067d0d28da91..4ab45abf90f5 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @entity_types_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::EntityTypes::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @entity_types_stub.endpoint + config.universe_domain = @entity_types_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb index 7760057dc97c..8598520b40a7 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb @@ -156,20 +156,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @entity_types_stub = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @entity_types_stub.endpoint + config.universe_domain = @entity_types_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb index 37d5c5c55f66..a9a2d0fdc0e0 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_entity_types REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb index 14c1deb1bd22..fd22fb14f3fe 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @environments_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Environments::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @environments_stub.endpoint + config.universe_domain = @environments_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb index e1f1e82e1e2d..0f7f5be58768 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb @@ -149,20 +149,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @environments_stub = ::Google::Cloud::Dialogflow::V2::Environments::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @environments_stub.endpoint + config.universe_domain = @environments_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb index 63dbe5d8e6b5..06fb41a45abe 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_environments REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb index ebc91658a559..37ce703906f6 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @fulfillments_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Fulfillments::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @fulfillments_stub.endpoint + config.universe_domain = @fulfillments_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb index 76897a000bca..d264fff0757c 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb @@ -149,20 +149,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @fulfillments_stub = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @fulfillments_stub.endpoint + config.universe_domain = @fulfillments_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb index 05348b2516fd..7e47f4075d0f 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_fulfillment REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb index 7ac886b0d02d..a9b2a789ee37 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @intents_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Intents::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @intents_stub.endpoint + config.universe_domain = @intents_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb index 6feb1ca378a7..0b2b4cb2a182 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb @@ -156,20 +156,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @intents_stub = ::Google::Cloud::Dialogflow::V2::Intents::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @intents_stub.endpoint + config.universe_domain = @intents_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb index ff81f197acf4..7209151401e8 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_intents REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb index 0253f2f2208c..54b28960a484 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @knowledge_bases_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @knowledge_bases_stub.endpoint + config.universe_domain = @knowledge_bases_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb index a8fae39cbd35..e0be88fc0bcd 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @knowledge_bases_stub = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @knowledge_bases_stub.endpoint + config.universe_domain = @knowledge_bases_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb index 40993c6dccfa..a5d96f38abc5 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_knowledge_bases REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb index 034b948b96e5..13443f28e452 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb @@ -159,13 +159,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @participants_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Participants::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @participants_stub.endpoint + config.universe_domain = @participants_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb index 4d57b5c694c2..5389b983a77b 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb @@ -154,20 +154,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @participants_stub = ::Google::Cloud::Dialogflow::V2::Participants::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @participants_stub.endpoint + config.universe_domain = @participants_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb index ac7b48feb766..3c80ff4dd5df 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_participant REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb index 7c281d483dc2..0805ee0e72ee 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb @@ -153,13 +153,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @session_entity_types_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Stub, credentials: credentials, @@ -170,6 +163,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_entity_types_stub.endpoint + config.universe_domain = @session_entity_types_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb index 24dcb27a2538..b1bc61d78e6a 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb @@ -150,20 +150,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @session_entity_types_stub = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_entity_types_stub.endpoint + config.universe_domain = @session_entity_types_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb index dec0fa06dcca..c1667b9fb458 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_session_entity_types REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb index a8916d1e8d77..d8ee4baf15c9 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb @@ -162,13 +162,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @sessions_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Sessions::Stub, credentials: credentials, @@ -179,6 +172,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @sessions_stub.endpoint + config.universe_domain = @sessions_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb index 1208417b3749..2d0139891833 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb @@ -157,20 +157,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @sessions_stub = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @sessions_stub.endpoint + config.universe_domain = @sessions_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb index 33c249f58fdd..4865073c0353 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the detect_intent REST call # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb index 943e04153664..14ca1687e6cf 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @versions_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dialogflow::V2::Versions::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @versions_stub.endpoint + config.universe_domain = @versions_stub.universe_domain + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb index f10c5c28611e..0cc687b8e25f 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb @@ -149,20 +149,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @versions_stub = ::Google::Cloud::Dialogflow::V2::Versions::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @versions_stub.endpoint + config.universe_domain = @versions_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb index adacb972d8ef..f50f150b1843 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_versions REST call # diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb index 15dc76d0948d..cda0d0f21531 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb index d84cac360198..a95978756424 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/agents" class ::Google::Cloud::Dialogflow::V2::Agents::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb index 20f44dfd0695..8bd2472beead 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_agent @@ -559,7 +567,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb index 8e88480ac265..b2a666f492e4 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_agent @@ -614,7 +622,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| config.credentials = grpc_channel end @@ -632,7 +641,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb index f7a70a10fb7a..43d30637d14b 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/answer_records" class ::Google::Cloud::Dialogflow::V2::AnswerRecords::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_answer_record_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_answer_record_path def test_context_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_context_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| config.credentials = grpc_channel end @@ -76,7 +86,7 @@ def test_intent_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| config.credentials = grpc_channel end @@ -88,7 +98,7 @@ def test_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb index e9dc54c74f3a..87078c5c01b8 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_answer_records @@ -178,7 +186,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb index 227f4b501728..c12d9823ff12 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_answer_records @@ -180,7 +188,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb index 2db87ac39f04..57bac051f693 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/contexts" class ::Google::Cloud::Dialogflow::V2::Contexts::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_context_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| config.credentials = grpc_channel end @@ -46,7 +56,7 @@ def test_context_path def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb index 36f0db314845..2f8a0218366c 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_contexts @@ -394,7 +402,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb index 66f4f6be1925..88be60e7cf40 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_contexts @@ -412,7 +420,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb index ef821d65243d..3c0382d180f2 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb index f0d389abe2e9..64a1bddc95d6 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/conversation_datasets" class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_conversation_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_conversation_dataset_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb index a64379012ce2..94f110b7711e 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation_dataset @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb index f165c1c09d2e..b0135aa790e8 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation_dataset @@ -369,7 +377,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| config.credentials = grpc_channel end @@ -387,7 +396,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb index 56fa7036ccfd..df810ea5e334 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb index 1f3a5da215bb..a131e3539960 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/conversation_models" class ::Google::Cloud::Dialogflow::V2::ConversationModels::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_conversation_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_conversation_dataset_path def test_conversation_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_conversation_model_path def test_conversation_model_evaluation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_conversation_model_evaluation_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb index 1c37e7eb07e8..7c206f919535 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation_model @@ -558,7 +566,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb index 6dcf67ba252f..bbb2b5648247 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation_model @@ -620,7 +628,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.credentials = grpc_channel end @@ -638,7 +647,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb index 1de3508a9f30..f07416d7be62 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb index bdcc0242b28d..7f0eabcbc79b 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/conversation_profiles" class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_cx_security_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_cx_security_settings_path def test_conversation_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_conversation_model_path def test_conversation_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -82,7 +92,7 @@ def test_conversation_profile_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_document_path def test_knowledge_base_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -112,7 +122,7 @@ def test_knowledge_base_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -124,7 +134,7 @@ def test_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb index 0e438c9834ed..a6d2bacb713b 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_conversation_profiles @@ -452,7 +460,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb index cb56eed09b4a..cc36f57fc2a4 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_conversation_profiles @@ -488,7 +496,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end @@ -506,7 +515,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb index 3c1db4de4d8b..600af2cb2a98 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/conversations" class ::Google::Cloud::Dialogflow::V2::Conversations::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_cx_security_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_cx_security_settings_path def test_conversation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_conversation_path def test_conversation_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -82,7 +92,7 @@ def test_conversation_model_path def test_conversation_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_conversation_profile_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -112,7 +122,7 @@ def test_document_path def test_knowledge_base_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -127,7 +137,7 @@ def test_knowledge_base_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -139,7 +149,7 @@ def test_location_path def test_message_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end @@ -154,7 +164,7 @@ def test_message_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb index 954388d50958..8cdcc81c39cc 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation @@ -517,7 +525,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb index 1bcbdfc2fcf7..6f1f637086ec 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_conversation @@ -563,7 +571,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb index c2272ea8c8fa..3c97fe591932 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb index 35a4284be936..729e416619a6 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/documents" class ::Google::Cloud::Dialogflow::V2::Documents::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_document_path def test_knowledge_base_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb index 5167f2afa137..8cb42ec595a2 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_documents @@ -512,7 +520,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb index 5b545072dfaa..fe93b0300096 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_documents @@ -581,7 +589,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| config.credentials = grpc_channel end @@ -599,7 +608,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb index d204aaa0e3df..2634a0e84485 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb index 3f1818e1dbbe..5b6ce7375021 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/entity_types" class ::Google::Cloud::Dialogflow::V2::EntityTypes::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb index 0b6ba7c0502e..a945327ab3ba 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_entity_types @@ -625,7 +633,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb index bf686f7e422e..3898bcf4ab0f 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_entity_types @@ -700,7 +708,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| config.credentials = grpc_channel end @@ -718,7 +727,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb index fa4264c07d47..3b7076348533 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/environments" class ::Google::Cloud::Dialogflow::V2::Environments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_environment_path def test_fulfillment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -70,7 +80,7 @@ def test_fulfillment_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb index ff7905a3318f..53c0656e3283 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_environments @@ -398,7 +406,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb index b3f897d1102e..92d72ddfd955 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_environments @@ -425,7 +433,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb index 67449aa324be..159025ab7bce 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/fulfillments" class ::Google::Cloud::Dialogflow::V2::Fulfillments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_fulfillment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb index aa42e127e4d5..dbd22ff7923b 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_fulfillment @@ -175,7 +183,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb index 8517f4f6c523..a8717452c824 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_fulfillment @@ -169,7 +177,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb index 3798030945fe..187d97bb15f3 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb index fbfb6f051a72..548b1aa0630f 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/intents" class ::Google::Cloud::Dialogflow::V2::Intents::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_context_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_context_path def test_intent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb index 24df5d63ae49..be73ccef7ca8 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_intents @@ -461,7 +469,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb index 1d61fdc30610..1d0bfbfe91a4 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_intents @@ -507,7 +515,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| config.credentials = grpc_channel end @@ -525,7 +534,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb index bf88bf9281bf..1df19e1849a7 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/knowledge_bases" class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_knowledge_base_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_knowledge_base_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb index 11e9c630b7fc..89637c6d87d0 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_knowledge_bases @@ -342,7 +350,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb index 6b94859a9bc3..b0e0fcce6cb4 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_knowledge_bases @@ -358,7 +366,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb index 1e2f342d0860..48933c8ae544 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/participants" class ::Google::Cloud::Dialogflow::V2::Participants::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_context_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| config.credentials = grpc_channel end @@ -46,7 +56,7 @@ def test_context_path def test_conversation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_conversation_path def test_message_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| config.credentials = grpc_channel end @@ -76,7 +86,7 @@ def test_message_path def test_participant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| config.credentials = grpc_channel end @@ -91,7 +101,7 @@ def test_participant_path def test_session_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb index 096d9da38685..d636d352cc5f 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_participant @@ -517,7 +525,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb index 32c43a6defe5..135078367390 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_participant @@ -667,7 +675,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb index 97dcb9ece7e6..6e4026cbeab4 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/session_entity_types" class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| config.credentials = grpc_channel end @@ -46,7 +56,7 @@ def test_session_path def test_session_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb index 7aa6db819d7a..0279188484d0 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_session_entity_types @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb index ed83469ce626..11d6d5695fb4 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_session_entity_types @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb index 40f846f30176..d0f789030bb1 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/sessions" class ::Google::Cloud::Dialogflow::V2::Sessions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_context_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -46,7 +56,7 @@ def test_context_path def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_session_path def test_session_entity_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb index c69a2c96dddc..1eede0d1ac31 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_detect_intent @@ -125,7 +133,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb index bba8bae628bd..883710ce0a5c 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_detect_intent @@ -221,7 +229,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb index 829e17b8d1c6..32121aa4f4a5 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dialogflow/v2/versions" class ::Google::Cloud::Dialogflow::V2::Versions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_agent_path def test_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb index dccb63450dc6..821c5fcf4025 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_versions @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb index 6c05b430bdfc..a8efa513a4ad 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_versions @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb index 44bd2c13751c..bbae92bcb174 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @completion_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb index 22ec309ba3d2..bcb3c3dd3a6a 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @completion_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb index 4982701de8b0..e516d5719bdd 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb index 6bb5a2ef681b..5e79f1501d67 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversational_search_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb index a03f1b3dca47..2df5fb139458 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversational_search_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb index c1ea78eb4319..5cc2ed786202 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the converse_conversation REST call # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb index 4d27fb5b0873..af66ae816f03 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb @@ -165,13 +165,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Stub, credentials: credentials, @@ -182,6 +175,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb index 3009583189a6..320dd21d0e86 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb @@ -162,19 +162,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_service_stub = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb index 0ab1c569007b..0ebd22597062 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_document REST call # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb index ca772f7f96f5..cefeb1baee15 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @schema_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb index b03bd4400d68..1d98f62da3d9 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb @@ -156,19 +156,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb index a6f968786a4f..5ba58da6e688 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_schema REST call # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb index 38ca4740d63a..76109b583a7c 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @search_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1::SearchService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb index dab1efed65bb..bb559c4f678e 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @search_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb index d90a6fe85af6..2cd6fefe0cff 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search REST call # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb index d5e56bb11144..870627a5a781 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb @@ -164,13 +164,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @user_event_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Stub, credentials: credentials, @@ -181,6 +174,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb index 3736c009c012..0ab5ba16141f 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb @@ -161,19 +161,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @user_event_service_stub = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb index baf135c96cb4..29e806b1fc4b 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the write_user_event REST call # diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb index 3ab619de770d..502ed113f3b2 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1/completion_service" class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb index 23b1a74b1311..54becf1b5718 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -124,7 +132,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb index d0443e2f1790..2685c96db2f1 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -117,7 +125,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb index 966011d0e5ba..145241a94812 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1/conversational_search_service" class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_conversation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_conversation_path def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_data_store_path def test_serving_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb index ea395f8782a6..fc366b42a5f0 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_converse_conversation @@ -402,7 +410,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb index 41d3c49ee3b0..5cf5cee0af9f 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_converse_conversation @@ -428,7 +436,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb index f83d62678229..3686c77b7d66 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb index 721383515b6f..863d07df80d0 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1/document_service" class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_branch_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb index eefb300647ea..202303e54e19 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_document @@ -456,7 +464,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb index d818737b1995..9b0a9b05c60e 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_document @@ -497,7 +505,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -515,7 +524,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb index 52afa002f044..38adfa18b437 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb index fa41d48d83ec..58d4337e0671 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1/schema_service" class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_data_store_path def test_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb index 067ebbae564f..09f405ea9779 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_schema @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb index ef13d022104f..3e543abe2835 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_schema @@ -371,7 +379,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end @@ -389,7 +398,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb index 992f8e34cf1a..f7ad64c7b175 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1/search_service" class ::Google::Cloud::DiscoveryEngine::V1::SearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_branch_path def test_serving_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb index 469c0fcaae0d..2ba839cf41aa 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -138,7 +146,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb index 676c063e2043..308dd0274204 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -150,7 +158,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb index 60f4859610d9..453a5bd6e152 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb index 0996b9464228..1cb139db5ab9 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1/user_event_service" class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_data_store_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb index d8d398d21a8b..c476a4ee44d7 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -234,7 +242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb index 5a1eff8fd890..5ca2da5ee04a 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -246,7 +254,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -264,7 +273,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb index dc0d67ee4285..720c73d853e7 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @completion_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb index c1c5845dfe90..d5c1de261cc1 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @completion_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb index 705d527f3e29..7dcc9ec7f75a 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb index 65ee6737c29f..a8382851176f 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversational_search_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb index ea715f58c87e..cf284003d73c 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @conversational_search_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb index f73429cacfab..3dbd3764ff37 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the converse_conversation REST call # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb index 322970c299ce..9d9b4e64ee34 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb @@ -166,13 +166,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Stub, credentials: credentials, @@ -183,6 +176,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb index 5c2e4585bcbd..0ff1e100c398 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb @@ -163,19 +163,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb index c20114484aba..17f07e33ac21 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_document REST call # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb index aa2eca59fce7..0e3144e569f7 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @recommendation_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @recommendation_service_stub.endpoint + config.universe_domain = @recommendation_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb index f6a4a9c46869..ef78f4a3aa4f 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @recommendation_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @recommendation_service_stub.endpoint + config.universe_domain = @recommendation_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb index 4e92c5969776..205e0363b357 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the recommend REST call # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb index 841d77df47b2..c81109fcf5bf 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @schema_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb index 5e26a762e3b9..ceb48bd23604 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb @@ -156,19 +156,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb index ed4407d7b385..ec36568cdefd 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_schema REST call # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb index 9ca3f367881e..1633c9a56f3e 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @search_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb index 8363db383544..abc655c747a1 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @search_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb index 9464b16fb7b9..67f0e5c6e0e4 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search REST call # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb index 534ef39571a9..f0e05bfe8535 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb @@ -164,13 +164,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @user_event_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Stub, credentials: credentials, @@ -181,6 +174,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb index 74310f89abde..d5a7d0fffd54 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb @@ -161,19 +161,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @user_event_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + end end ## diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb index 6bf5828fa483..81ecc2639c6f 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the write_user_event REST call # diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_paths_test.rb index d1b3c7825ac6..cc01c5cfcc51 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/completion_service" class ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_rest_test.rb index 8cb6ceb24026..791fecb00a7f 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -124,7 +132,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_test.rb index 4eafbf0b2abd..a04c9d794dee 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/completion_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -117,7 +125,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_paths_test.rb index af877f523cdf..62c134c34289 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/conversational_search_service" class ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_conversation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_conversation_path def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_data_store_path def test_serving_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_rest_test.rb index efc94d8e79f9..832da654b503 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_converse_conversation @@ -402,7 +410,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_test.rb index 7cf3a8db5c64..eb5e043b3a76 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/conversational_search_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_converse_conversation @@ -428,7 +436,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_operations_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_operations_test.rb index 29d10d07a86f..adced17e3434 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_operations_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_paths_test.rb index 22b684fa2415..bede9f55d02e 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/document_service" class ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_branch_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_rest_test.rb index 17f43b0617b4..bbbf717fc2bb 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_document @@ -456,7 +464,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_test.rb index 50c38b22d6c2..ae5486b231be 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/document_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_document @@ -497,7 +505,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -515,7 +524,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_paths_test.rb index b23e2947f418..2d4add1ab116 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/recommendation_service" class ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_document_path def test_serving_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_rest_test.rb index 254c961c6d9a..70d9733d4210 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_recommend @@ -126,7 +134,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_test.rb index 17409e45034c..dd202844351a 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/recommendation_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_recommend @@ -121,7 +129,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_operations_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_operations_test.rb index d2e8b4dbb50a..e25ed0b775d0 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_operations_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_paths_test.rb index a3634eb50ebb..40311b86a960 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/schema_service" class ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_data_store_path def test_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_rest_test.rb index da815dab337b..298b04a3cf1f 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_schema @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_test.rb index a6aed8f5f735..416651f766be 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/schema_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_schema @@ -371,7 +379,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Client.new do |config| config.credentials = grpc_channel end @@ -389,7 +398,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_paths_test.rb index 281dab882700..4e8eab48bf73 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/search_service" class ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_branch_path def test_serving_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_rest_test.rb index 157fd169720a..2084878df29c 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -140,7 +148,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_test.rb index 9df9821b3ae1..2704b37d40cf 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/search_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -154,7 +162,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_operations_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_operations_test.rb index 8a55298aec2c..d5f9825a90e5 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_operations_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_paths_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_paths_test.rb index d51cb1389a63..f095085c3d0b 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_paths_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/discovery_engine/v1beta/user_event_service" class ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_data_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_data_store_path def test_document_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_rest_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_rest_test.rb index 432ca868e572..5feed6c1b302 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -234,7 +242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_test.rb b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_test.rb index 32ce5816c550..9d792147b4c4 100644 --- a/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_test.rb +++ b/google-cloud-discovery_engine-v1beta/test/google/cloud/discovery_engine/v1beta/user_event_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -246,7 +254,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -264,7 +273,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb index 3c7c00382e48..6f968ae44ecd 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb @@ -302,13 +302,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dlp_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Dlp::V2::DlpService::Stub, credentials: credentials, @@ -319,6 +312,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dlp_service_stub.endpoint + config.universe_domain = @dlp_service_stub.universe_domain + end end ## diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb index 204df4f0be3c..1547f25abd45 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb @@ -299,19 +299,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dlp_service_stub = ::Google::Cloud::Dlp::V2::DlpService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dlp_service_stub.endpoint + config.universe_domain = @dlp_service_stub.universe_domain + end end ## diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/service_stub.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/service_stub.rb index 033da820c676..7296d5c9a716 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/service_stub.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the inspect_content REST call # diff --git a/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_paths_test.rb b/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_paths_test.rb index e98f1946a520..b7e71609084c 100644 --- a/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_paths_test.rb +++ b/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/dlp/v2/dlp_service" class ::Google::Cloud::Dlp::V2::DlpService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_deidentify_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -46,7 +56,7 @@ def test_deidentify_template_path def test_discovery_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -58,7 +68,7 @@ def test_discovery_config_path def test_dlp_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_dlp_job_path def test_inspect_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -94,7 +104,7 @@ def test_inspect_template_path def test_job_trigger_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_job_trigger_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_location_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_organization_path def test_organization_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_organization_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end @@ -157,7 +167,7 @@ def test_project_path def test_stored_info_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_rest_test.rb b/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_rest_test.rb index 1c61a9253591..7a264327ffc6 100644 --- a/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_rest_test.rb +++ b/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_inspect_content @@ -2252,7 +2260,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Dlp::V2::DlpService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_test.rb b/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_test.rb index d8b25373a9f1..a10acc016dd2 100644 --- a/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_test.rb +++ b/google-cloud-dlp-v2/test/google/cloud/dlp/v2/dlp_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_inspect_content @@ -2504,7 +2512,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb index 34bca69f8aca..2ee4594ca98b 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb @@ -172,13 +172,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_processor_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Stub, credentials: credentials, @@ -189,6 +182,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_processor_service_stub.endpoint + config.universe_domain = @document_processor_service_stub.universe_domain + end end ## diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb index 348c57b4c66e..8acae90db6aa 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb @@ -169,20 +169,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_processor_service_stub.endpoint + config.universe_domain = @document_processor_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb index e8fe3aaf9193..1d1c20d4390e 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the process_document REST call # diff --git a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb index 80fbed23dfef..71ea3dfc6db9 100644 --- a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb +++ b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb index c7a110e73c7c..0b4849271195 100644 --- a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb +++ b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/document_ai/v1/document_processor_service" class ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_evaluation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_evaluation_path def test_human_review_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_human_review_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_processor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_processor_path def test_processor_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_processor_type_path def test_processor_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb index 74ae372f1b2d..9498d1313e1e 100644 --- a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb +++ b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_process_document @@ -1282,7 +1290,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb index 0f0bd854833d..2ca475e26e40 100644 --- a/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb +++ b/google-cloud-document_ai-v1/test/google/cloud/document_ai/v1/document_processor_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_process_document @@ -1461,7 +1469,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -1479,7 +1488,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb index 308e7a25ac6d..a56b2bb16bf2 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb @@ -172,13 +172,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_processor_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Stub, credentials: credentials, @@ -189,6 +182,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_processor_service_stub.endpoint + config.universe_domain = @document_processor_service_stub.universe_domain + end end ## diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb index e6fc15ede50a..f5e3afb2cd3d 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb @@ -169,20 +169,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_processor_service_stub.endpoint + config.universe_domain = @document_processor_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb index 6a4476345347..f819851f4955 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the process_document REST call # diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb index d6f41c618d88..abcb663c6db9 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb @@ -154,13 +154,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @document_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + end end ## diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb index 28eb64b47555..87a02b5bd885 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb @@ -151,20 +151,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @document_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb index 42ee5f9918fa..f3fcf35ad0d8 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the update_dataset REST call # diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb index ee1be64c70a3..369e659a9a91 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb index fe7f03e99253..7588df7c5e40 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/document_ai/v1beta3/document_processor_service" class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_evaluation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_evaluation_path def test_human_review_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_human_review_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_processor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_processor_path def test_processor_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_processor_type_path def test_processor_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb index 1dceb202a6d3..ea380e3c28b8 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_process_document @@ -1341,7 +1349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb index ddd70ff1fb5d..447685256839 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_process_document @@ -1535,7 +1543,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end @@ -1553,7 +1562,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb index 13f8919a8b71..7a47775a20c8 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb index b3f13eaeef7b..0d687ba197fb 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/document_ai/v1beta3/document_service" class ::Google::Cloud::DocumentAI::V1beta3::DocumentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_dataset_path def test_dataset_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_dataset_schema_path def test_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb index 485ac02b5b4b..6b042045c35f 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_update_dataset @@ -457,7 +465,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb index 8f6cce373034..4a67a294f483 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_update_dataset @@ -503,7 +511,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| config.credentials = grpc_channel end @@ -521,7 +530,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::DocumentAI::V1beta3::DocumentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/service_stub.rb b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/service_stub.rb index 53fa0ee96b57..48cbe766b999 100644 --- a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/service_stub.rb +++ b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search_domains REST call # diff --git a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_operations_test.rb b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_operations_test.rb index 349be001d77d..33d48bf6323f 100644 --- a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_operations_test.rb +++ b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1::Domains::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_paths_test.rb b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_paths_test.rb index a1f47e2749df..2d7bb13464b1 100644 --- a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_paths_test.rb +++ b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/domains/v1/domains" class ::Google::Cloud::Domains::V1::Domains::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Domains::V1::Domains::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_registration_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Domains::V1::Domains::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_rest_test.rb b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_rest_test.rb index 8a6a8be8e2a9..2c1fe7712270 100644 --- a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_rest_test.rb +++ b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_domains @@ -902,7 +910,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1::Domains::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_test.rb b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_test.rb index b0bac8eeeca3..6bab42ffdec6 100644 --- a/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_test.rb +++ b/google-cloud-domains-v1/test/google/cloud/domains/v1/domains_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_domains @@ -1018,7 +1026,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1::Domains::Client.new do |config| config.credentials = grpc_channel end @@ -1036,7 +1045,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1::Domains::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-domains-v1beta1/lib/google/cloud/domains/v1beta1/domains/rest/service_stub.rb b/google-cloud-domains-v1beta1/lib/google/cloud/domains/v1beta1/domains/rest/service_stub.rb index 3342ccf412cf..fb1e2e4d06cb 100644 --- a/google-cloud-domains-v1beta1/lib/google/cloud/domains/v1beta1/domains/rest/service_stub.rb +++ b/google-cloud-domains-v1beta1/lib/google/cloud/domains/v1beta1/domains/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search_domains REST call # diff --git a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_operations_test.rb b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_operations_test.rb index 00fdaa764c35..8899dc361227 100644 --- a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_operations_test.rb +++ b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1beta1::Domains::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_paths_test.rb b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_paths_test.rb index b56c974adbfa..584cb4a99b0b 100644 --- a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_paths_test.rb +++ b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/domains/v1beta1/domains" class ::Google::Cloud::Domains::V1beta1::Domains::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_registration_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_rest_test.rb b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_rest_test.rb index 7f12841e38d3..467da6e9e9dd 100644 --- a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_rest_test.rb +++ b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_domains @@ -902,7 +910,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1beta1::Domains::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_test.rb b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_test.rb index 8ca1b7c4e0b3..63bff3ffddd4 100644 --- a/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_test.rb +++ b/google-cloud-domains-v1beta1/test/google/cloud/domains/v1beta1/domains_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_domains @@ -1018,7 +1026,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config| config.credentials = grpc_channel end @@ -1036,7 +1045,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Domains::V1beta1::Domains::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/client.rb b/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/client.rb index dcd6ae1506d1..d310d3ee9890 100644 --- a/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/client.rb +++ b/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/client.rb @@ -242,13 +242,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @edge_network_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Stub, credentials: credentials, @@ -259,6 +252,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @edge_network_stub.endpoint + config.universe_domain = @edge_network_stub.universe_domain + end end ## diff --git a/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/client.rb b/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/client.rb index 35ad9255a789..07d3d4530988 100644 --- a/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/client.rb +++ b/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/client.rb @@ -239,20 +239,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @edge_network_stub = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @edge_network_stub.endpoint + config.universe_domain = @edge_network_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/service_stub.rb b/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/service_stub.rb index cf03d1a99615..3fce33baa7a9 100644 --- a/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/service_stub.rb +++ b/google-cloud-edge_network-v1/lib/google/cloud/edge_network/v1/edge_network/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the initialize_zone REST call # diff --git a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_operations_test.rb b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_operations_test.rb index f3ecad5624d5..58a963c5c4ce 100644 --- a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_operations_test.rb +++ b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_paths_test.rb b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_paths_test.rb index 2a73eccbc240..1e06477394fb 100644 --- a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_paths_test.rb +++ b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/edge_network/v1/edge_network" class ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_interconnect_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_interconnect_path def test_interconnect_attachment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_interconnect_attachment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_network_path def test_router_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_router_path def test_subnet_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_subnet_path def test_zone_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_rest_test.rb b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_rest_test.rb index 32bbda37e9d3..7bf948814c8c 100644 --- a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_rest_test.rb +++ b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_initialize_zone @@ -1514,7 +1522,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_test.rb b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_test.rb index 3a308fb1d18a..b5dc9c8ce96e 100644 --- a/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_test.rb +++ b/google-cloud-edge_network-v1/test/google/cloud/edge_network/v1/edge_network_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_initialize_zone @@ -1727,7 +1735,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end @@ -1745,7 +1754,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::EdgeNetwork::V1::EdgeNetwork::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest/service_stub.rb b/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest/service_stub.rb index 1879cba43d2c..83e1837db5e1 100644 --- a/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest/service_stub.rb +++ b/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_group_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_group REST call # diff --git a/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest/service_stub.rb b/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest/service_stub.rb index 6a754d19fe59..f5f5710968f2 100644 --- a/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest/service_stub.rb +++ b/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/error_stats_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_group_stats REST call # diff --git a/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest/service_stub.rb b/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest/service_stub.rb index 64dfe7ea7310..3349223df510 100644 --- a/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest/service_stub.rb +++ b/google-cloud-error_reporting-v1beta1/lib/google/cloud/error_reporting/v1beta1/report_errors_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the report_error_event REST call # diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_paths_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_paths_test.rb index b3656f08c51a..d6b5eb23754d 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_paths_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/error_reporting/v1beta1/error_group_service" class ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_error_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_rest_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_rest_test.rb index 097666f4c345..44ebd440f163 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_rest_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_group @@ -174,7 +182,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_test.rb index 21b1f2532590..b755d7d54fa4 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_group_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_group @@ -167,7 +175,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_paths_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_paths_test.rb index 7b28a01af50d..e2db8b96b214 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_paths_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/error_reporting/v1beta1/error_stats_service" class ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_rest_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_rest_test.rb index 9a6abad45e74..2421e5eee0dc 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_rest_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_group_stats @@ -242,7 +250,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_test.rb index 97ed12114a85..ba5c6915f974 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/error_stats_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_group_stats @@ -263,7 +271,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_paths_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_paths_test.rb index d6d553822df7..b385b039cb52 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_paths_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/error_reporting/v1beta1/report_errors_service" class ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_rest_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_rest_test.rb index 90561264a3ad..5df27d7256e1 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_rest_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_report_error_event @@ -121,7 +129,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_test.rb b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_test.rb index d21866ca8cec..d355ba1fd5a4 100644 --- a/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_test.rb +++ b/google-cloud-error_reporting-v1beta1/test/google/cloud/error_reporting/v1beta1/report_errors_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_report_error_event @@ -111,7 +119,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-essential_contacts-v1/lib/google/cloud/essential_contacts/v1/essential_contacts_service/rest/service_stub.rb b/google-cloud-essential_contacts-v1/lib/google/cloud/essential_contacts/v1/essential_contacts_service/rest/service_stub.rb index 41cb0eccf738..02f292d4f03b 100644 --- a/google-cloud-essential_contacts-v1/lib/google/cloud/essential_contacts/v1/essential_contacts_service/rest/service_stub.rb +++ b/google-cloud-essential_contacts-v1/lib/google/cloud/essential_contacts/v1/essential_contacts_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_contact REST call # diff --git a/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_paths_test.rb b/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_paths_test.rb index 0cc9eec03965..7b638f4e2531 100644 --- a/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_paths_test.rb +++ b/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/essential_contacts/v1/essential_contacts_service" class ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_contact_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_contact_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_rest_test.rb b/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_rest_test.rb index e68752159fd3..d8e05c279b37 100644 --- a/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_rest_test.rb +++ b/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_contact @@ -453,7 +461,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_test.rb b/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_test.rb index 8bc76c2f34fa..8cba3e61b751 100644 --- a/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_test.rb +++ b/google-cloud-essential_contacts-v1/test/google/cloud/essential_contacts/v1/essential_contacts_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_contact @@ -485,7 +493,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/rest/service_stub.rb b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/rest/service_stub.rb index c8a57491c16f..ec9f7e5c082e 100644 --- a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/rest/service_stub.rb +++ b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the publish_channel_connection_events REST call # diff --git a/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_rest_test.rb b/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_rest_test.rb index 35026dd57e73..215e51b890e9 100644 --- a/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_rest_test.rb +++ b/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_publish_channel_connection_events @@ -178,7 +186,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb b/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb index 4964afe64fcb..997dabd9f07d 100644 --- a/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb +++ b/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_publish_channel_connection_events @@ -175,7 +183,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb index 9ed9aa637646..60bd1c65e908 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb @@ -156,20 +156,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @eventarc_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Eventarc::V1::Eventarc::Stub, credentials: credentials, @@ -180,6 +166,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @eventarc_stub.endpoint + config.universe_domain = @eventarc_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @eventarc_stub.endpoint + config.universe_domain = @eventarc_stub.universe_domain + end end ## diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/client.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/client.rb index 12712163ff20..7e04053b5450 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/client.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/client.rb @@ -153,28 +153,28 @@ def initialize config.universe_domain = @config.universe_domain end + @eventarc_stub = ::Google::Cloud::Eventarc::V1::Eventarc::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @eventarc_stub.endpoint + config.universe_domain = @eventarc_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @eventarc_stub.endpoint + config.universe_domain = @eventarc_stub.universe_domain config.bindings_override = @config.bindings_override end - - @eventarc_stub = ::Google::Cloud::Eventarc::V1::Eventarc::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/service_stub.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/service_stub.rb index 9b04bbbbb8ee..3c93f5f8b006 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/service_stub.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_trigger REST call # diff --git a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_operations_test.rb b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_operations_test.rb index e425b9a574f4..9b51cddf10fc 100644 --- a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_operations_test.rb +++ b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Eventarc::V1::Eventarc::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb index f6a09dfa44e7..6a2353735342 100644 --- a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb +++ b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/eventarc/v1/eventarc" class ::Google::Cloud::Eventarc::V1::Eventarc::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_channel_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_channel_path def test_channel_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_channel_connection_path def test_cloud_function_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_cloud_function_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_crypto_key_path def test_google_channel_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_google_channel_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_provider_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_provider_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -118,7 +128,7 @@ def test_service_path def test_service_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -130,7 +140,7 @@ def test_service_account_path def test_trigger_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +152,7 @@ def test_trigger_path def test_workflow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_rest_test.rb b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_rest_test.rb index ed22e4868a3e..362ed8200191 100644 --- a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_rest_test.rb +++ b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_trigger @@ -1069,7 +1077,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Eventarc::V1::Eventarc::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb index 9050143a5cf5..5e872d6d13e4 100644 --- a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb +++ b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_trigger @@ -1217,7 +1225,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end @@ -1235,7 +1244,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/client.rb b/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/client.rb index 9a5e37213888..e40daad1ecd3 100644 --- a/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/client.rb +++ b/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/client.rb @@ -206,13 +206,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_filestore_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Stub, credentials: credentials, @@ -223,6 +216,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_filestore_manager_stub.endpoint + config.universe_domain = @cloud_filestore_manager_stub.universe_domain + end end ## diff --git a/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/client.rb b/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/client.rb index 404f495efd8f..3571fee0a465 100644 --- a/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/client.rb +++ b/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/client.rb @@ -203,20 +203,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_filestore_manager_stub = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_filestore_manager_stub.endpoint + config.universe_domain = @cloud_filestore_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/service_stub.rb b/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/service_stub.rb index 5e531e09dd8e..40b604fa3ff7 100644 --- a/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/service_stub.rb +++ b/google-cloud-filestore-v1/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_operations_test.rb b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_operations_test.rb index ec1aa339c07a..33211fa7d34d 100644 --- a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_operations_test.rb +++ b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_paths_test.rb b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_paths_test.rb index b0592e018e74..609aab08cc56 100644 --- a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_paths_test.rb +++ b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/filestore/v1/cloud_filestore_manager" class ::Google::Cloud::Filestore::V1::CloudFilestoreManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_snapshot_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_rest_test.rb b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_rest_test.rb index c786d88fb08a..1721e53b5a33 100644 --- a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_rest_test.rb +++ b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -1009,7 +1017,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_test.rb b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_test.rb index d164b8888f1e..682d8fcf2165 100644 --- a/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_test.rb +++ b/google-cloud-filestore-v1/test/google/cloud/filestore/v1/cloud_filestore_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -1158,7 +1166,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config| config.credentials = grpc_channel end @@ -1176,7 +1185,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb b/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb index cab02ce42327..60b7690bafc7 100644 --- a/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb +++ b/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb @@ -215,13 +215,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @firestore_admin_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Stub, credentials: credentials, @@ -232,6 +225,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_admin_stub.endpoint + config.universe_domain = @firestore_admin_stub.universe_domain + end end ## diff --git a/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb b/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb index d419309c1807..d74d55cd945f 100644 --- a/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb +++ b/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb @@ -212,19 +212,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @firestore_admin_stub = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_admin_stub.endpoint + config.universe_domain = @firestore_admin_stub.universe_domain + end end ## diff --git a/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb b/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb index 0dd0df55da83..2548633876f2 100644 --- a/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb +++ b/google-cloud-firestore-admin-v1/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_index REST call # diff --git a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb index 8ce0c101e0ec..fc792d51cf3b 100644 --- a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb +++ b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb index e3636b7f9f20..423677942499 100644 --- a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb +++ b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/firestore/admin/v1/firestore_admin" class ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_collection_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_collection_group_path def test_database_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_database_path def test_field_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_field_path def test_index_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_index_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb index ccd0b992c9c0..a629f6c03eaa 100644 --- a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb +++ b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_index @@ -841,7 +849,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb index 916aebf5cc32..55174ce3d5e3 100644 --- a/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb +++ b/google-cloud-firestore-admin-v1/test/google/cloud/firestore/admin/v1/firestore_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_index @@ -946,7 +954,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -964,7 +973,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb index 517a206cddea..5cb1a68078e9 100644 --- a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb +++ b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/client.rb @@ -229,13 +229,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @firestore_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Firestore::V1::Firestore::Stub, credentials: credentials, @@ -246,6 +239,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_stub.endpoint + config.universe_domain = @firestore_stub.universe_domain + end end ## diff --git a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb index bc4c888e8c6b..e11f2a1cfd57 100644 --- a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb +++ b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/client.rb @@ -219,19 +219,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @firestore_stub = ::Google::Cloud::Firestore::V1::Firestore::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @firestore_stub.endpoint + config.universe_domain = @firestore_stub.universe_domain + end end ## diff --git a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb index bf17b4c58060..0658ed1603ad 100644 --- a/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb +++ b/google-cloud-firestore-v1/lib/google/cloud/firestore/v1/firestore/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_document REST call # diff --git a/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb b/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb index dc0e511be343..81b79d14dc0b 100644 --- a/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb +++ b/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_document @@ -862,7 +870,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Firestore::V1::Firestore::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb b/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb index d873a98502a1..5a2d0ce215d9 100644 --- a/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb +++ b/google-cloud-firestore-v1/test/google/cloud/firestore/v1/firestore_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_document @@ -1197,7 +1205,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/client.rb b/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/client.rb index 675582a8c9c0..3cabab9c19e5 100644 --- a/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/client.rb +++ b/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/client.rb @@ -179,20 +179,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_functions_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Functions::V1::CloudFunctionsService::Stub, credentials: credentials, @@ -203,6 +189,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_functions_service_stub.endpoint + config.universe_domain = @cloud_functions_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_functions_service_stub.endpoint + config.universe_domain = @cloud_functions_service_stub.universe_domain + end end ## diff --git a/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/client.rb b/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/client.rb index a25b1c104251..47eb5cf3b9d6 100644 --- a/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/client.rb +++ b/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/client.rb @@ -176,27 +176,27 @@ def initialize config.universe_domain = @config.universe_domain end + @cloud_functions_service_stub = ::Google::Cloud::Functions::V1::CloudFunctionsService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @cloud_functions_service_stub.endpoint + config.universe_domain = @cloud_functions_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @cloud_functions_service_stub.endpoint + config.universe_domain = @cloud_functions_service_stub.universe_domain end - - @cloud_functions_service_stub = ::Google::Cloud::Functions::V1::CloudFunctionsService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/service_stub.rb b/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/service_stub.rb index a919c5ec80e1..e9ccc8f3631d 100644 --- a/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/service_stub.rb +++ b/google-cloud-functions-v1/lib/google/cloud/functions/v1/cloud_functions_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_functions REST call # diff --git a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_operations_test.rb b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_operations_test.rb index d6eac23b49d3..eef3465b4ef4 100644 --- a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_operations_test.rb +++ b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_paths_test.rb b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_paths_test.rb index 8ed1001a31c7..a666d756f7fb 100644 --- a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_paths_test.rb +++ b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/functions/v1/cloud_functions_service" class ::Google::Cloud::Functions::V1::CloudFunctionsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cloud_function_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cloud_function_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_crypto_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_rest_test.rb b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_rest_test.rb index df5cdfa92f12..9d4a6d86bc99 100644 --- a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_rest_test.rb +++ b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_functions @@ -671,7 +679,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_test.rb b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_test.rb index 20989a087d1d..2dae4699a758 100644 --- a/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_test.rb +++ b/google-cloud-functions-v1/test/google/cloud/functions/v1/cloud_functions_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_functions @@ -731,7 +739,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Client.new do |config| config.credentials = grpc_channel end @@ -749,7 +758,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/client.rb b/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/client.rb index e426d81a3304..9f7c46ea4629 100644 --- a/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/client.rb +++ b/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/client.rb @@ -160,20 +160,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @function_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Functions::V2::FunctionService::Stub, credentials: credentials, @@ -184,6 +170,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @function_service_stub.endpoint + config.universe_domain = @function_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @function_service_stub.endpoint + config.universe_domain = @function_service_stub.universe_domain + end end ## diff --git a/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/client.rb b/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/client.rb index 6f367d8ae46d..ade806e5d53f 100644 --- a/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/client.rb +++ b/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/client.rb @@ -157,28 +157,28 @@ def initialize config.universe_domain = @config.universe_domain end + @function_service_stub = ::Google::Cloud::Functions::V2::FunctionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @function_service_stub.endpoint + config.universe_domain = @function_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @function_service_stub.endpoint + config.universe_domain = @function_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @function_service_stub = ::Google::Cloud::Functions::V2::FunctionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/service_stub.rb b/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/service_stub.rb index a13d3cb2334c..b25b7d221a34 100644 --- a/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/service_stub.rb +++ b/google-cloud-functions-v2/lib/google/cloud/functions/v2/function_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_function REST call # diff --git a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_operations_test.rb b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_operations_test.rb index 382959750250..a270a072417a 100644 --- a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_operations_test.rb +++ b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V2::FunctionService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_paths_test.rb b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_paths_test.rb index dad9dfa618c4..2d5b7bc996c6 100644 --- a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_paths_test.rb +++ b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/functions/v2/function_service" class ::Google::Cloud::Functions::V2::FunctionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_build_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_build_path def test_channel_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_channel_path def test_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_connector_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_crypto_key_path def test_function_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_function_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_repository_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_service_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_topic_path def test_trigger_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_trigger_path def test_worker_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_rest_test.rb b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_rest_test.rb index a50e876076f0..f6d0c0702e28 100644 --- a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_rest_test.rb +++ b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_function @@ -507,7 +515,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V2::FunctionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_test.rb b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_test.rb index e557a2e5148b..e336030228bd 100644 --- a/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_test.rb +++ b/google-cloud-functions-v2/test/google/cloud/functions/v2/function_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_function @@ -553,7 +561,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end @@ -571,7 +580,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Functions::V2::FunctionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb b/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb index 36bf73edd533..ccaa5b1f0e4b 100644 --- a/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb +++ b/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb @@ -240,20 +240,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @backup_for_gke_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::GkeBackup::V1::BackupForGKE::Stub, credentials: credentials, @@ -264,6 +250,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_for_gke_stub.endpoint + config.universe_domain = @backup_for_gke_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @backup_for_gke_stub.endpoint + config.universe_domain = @backup_for_gke_stub.universe_domain + end end ## diff --git a/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb b/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb index a331dd7812a9..47dac9ddf34f 100644 --- a/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb +++ b/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb @@ -237,28 +237,28 @@ def initialize config.universe_domain = @config.universe_domain end + @backup_for_gke_stub = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @backup_for_gke_stub.endpoint + config.universe_domain = @backup_for_gke_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @backup_for_gke_stub.endpoint + config.universe_domain = @backup_for_gke_stub.universe_domain config.bindings_override = @config.bindings_override end - - @backup_for_gke_stub = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/service_stub.rb b/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/service_stub.rb index 3fb049768376..b5df459ac895 100644 --- a/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/service_stub.rb +++ b/google-cloud-gke_backup-v1/lib/google/cloud/gke_backup/v1/backup_for_gke/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_backup_plan REST call # diff --git a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_operations_test.rb b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_operations_test.rb index a6727c48e368..d5420f36b176 100644 --- a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_operations_test.rb +++ b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_paths_test.rb b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_paths_test.rb index bce4bc7f5d9a..6af7a17f1fb0 100644 --- a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_paths_test.rb +++ b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gke_backup/v1/backup_for_gke" class ::Google::Cloud::GkeBackup::V1::BackupForGKE::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_backup_plan_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_backup_plan_path def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_cluster_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_crypto_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_restore_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_restore_path def test_restore_plan_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_restore_plan_path def test_volume_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_volume_backup_path def test_volume_restore_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_rest_test.rb b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_rest_test.rb index 0ed3537f36d8..5d0e576b4303 100644 --- a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_rest_test.rb +++ b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_backup_plan @@ -1405,7 +1413,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_test.rb b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_test.rb index 48649b682881..81990f222e8c 100644 --- a/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_test.rb +++ b/google-cloud-gke_backup-v1/test/google/cloud/gke_backup/v1/backup_for_gke_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_backup_plan @@ -1619,7 +1627,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end @@ -1637,7 +1646,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_connect-gateway-v1beta1/test/google/cloud/gke_connect/gateway/v1beta1/gateway_service_test.rb b/google-cloud-gke_connect-gateway-v1beta1/test/google/cloud/gke_connect/gateway/v1beta1/gateway_service_test.rb index 3242035e11cc..40d3c7ced9f9 100644 --- a/google-cloud-gke_connect-gateway-v1beta1/test/google/cloud/gke_connect/gateway/v1beta1/gateway_service_test.rb +++ b/google-cloud-gke_connect-gateway-v1beta1/test/google/cloud/gke_connect/gateway/v1beta1/gateway_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_resource @@ -361,7 +369,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb index ebce2746f4a9..a75cd92d6a28 100644 --- a/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb +++ b/google-cloud-gke_hub-v1/lib/google/cloud/gke_hub/v1/gke_hub/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_memberships REST call # diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_operations_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_operations_test.rb index b0e2cc042a4d..4762390f2180 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_operations_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1::GkeHub::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb index c49718e64b2a..e290b8734a55 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gke_hub/v1/gke_hub" class ::Google::Cloud::GkeHub::V1::GkeHub::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_feature_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_feature_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_membership_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb index af3d79a907f9..f0952c4b2374 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_memberships @@ -690,7 +698,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1::GkeHub::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb index 224951ececd0..2aa9ae3735e6 100644 --- a/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb +++ b/google-cloud-gke_hub-v1/test/google/cloud/gke_hub/v1/gke_hub_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_memberships @@ -789,7 +797,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| config.credentials = grpc_channel end @@ -807,7 +816,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1::GkeHub::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/client.rb b/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/client.rb index c1883f4a2d5c..06955857c467 100644 --- a/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/client.rb +++ b/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/client.rb @@ -169,20 +169,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @gke_hub_membership_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Stub, credentials: credentials, @@ -193,6 +179,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @gke_hub_membership_service_stub.endpoint + config.universe_domain = @gke_hub_membership_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @gke_hub_membership_service_stub.endpoint + config.universe_domain = @gke_hub_membership_service_stub.universe_domain + end end ## diff --git a/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/client.rb b/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/client.rb index c474322b99e2..d7dfcc3a5ebe 100644 --- a/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/client.rb +++ b/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/client.rb @@ -166,28 +166,28 @@ def initialize config.universe_domain = @config.universe_domain end + @gke_hub_membership_service_stub = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @gke_hub_membership_service_stub.endpoint + config.universe_domain = @gke_hub_membership_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @gke_hub_membership_service_stub.endpoint + config.universe_domain = @gke_hub_membership_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @gke_hub_membership_service_stub = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/service_stub.rb b/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/service_stub.rb index 85f48f219e86..d88533adb6ac 100644 --- a/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/service_stub.rb +++ b/google-cloud-gke_hub-v1beta1/lib/google/cloud/gke_hub/v1beta1/gke_hub_membership_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_memberships REST call # diff --git a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_operations_test.rb b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_operations_test.rb index 4026387ded4f..af350ca58446 100644 --- a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_operations_test.rb +++ b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_paths_test.rb b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_paths_test.rb index 7aaecaff30bc..0badd4d4264f 100644 --- a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_paths_test.rb +++ b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service" class ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_membership_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_rest_test.rb b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_rest_test.rb index 91b8562fa82f..6829d8f85ff0 100644 --- a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_rest_test.rb +++ b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_memberships @@ -519,7 +527,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_test.rb b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_test.rb index 4e8da0222062..51f74fb31800 100644 --- a/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_test.rb +++ b/google-cloud-gke_hub-v1beta1/test/google/cloud/gke_hub/v1beta1/gke_hub_membership_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_memberships @@ -577,7 +585,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config| config.credentials = grpc_channel end @@ -595,7 +604,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/service_stub.rb b/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/service_stub.rb index 54c2f7cb4d05..3352b5cae97f 100644 --- a/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/service_stub.rb +++ b/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_attached_cluster REST call # diff --git a/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/service_stub.rb b/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/service_stub.rb index 9cffb8360266..688dfbc53b8f 100644 --- a/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/service_stub.rb +++ b/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_aws_cluster REST call # diff --git a/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/service_stub.rb b/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/service_stub.rb index 82c817e1d997..c335d7739308 100644 --- a/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/service_stub.rb +++ b/google-cloud-gke_multi_cloud-v1/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_azure_client REST call # diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_operations_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_operations_test.rb index 9a059ba9a624..2440015c19ce 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_operations_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_paths_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_paths_test.rb index ce2bc9d87e24..77c7d2e4e866 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_paths_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gke_multi_cloud/v1/attached_clusters" class ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_attached_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_attached_cluster_path def test_attached_server_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_attached_server_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_rest_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_rest_test.rb index 570feb634d54..facb7caac455 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_rest_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_attached_cluster @@ -579,7 +587,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_test.rb index 71e560953e6c..f948959b5745 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/attached_clusters_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_attached_cluster @@ -652,7 +660,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config| config.credentials = grpc_channel end @@ -670,7 +679,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_operations_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_operations_test.rb index b18dad09a9a8..e00fd0a60ed2 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_operations_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_paths_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_paths_test.rb index e408ce5393ce..ae2dec86608b 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_paths_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gke_multi_cloud/v1/aws_clusters" class ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_aws_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_aws_cluster_path def test_aws_node_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_aws_node_pool_path def test_aws_server_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_aws_server_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_rest_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_rest_test.rb index 8e5ff9fc4a60..64f44d2e9484 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_rest_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_aws_cluster @@ -962,7 +970,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_test.rb index 603ebe871725..e31a47c170eb 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/aws_clusters_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_aws_cluster @@ -1088,7 +1096,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config| config.credentials = grpc_channel end @@ -1106,7 +1115,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_operations_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_operations_test.rb index 2470bf8bfbaa..99c5c5f9b3d2 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_operations_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_paths_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_paths_test.rb index e5c4a3b5919e..9e2e270a12fa 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_paths_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gke_multi_cloud/v1/azure_clusters" class ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_azure_client_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_azure_client_path def test_azure_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_azure_cluster_path def test_azure_node_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_azure_node_pool_path def test_azure_server_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_azure_server_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_rest_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_rest_test.rb index 4e13db67b75b..809058083f81 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_rest_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_azure_client @@ -1128,7 +1136,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_test.rb b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_test.rb index 830f43d67885..d907abec7c31 100644 --- a/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_test.rb +++ b/google-cloud-gke_multi_cloud-v1/test/google/cloud/gke_multi_cloud/v1/azure_clusters_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_azure_client @@ -1280,7 +1288,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end @@ -1298,7 +1307,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gsuite_add_ons-v1/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/rest/service_stub.rb b/google-cloud-gsuite_add_ons-v1/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/rest/service_stub.rb index 4edb0c841c02..6e341249265e 100644 --- a/google-cloud-gsuite_add_ons-v1/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/rest/service_stub.rb +++ b/google-cloud-gsuite_add_ons-v1/lib/google/cloud/gsuite_add_ons/v1/gsuite_add_ons/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_authorization REST call # diff --git a/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_paths_test.rb b/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_paths_test.rb index 4626ce0d29f4..283b9e14405a 100644 --- a/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_paths_test.rb +++ b/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/gsuite_add_ons/v1/gsuite_add_ons" class ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_authorization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_authorization_path def test_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_deployment_path def test_install_status_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_install_status_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_rest_test.rb b/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_rest_test.rb index 084ac54303c3..2f14355de833 100644 --- a/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_rest_test.rb +++ b/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_authorization @@ -557,7 +565,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_test.rb b/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_test.rb index 85960b17d02e..7aa566e508e2 100644 --- a/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_test.rb +++ b/google-cloud-gsuite_add_ons-v1/test/google/cloud/gsuite_add_ons/v1/gsuite_add_ons_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_authorization @@ -588,7 +596,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::GSuiteAddOns::V1::GSuiteAddOns::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_admin_service/rest/service_stub.rb b/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_admin_service/rest/service_stub.rb index bfd9e6387b3c..4c54d0bfd08e 100644 --- a/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_admin_service/rest/service_stub.rb +++ b/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_admin_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the set_iam_policy REST call # diff --git a/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/service_stub.rb b/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/service_stub.rb index d66fa87b4c04..6e2dfcbb07d3 100644 --- a/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/service_stub.rb +++ b/google-cloud-iap-v1/lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_brands REST call # diff --git a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_paths_test.rb b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_paths_test.rb index bdf45e529379..97d88d19f754 100644 --- a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_paths_test.rb +++ b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/iap/v1/identity_aware_proxy_admin_service" class ::Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_tunnel_dest_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_tunnel_dest_group_path def test_tunnel_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_rest_test.rb b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_rest_test.rb index aa2ed71dff6b..77bdd648c143 100644 --- a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_rest_test.rb +++ b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -616,7 +624,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_test.rb b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_test.rb index d3fba4b18cdb..802da2abd5f1 100644 --- a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_test.rb +++ b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_admin_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -656,7 +664,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_rest_test.rb b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_rest_test.rb index 7080794963d2..ad528798971d 100644 --- a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_rest_test.rb +++ b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_brands @@ -502,7 +510,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_test.rb b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_test.rb index 2017b4d106f9..3d3eb4d6f981 100644 --- a/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_test.rb +++ b/google-cloud-iap-v1/test/google/cloud/iap/v1/identity_aware_proxy_o_auth_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_brands @@ -528,7 +536,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-ids-v1/lib/google/cloud/ids/v1/ids/rest/service_stub.rb b/google-cloud-ids-v1/lib/google/cloud/ids/v1/ids/rest/service_stub.rb index a147a048c459..46f35e0ea7b7 100644 --- a/google-cloud-ids-v1/lib/google/cloud/ids/v1/ids/rest/service_stub.rb +++ b/google-cloud-ids-v1/lib/google/cloud/ids/v1/ids/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_endpoints REST call # diff --git a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_operations_test.rb b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_operations_test.rb index cbdde296d881..9bc298f4bdbb 100644 --- a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_operations_test.rb +++ b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::IDS::V1::IDS::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_paths_test.rb b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_paths_test.rb index a367409df1db..9041ad054ea1 100644 --- a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_paths_test.rb +++ b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/ids/v1/ids" class ::Google::Cloud::IDS::V1::IDS::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_endpoint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::IDS::V1::IDS::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_endpoint_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::IDS::V1::IDS::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_rest_test.rb b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_rest_test.rb index 77807afc2041..38a028375408 100644 --- a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_rest_test.rb +++ b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_endpoints @@ -290,7 +298,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::IDS::V1::IDS::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_test.rb b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_test.rb index 92a34e3478bf..2e868a7df73f 100644 --- a/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_test.rb +++ b/google-cloud-ids-v1/test/google/cloud/ids/v1/ids_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_endpoints @@ -314,7 +322,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::IDS::V1::IDS::Client.new do |config| config.credentials = grpc_channel end @@ -332,7 +341,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::IDS::V1::IDS::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-iot-v1/lib/google/cloud/iot/v1/device_manager/rest/service_stub.rb b/google-cloud-iot-v1/lib/google/cloud/iot/v1/device_manager/rest/service_stub.rb index 9a80e479e4a1..8f0b98e6fbce 100644 --- a/google-cloud-iot-v1/lib/google/cloud/iot/v1/device_manager/rest/service_stub.rb +++ b/google-cloud-iot-v1/lib/google/cloud/iot/v1/device_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_device_registry REST call # diff --git a/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_paths_test.rb b/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_paths_test.rb index c9a867dc7f42..f64f9a7c6bb7 100644 --- a/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_paths_test.rb +++ b/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/iot/v1/device_manager" class ::Google::Cloud::Iot::V1::DeviceManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_device_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_device_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_registry_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_rest_test.rb b/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_rest_test.rb index 01f3a6790ab9..9cb19f2ec737 100644 --- a/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_rest_test.rb +++ b/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_device_registry @@ -1119,7 +1127,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Iot::V1::DeviceManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_test.rb b/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_test.rb index ea20e9af65f5..ec54e356818f 100644 --- a/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_test.rb +++ b/google-cloud-iot-v1/test/google/cloud/iot/v1/device_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_device_registry @@ -1217,7 +1225,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_dashboard_service/rest/service_stub.rb b/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_dashboard_service/rest/service_stub.rb index 350fe9b08512..8757ff5c5696 100644 --- a/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_dashboard_service/rest/service_stub.rb +++ b/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_dashboard_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_crypto_keys REST call # diff --git a/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_tracking_service/rest/service_stub.rb b/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_tracking_service/rest/service_stub.rb index a2f45e49b7f7..be2de0d00559 100644 --- a/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_tracking_service/rest/service_stub.rb +++ b/google-cloud-kms-inventory-v1/lib/google/cloud/kms/inventory/v1/key_tracking_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_protected_resources_summary REST call # diff --git a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_paths_test.rb b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_paths_test.rb index 17ec47871162..1f6abf83cc19 100644 --- a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_paths_test.rb +++ b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/kms/inventory/v1/key_dashboard_service" class ::Google::Cloud::Kms::Inventory::V1::KeyDashboardService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::Inventory::V1::KeyDashboardService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_rest_test.rb b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_rest_test.rb index 66a73e08d02c..715f1203b5fc 100644 --- a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_rest_test.rb +++ b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_crypto_keys @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::Inventory::V1::KeyDashboardService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_test.rb b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_test.rb index 180ed47b5a8a..fc6c34841562 100644 --- a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_test.rb +++ b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_dashboard_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_crypto_keys @@ -118,7 +126,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::Inventory::V1::KeyDashboardService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_paths_test.rb b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_paths_test.rb index fe3947b039cb..0826c4157edb 100644 --- a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_paths_test.rb +++ b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/kms/inventory/v1/key_tracking_service" class ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_organization_path def test_protected_resources_summary_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_rest_test.rb b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_rest_test.rb index 4b546c52af50..ee8a2fb5c1ff 100644 --- a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_rest_test.rb +++ b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_protected_resources_summary @@ -178,7 +186,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_test.rb b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_test.rb index 60d0451fb157..0ce78be1b1ab 100644 --- a/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_test.rb +++ b/google-cloud-kms-inventory-v1/test/google/cloud/kms/inventory/v1/key_tracking_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_protected_resources_summary @@ -180,7 +188,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb index 4bdb332a2be1..b3421e3f6da6 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/client.rb @@ -172,20 +172,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @ekm_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Kms::V1::EkmService::Stub, credentials: credentials, @@ -196,6 +182,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain + end end ## diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb index ba02c43c1b75..c5466fecb93a 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/client.rb @@ -169,28 +169,28 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @ekm_service_stub = ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @ekm_service_stub.endpoint + config.universe_domain = @ekm_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @ekm_service_stub = ::Google::Cloud::Kms::V1::EkmService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb index e188291bb523..eb1cf3aa35ad 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/ekm_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_ekm_connections REST call # diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb index a0bc6294b04d..7b8e1a0cafc9 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/client.rb @@ -283,20 +283,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @key_management_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Kms::V1::KeyManagementService::Stub, credentials: credentials, @@ -307,6 +293,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain + end end ## diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb index 8a221c6f882c..00b062cb1afc 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/client.rb @@ -280,28 +280,28 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + @key_management_service_stub = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @key_management_service_stub.endpoint + config.universe_domain = @key_management_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @key_management_service_stub = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb index 9d9dc06f9105..ec8edc0f4cd7 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/key_management_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_key_rings REST call # diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb index c7cf72f8a7b3..6d345396f2ef 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/kms/v1/ekm_service" class ::Google::Cloud::Kms::V1::EkmService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_ekm_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_ekm_config_path def test_ekm_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_ekm_connection_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb index c55eed340c2b..a26daeb35d3a 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_ekm_connections @@ -452,7 +460,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::V1::EkmService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb index 53ee70b0e5ac..80531c1a773c 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/ekm_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_ekm_connections @@ -478,7 +486,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::V1::EkmService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb index 3d59c948d5a9..ae935a2b0c10 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/kms/v1/key_management_service" class ::Google::Cloud::Kms::V1::KeyManagementService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_crypto_key_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_crypto_key_version_path def test_import_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_import_job_path def test_key_ring_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_key_ring_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb index af6c405a42c0..5d6ef86da84f 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_key_rings @@ -1647,7 +1655,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb index 71c19a52a120..84a4c126c437 100644 --- a/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb +++ b/google-cloud-kms-v1/test/google/cloud/kms/v1/key_management_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_key_rings @@ -1834,7 +1842,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-language-v1/lib/google/cloud/language/v1/language_service/rest/service_stub.rb b/google-cloud-language-v1/lib/google/cloud/language/v1/language_service/rest/service_stub.rb index 08b5eea8da59..b2e28d9593d6 100644 --- a/google-cloud-language-v1/lib/google/cloud/language/v1/language_service/rest/service_stub.rb +++ b/google-cloud-language-v1/lib/google/cloud/language/v1/language_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the analyze_sentiment REST call # diff --git a/google-cloud-language-v1/test/google/cloud/language/v1/language_service_rest_test.rb b/google-cloud-language-v1/test/google/cloud/language/v1/language_service_rest_test.rb index 23e0b4248ff7..4a444c19ab2a 100644 --- a/google-cloud-language-v1/test/google/cloud/language/v1/language_service_rest_test.rb +++ b/google-cloud-language-v1/test/google/cloud/language/v1/language_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_analyze_sentiment @@ -451,7 +459,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Language::V1::LanguageService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-language-v1/test/google/cloud/language/v1/language_service_test.rb b/google-cloud-language-v1/test/google/cloud/language/v1/language_service_test.rb index f572eefab2c7..e5546365e0d9 100644 --- a/google-cloud-language-v1/test/google/cloud/language/v1/language_service_test.rb +++ b/google-cloud-language-v1/test/google/cloud/language/v1/language_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_analyze_sentiment @@ -471,7 +479,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Language::V1::LanguageService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-language-v1beta2/lib/google/cloud/language/v1beta2/language_service/rest/service_stub.rb b/google-cloud-language-v1beta2/lib/google/cloud/language/v1beta2/language_service/rest/service_stub.rb index 1c1b3f98918c..a37514ce8411 100644 --- a/google-cloud-language-v1beta2/lib/google/cloud/language/v1beta2/language_service/rest/service_stub.rb +++ b/google-cloud-language-v1beta2/lib/google/cloud/language/v1beta2/language_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the analyze_sentiment REST call # diff --git a/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_rest_test.rb b/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_rest_test.rb index 715e60f15928..6990eeaea51e 100644 --- a/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_rest_test.rb +++ b/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_analyze_sentiment @@ -451,7 +459,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_test.rb b/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_test.rb index ddf794c214d8..5647acd70b05 100644 --- a/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_test.rb +++ b/google-cloud-language-v1beta2/test/google/cloud/language/v1beta2/language_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_analyze_sentiment @@ -471,7 +479,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Language::V1beta2::LanguageService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-language-v2/lib/google/cloud/language/v2/language_service/rest/service_stub.rb b/google-cloud-language-v2/lib/google/cloud/language/v2/language_service/rest/service_stub.rb index e3ccdd03e02b..b06ce84d5520 100644 --- a/google-cloud-language-v2/lib/google/cloud/language/v2/language_service/rest/service_stub.rb +++ b/google-cloud-language-v2/lib/google/cloud/language/v2/language_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the analyze_sentiment REST call # diff --git a/google-cloud-language-v2/test/google/cloud/language/v2/language_service_rest_test.rb b/google-cloud-language-v2/test/google/cloud/language/v2/language_service_rest_test.rb index cbea9fae6623..f8aa23eb984c 100644 --- a/google-cloud-language-v2/test/google/cloud/language/v2/language_service_rest_test.rb +++ b/google-cloud-language-v2/test/google/cloud/language/v2/language_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_analyze_sentiment @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Language::V2::LanguageService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-language-v2/test/google/cloud/language/v2/language_service_test.rb b/google-cloud-language-v2/test/google/cloud/language/v2/language_service_test.rb index 529df875687d..f3737a78e837 100644 --- a/google-cloud-language-v2/test/google/cloud/language/v2/language_service_test.rb +++ b/google-cloud-language-v2/test/google/cloud/language/v2/language_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_analyze_sentiment @@ -349,7 +357,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Language::V2::LanguageService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb index 9630656b1d35..aadd4195bb20 100644 --- a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb +++ b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb @@ -155,13 +155,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @workflows_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::LifeSciences::V2beta::WorkflowsServiceV2Beta::Stub, credentials: credentials, @@ -172,6 +165,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflows_service_stub.endpoint + config.universe_domain = @workflows_service_stub.universe_domain + end end ## diff --git a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/client.rb b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/client.rb index ca39a2714f82..5f185b8d8d08 100644 --- a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/client.rb +++ b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/client.rb @@ -152,20 +152,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @workflows_service_stub = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflows_service_stub.endpoint + config.universe_domain = @workflows_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/service_stub.rb b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/service_stub.rb index 82a38b3e31be..ffa1d75f8778 100644 --- a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/service_stub.rb +++ b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the run_pipeline REST call # diff --git a/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_operations_test.rb b/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_operations_test.rb index ad459ccb5432..e6d3220075b5 100644 --- a/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_operations_test.rb +++ b/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_rest_test.rb b/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_rest_test.rb index 0ca4ad77e897..d1b83ca39015 100644 --- a/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_rest_test.rb +++ b/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_run_pipeline @@ -123,7 +131,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_test.rb b/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_test.rb index 3483cf485e74..8ab402eb2a6d 100644 --- a/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_test.rb +++ b/google-cloud-life_sciences-v2beta/test/google/cloud/life_sciences/v2beta/workflows_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_run_pipeline @@ -120,7 +128,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new do |config| config.credentials = grpc_channel end @@ -138,7 +147,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_operations_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_operations_test.rb index 97bbce9522ab..3e78bfa9aaa4 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_operations_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Logging::V2::ConfigService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_paths_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_paths_test.rb index ae9e68aa7bf6..dda0621e39a8 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_paths_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/logging/v2/config_service" class ::Google::Cloud::Logging::V2::ConfigService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_billing_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_billing_account_path def test_billing_account_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_billing_account_location_path def test_cmek_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -70,7 +80,7 @@ def test_cmek_settings_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -82,7 +92,7 @@ def test_folder_path def test_folder_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -94,7 +104,7 @@ def test_folder_location_path def test_link_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -115,7 +125,7 @@ def test_link_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -127,7 +137,7 @@ def test_location_path def test_log_bucket_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -148,7 +158,7 @@ def test_log_bucket_path def test_log_exclusion_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -169,7 +179,7 @@ def test_log_exclusion_path def test_log_sink_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -190,7 +200,7 @@ def test_log_sink_path def test_log_view_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -211,7 +221,7 @@ def test_log_view_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -223,7 +233,7 @@ def test_organization_path def test_organization_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -235,7 +245,7 @@ def test_organization_location_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -247,7 +257,7 @@ def test_project_path def test_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_test.rb index 89ff75b294a8..c039e638b76c 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/config_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_buckets @@ -2033,7 +2041,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -2051,7 +2060,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_paths_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_paths_test.rb index 58dedf4a75ab..de0a32d14f82 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_paths_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/logging/v2/logging_service" class ::Google::Cloud::Logging::V2::LoggingService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_billing_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_billing_account_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_folder_path def test_log_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = grpc_channel end @@ -70,7 +80,7 @@ def test_log_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = grpc_channel end @@ -82,7 +92,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_test.rb index eb4d7dbbe3fc..e540eb66f027 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/logging_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_delete_log @@ -469,7 +477,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_paths_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_paths_test.rb index 47d253968c16..6bce43791e44 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_paths_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/logging/v2/metrics_service" class ::Google::Cloud::Logging::V2::MetricsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_log_metric_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_log_metric_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_test.rb b/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_test.rb index ea8a8c8f6877..0c475e67f414 100644 --- a/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_test.rb +++ b/google-cloud-logging-v2/test/google/cloud/logging/v2/metrics_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_log_metrics @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Logging::V2::MetricsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_operations_test.rb b/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_operations_test.rb index 9b2e110bcbc3..72981d992da5 100644 --- a/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_operations_test.rb +++ b/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_paths_test.rb b/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_paths_test.rb index 5d213b5cca84..76c796f11c6d 100644 --- a/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_paths_test.rb +++ b/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/managed_identities/v1/managed_identities_service" class ::Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_domain_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_domain_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_test.rb b/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_test.rb index 3ee2d57ff121..577a713c637c 100644 --- a/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_test.rb +++ b/google-cloud-managed_identities-v1/test/google/cloud/managed_identities/v1/managed_identities_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_microsoft_ad_domain @@ -695,7 +703,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new do |config| config.credentials = grpc_channel end @@ -713,7 +722,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-media_translation-v1beta1/test/google/cloud/media_translation/v1beta1/speech_translation_service_test.rb b/google-cloud-media_translation-v1beta1/test/google/cloud/media_translation/v1beta1/speech_translation_service_test.rb index 1bdbbf991f36..e4ba88fa2745 100644 --- a/google-cloud-media_translation-v1beta1/test/google/cloud/media_translation/v1beta1/speech_translation_service_test.rb +++ b/google-cloud-media_translation-v1beta1/test/google/cloud/media_translation/v1beta1/speech_translation_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_streaming_translate_speech @@ -140,7 +148,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb index 616b89f7501e..2b8b991478f0 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb @@ -184,13 +184,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_memcache_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Memcache::V1::CloudMemcache::Stub, credentials: credentials, @@ -201,6 +194,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_memcache_stub.endpoint + config.universe_domain = @cloud_memcache_stub.universe_domain + end end ## diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/client.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/client.rb index 28eda0a34d2d..9f2c093d6cbb 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/client.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/client.rb @@ -181,20 +181,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_memcache_stub = ::Google::Cloud::Memcache::V1::CloudMemcache::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_memcache_stub.endpoint + config.universe_domain = @cloud_memcache_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/service_stub.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/service_stub.rb index 19732c2e859a..e1b60459a4f5 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/service_stub.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_operations_test.rb b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_operations_test.rb index 1ddc33aef43f..43796a81dbbf 100644 --- a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_operations_test.rb +++ b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1::CloudMemcache::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_paths_test.rb b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_paths_test.rb index a08fc581a8c5..3efeddfaaf97 100644 --- a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_paths_test.rb +++ b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/memcache/v1/cloud_memcache" class ::Google::Cloud::Memcache::V1::CloudMemcache::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Memcache::V1::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Memcache::V1::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_rest_test.rb b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_rest_test.rb index 21cb4f486e8b..9ce080bcaeb9 100644 --- a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_rest_test.rb +++ b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -511,7 +519,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1::CloudMemcache::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb index fd5e7217fc22..98ac6f311a7f 100644 --- a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb +++ b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -576,7 +584,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end @@ -594,7 +603,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb index e3f91ec4309f..0b2764c93d3a 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb @@ -186,13 +186,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_memcache_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Stub, credentials: credentials, @@ -203,6 +196,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_memcache_stub.endpoint + config.universe_domain = @cloud_memcache_stub.universe_domain + end end ## diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb index 519271ac5ed3..c04007a46e65 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb @@ -183,20 +183,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_memcache_stub = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_memcache_stub.endpoint + config.universe_domain = @cloud_memcache_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/service_stub.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/service_stub.rb index b53aaf119145..bd5a44ff9416 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/service_stub.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_operations_test.rb b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_operations_test.rb index 5b9d5a6acbc8..418b151e8ece 100644 --- a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_operations_test.rb +++ b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_paths_test.rb b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_paths_test.rb index c4e2c523999a..51327aec228d 100644 --- a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_paths_test.rb +++ b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/memcache/v1beta2/cloud_memcache" class ::Google::Cloud::Memcache::V1beta2::CloudMemcache::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_rest_test.rb b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_rest_test.rb index 0fb949e36f2b..08cc3cb88bb8 100644 --- a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_rest_test.rb +++ b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -567,7 +575,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb index a2eb8d184629..1aef509f930a 100644 --- a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb +++ b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -643,7 +651,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end @@ -661,7 +670,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/client.rb b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/client.rb index 113b0a4d7c02..5a98b201294b 100644 --- a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/client.rb +++ b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/client.rb @@ -194,20 +194,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dataproc_metastore_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Metastore::V1::DataprocMetastore::Stub, credentials: credentials, @@ -218,6 +204,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain + end end ## diff --git a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/client.rb b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/client.rb index b2e867a8ed4f..6da581ac7176 100644 --- a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/client.rb +++ b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/client.rb @@ -191,28 +191,28 @@ def initialize config.universe_domain = @config.universe_domain end + @dataproc_metastore_stub = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain config.bindings_override = @config.bindings_override end - - @dataproc_metastore_stub = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/service_stub.rb b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/service_stub.rb index 933a63c8012c..b038731e36a5 100644 --- a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/service_stub.rb +++ b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_services REST call # diff --git a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/client.rb b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/client.rb index 723837884860..b33e5fb9c2e4 100644 --- a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/client.rb +++ b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/client.rb @@ -167,20 +167,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dataproc_metastore_federation_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Stub, credentials: credentials, @@ -191,6 +177,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain + end end ## diff --git a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/client.rb b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/client.rb index cdeb5a0a458d..fb5bd7a44c87 100644 --- a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/client.rb +++ b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/client.rb @@ -164,28 +164,28 @@ def initialize config.universe_domain = @config.universe_domain end + @dataproc_metastore_federation_stub = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain config.bindings_override = @config.bindings_override end - - @dataproc_metastore_federation_stub = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/service_stub.rb b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/service_stub.rb index a63a1cbdd4ae..e98333a6db9d 100644 --- a/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/service_stub.rb +++ b/google-cloud-metastore-v1/lib/google/cloud/metastore/v1/dataproc_metastore_federation/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_federations REST call # diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_operations_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_operations_test.rb index 14bcf90e7242..8444d4e02297 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_operations_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_paths_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_paths_test.rb index 2d2e941860b6..01a2e3763b94 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_paths_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/metastore/v1/dataproc_metastore_federation" class ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_federation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_federation_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_rest_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_rest_test.rb index ae8b3a8dd62d..45ae5ccf0a34 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_rest_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_federations @@ -346,7 +354,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_test.rb index a69d0e4e62a7..09e8396c6888 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_federation_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_federations @@ -381,7 +389,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end @@ -399,7 +408,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_operations_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_operations_test.rb index 945c0fb3ede8..64874417a5aa 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_operations_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_paths_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_paths_test.rb index d1c1ff8a99df..233ecabe3105 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_paths_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/metastore/v1/dataproc_metastore" class ::Google::Cloud::Metastore::V1::DataprocMetastore::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_metadata_import_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_metadata_import_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_network_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_service_path def test_subnetwork_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_rest_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_rest_test.rb index 065e8a09b9de..54631937bb71 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_rest_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -1077,7 +1085,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_test.rb b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_test.rb index 655bf19524dd..7f3210e6a6db 100644 --- a/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_test.rb +++ b/google-cloud-metastore-v1/test/google/cloud/metastore/v1/dataproc_metastore_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -1249,7 +1257,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -1267,7 +1276,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/client.rb b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/client.rb index 816e81917131..412cbff616df 100644 --- a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/client.rb +++ b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/client.rb @@ -194,20 +194,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dataproc_metastore_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Stub, credentials: credentials, @@ -218,6 +204,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain + end end ## diff --git a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/client.rb b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/client.rb index a9d6dbac9f7d..3c146d0882c1 100644 --- a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/client.rb +++ b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/client.rb @@ -191,28 +191,28 @@ def initialize config.universe_domain = @config.universe_domain end + @dataproc_metastore_stub = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_stub.endpoint + config.universe_domain = @dataproc_metastore_stub.universe_domain config.bindings_override = @config.bindings_override end - - @dataproc_metastore_stub = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/service_stub.rb b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/service_stub.rb index 6d737e3b4631..1f6aaee306d0 100644 --- a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/service_stub.rb +++ b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_services REST call # diff --git a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/client.rb b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/client.rb index da6bdd162901..23e6604d7a4d 100644 --- a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/client.rb +++ b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/client.rb @@ -167,20 +167,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @dataproc_metastore_federation_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Stub, credentials: credentials, @@ -191,6 +177,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain + end end ## diff --git a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/client.rb b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/client.rb index b07d2c52259f..f5c4fb9dd944 100644 --- a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/client.rb +++ b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/client.rb @@ -164,28 +164,28 @@ def initialize config.universe_domain = @config.universe_domain end + @dataproc_metastore_federation_stub = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @dataproc_metastore_federation_stub.endpoint + config.universe_domain = @dataproc_metastore_federation_stub.universe_domain config.bindings_override = @config.bindings_override end - - @dataproc_metastore_federation_stub = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/service_stub.rb b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/service_stub.rb index 1499475efcc5..8da92e823d58 100644 --- a/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/service_stub.rb +++ b/google-cloud-metastore-v1beta/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_federations REST call # diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_operations_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_operations_test.rb index f737f251329e..fb50ca187f8f 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_operations_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_paths_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_paths_test.rb index 4746f0272e1e..6821e88a976a 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_paths_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/metastore/v1beta/dataproc_metastore_federation" class ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_federation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_federation_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_rest_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_rest_test.rb index 3752c283e975..721d8f7360f2 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_rest_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_federations @@ -346,7 +354,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_test.rb index 3d0eec3d691e..f5a49f14e649 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_federation_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_federations @@ -381,7 +389,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end @@ -399,7 +408,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_operations_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_operations_test.rb index ef59c3f00a72..5a40e3385a94 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_operations_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_paths_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_paths_test.rb index 0079a18bb418..7ca82e29eaea 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_paths_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/metastore/v1beta/dataproc_metastore" class ::Google::Cloud::Metastore::V1beta::DataprocMetastore::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_lake_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_lake_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_metadata_import_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_metadata_import_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_network_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_service_path def test_subnetwork_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_rest_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_rest_test.rb index 7658f99cb720..a003f36b0fe0 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_rest_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -1132,7 +1140,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_test.rb b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_test.rb index 65d60314d94d..96d2e7542b62 100644 --- a/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_test.rb +++ b/google-cloud-metastore-v1beta/test/google/cloud/metastore/v1beta/dataproc_metastore_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -1309,7 +1317,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end @@ -1327,7 +1336,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/client.rb b/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/client.rb index 6fc2142226f6..12f0773858f9 100644 --- a/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/client.rb +++ b/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/client.rb @@ -158,13 +158,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @migration_center_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Stub, credentials: credentials, @@ -175,6 +168,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @migration_center_stub.endpoint + config.universe_domain = @migration_center_stub.universe_domain + end end ## diff --git a/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/client.rb b/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/client.rb index 4a5d27d0aad5..a05f06ec2f6a 100644 --- a/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/client.rb +++ b/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/client.rb @@ -155,20 +155,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @migration_center_stub = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @migration_center_stub.endpoint + config.universe_domain = @migration_center_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/service_stub.rb b/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/service_stub.rb index 049980bdb84a..1d001abc6d9d 100644 --- a/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/service_stub.rb +++ b/google-cloud-migration_center-v1/lib/google/cloud/migration_center/v1/migration_center/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_assets REST call # diff --git a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_operations_test.rb b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_operations_test.rb index 20b44bd22eac..573156a5317b 100644 --- a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_operations_test.rb +++ b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_paths_test.rb b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_paths_test.rb index ff12b7343615..8541332c4577 100644 --- a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_paths_test.rb +++ b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/migration_center/v1/migration_center" class ::Google::Cloud::MigrationCenter::V1::MigrationCenter::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_asset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_asset_path def test_error_frame_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_error_frame_path def test_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_group_path def test_import_data_file_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_import_data_file_path def test_import_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_import_job_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_preference_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_preference_set_path def test_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_report_path def test_report_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_report_config_path def test_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_settings_path def test_source_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_rest_test.rb b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_rest_test.rb index 2050391ce9a9..53ad0ae50cb5 100644 --- a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_rest_test.rb +++ b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_assets @@ -2757,7 +2765,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_test.rb b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_test.rb index 5ef40f39e0ef..22e5003b2e14 100644 --- a/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_test.rb +++ b/google-cloud-migration_center-v1/test/google/cloud/migration_center/v1/migration_center_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_assets @@ -3193,7 +3201,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end @@ -3211,7 +3220,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::MigrationCenter::V1::MigrationCenter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest/service_stub.rb b/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest/service_stub.rb index 0513cb4db76d..938bcc01cc72 100644 --- a/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest/service_stub.rb +++ b/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/dashboards_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_dashboard REST call # diff --git a/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_paths_test.rb b/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_paths_test.rb index 042cc5adf4c5..97943f27a9a7 100644 --- a/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_paths_test.rb +++ b/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/dashboard/v1/dashboards_service" class ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_alert_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_alert_policy_path def test_dashboard_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_dashboard_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_rest_test.rb b/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_rest_test.rb index a07c88a20937..088471a3287d 100644 --- a/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_rest_test.rb +++ b/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dashboard @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_test.rb b/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_test.rb index 6c64abdd9312..70617ad6c69e 100644 --- a/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_test.rb +++ b/google-cloud-monitoring-dashboard-v1/test/google/cloud/monitoring/dashboard/v1/dashboards_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_dashboard @@ -356,7 +364,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_operations_test.rb b/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_operations_test.rb index 3d319b539be4..d2f36e2b87b6 100644 --- a/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_operations_test.rb +++ b/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_paths_test.rb b/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_paths_test.rb index f09d75f9cbe1..a9ad70eaef02 100644 --- a/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_paths_test.rb +++ b/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/metrics_scope/v1/metrics_scopes" class ::Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_metrics_scope_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_metrics_scope_path def test_monitored_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_test.rb b/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_test.rb index 96a5d6bd8bec..54827faaa019 100644 --- a/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_test.rb +++ b/google-cloud-monitoring-metrics_scope-v1/test/google/cloud/monitoring/metrics_scope/v1/metrics_scopes_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_metrics_scope @@ -295,7 +303,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new do |config| config.credentials = grpc_channel end @@ -313,7 +322,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_paths_test.rb index be93e514de62..524710a7fb07 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/alert_policy_service" class ::Google::Cloud::Monitoring::V3::AlertPolicyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_alert_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_alert_policy_path def test_alert_policy_condition_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_alert_policy_condition_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_project_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_test.rb index cb24d78e869d..5e61438594d4 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/alert_policy_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_alert_policies @@ -358,7 +366,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_paths_test.rb index 2564ff3344f6..bc3e9f8f3e00 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/group_service" class ::Google::Cloud::Monitoring::V3::GroupService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::GroupService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_folder_path def test_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::GroupService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_group_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::GroupService::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::GroupService::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_project_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::GroupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_test.rb index c877997e0965..620a362645d8 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/group_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_groups @@ -432,7 +440,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::GroupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_paths_test.rb index 9141890b76db..07d623919228 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/metric_service" class ::Google::Cloud::Monitoring::V3::MetricService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_folder_path def test_metric_descriptor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_metric_descriptor_path def test_monitored_resource_descriptor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_monitored_resource_descriptor_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_project_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_test.rb index 3bc99698aecb..601cfb53f2b3 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/metric_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_monitored_resource_descriptors @@ -622,7 +630,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_paths_test.rb index 7ae7c0bbc089..afa9229ab5f9 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/notification_channel_service" class ::Google::Cloud::Monitoring::V3::NotificationChannelService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_folder_path def test_notification_channel_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_notification_channel_path def test_notification_channel_descriptor_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_notification_channel_descriptor_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_project_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_test.rb index ac66d2a4bbe9..1dd4e1f580c8 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/notification_channel_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_notification_channel_descriptors @@ -663,7 +671,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/query_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/query_service_test.rb index c39cf106012d..b44f4d1be4c0 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/query_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/query_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_query_time_series @@ -120,7 +128,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_paths_test.rb index 8ace51d4d6e5..be14644f036b 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/service_monitoring_service" class ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_project_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_service_path def test_service_level_objective_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_service_level_objective_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_test.rb index 7254c8b190ef..9ab18033e200 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/service_monitoring_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_service @@ -669,7 +677,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_paths_test.rb index d4cd1de72907..652b3a58f0a0 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/snooze_service" class ::Google::Cloud::Monitoring::V3::SnoozeService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_alert_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::SnoozeService::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_alert_policy_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::SnoozeService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_project_path def test_snooze_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::SnoozeService::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_snooze_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::SnoozeService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_test.rb index a693ad850546..98a92b858563 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/snooze_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_snooze @@ -298,7 +306,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::SnoozeService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_paths_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_paths_test.rb index d22b930c2026..d7375f679949 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_paths_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/monitoring/v3/uptime_check_service" class ::Google::Cloud::Monitoring::V3::UptimeCheckService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_project_path def test_uptime_check_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_uptime_check_config_path def test_workspace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_test.rb b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_test.rb index fb784cc33108..744d51ba9d05 100644 --- a/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_test.rb +++ b/google-cloud-monitoring-v3/test/google/cloud/monitoring/v3/uptime_check_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_uptime_check_configs @@ -421,7 +429,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/client.rb b/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/client.rb index 1e3a6633de5e..d1acfed502e7 100644 --- a/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/client.rb +++ b/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/client.rb @@ -310,13 +310,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @net_app_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::NetApp::V1::NetApp::Stub, credentials: credentials, @@ -327,6 +320,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @net_app_stub.endpoint + config.universe_domain = @net_app_stub.universe_domain + end end ## diff --git a/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/client.rb b/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/client.rb index 1645888bde23..b80c03f41e92 100644 --- a/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/client.rb +++ b/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/client.rb @@ -307,20 +307,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @net_app_stub = ::Google::Cloud::NetApp::V1::NetApp::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @net_app_stub.endpoint + config.universe_domain = @net_app_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/service_stub.rb b/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/service_stub.rb index 3c179829ef53..07d352d81442 100644 --- a/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/service_stub.rb +++ b/google-cloud-netapp-v1/lib/google/cloud/netapp/v1/netapp/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_storage_pools REST call # diff --git a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_operations_test.rb b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_operations_test.rb index eb44965d9c37..a7ca5a68848c 100644 --- a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_operations_test.rb +++ b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetApp::V1::NetApp::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_paths_test.rb b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_paths_test.rb index 69510272c854..3b6bb44fd8c6 100644 --- a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_paths_test.rb +++ b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/netapp/v1/netapp" class ::Google::Cloud::NetApp::V1::NetApp::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_active_directory_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_active_directory_path def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_backup_path def test_backup_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_backup_policy_path def test_backup_vault_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_backup_vault_path def test_kms_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_kms_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_network_path def test_replication_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_replication_path def test_snapshot_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_snapshot_path def test_storage_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -145,7 +155,7 @@ def test_storage_pool_path def test_volume_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_rest_test.rb b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_rest_test.rb index e88a987c3485..4455a344afcb 100644 --- a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_rest_test.rb +++ b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_storage_pools @@ -2886,7 +2894,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::NetApp::V1::NetApp::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_test.rb b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_test.rb index f7f67e9a33ca..9db782e92a44 100644 --- a/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_test.rb +++ b/google-cloud-netapp-v1/test/google/cloud/netapp/v1/netapp_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_storage_pools @@ -3346,7 +3354,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end @@ -3364,7 +3373,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetApp::V1::NetApp::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb index 5dd0f0cb7a5c..6ff3739e9da5 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb @@ -174,20 +174,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @hub_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::NetworkConnectivity::V1::HubService::Stub, credentials: credentials, @@ -198,6 +184,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @hub_service_stub.endpoint + config.universe_domain = @hub_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @hub_service_stub.endpoint + config.universe_domain = @hub_service_stub.universe_domain + end end ## diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb index 28b0096242cc..7f185a3f4101 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb @@ -165,20 +165,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @policy_based_routing_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Stub, credentials: credentials, @@ -189,6 +175,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_based_routing_service_stub.endpoint + config.universe_domain = @policy_based_routing_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_based_routing_service_stub.endpoint + config.universe_domain = @policy_based_routing_service_stub.universe_domain + end end ## diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_operations_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_operations_test.rb index c984e158daf8..f4cc95cac1ee 100644 --- a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_operations_test.rb +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_paths_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_paths_test.rb index ed4f7a35401e..ffa93a035f20 100644 --- a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_paths_test.rb +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/network_connectivity/v1/hub_service" class ::Google::Cloud::NetworkConnectivity::V1::HubService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_group_path def test_hub_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_hub_path def test_hub_route_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_hub_route_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_instance_path def test_interconnect_attachment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_interconnect_attachment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_network_path def test_route_table_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_route_table_path def test_spoke_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_spoke_path def test_vpn_tunnel_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_test.rb index d559ea7f5997..053996c3e30f 100644 --- a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_test.rb +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/hub_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_hubs @@ -1309,7 +1317,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -1327,7 +1336,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1::HubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb index 045c785c607d..e2ef540f0e5b 100644 --- a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb index aca78761cc37..9ee260026da2 100644 --- a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/network_connectivity/v1/policy_based_routing_service" class ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_network_path def test_policy_based_route_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb index 1a6194bdcce3..e486a60a4d9f 100644 --- a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_policy_based_routes @@ -314,7 +322,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| config.credentials = grpc_channel end @@ -332,7 +341,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_operations_test.rb b/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_operations_test.rb index 2d1f7ef80833..c504b7c29585 100644 --- a/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_operations_test.rb +++ b/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_paths_test.rb b/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_paths_test.rb index ad235ace7c8d..f34b946399c1 100644 --- a/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_paths_test.rb +++ b/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/network_connectivity/v1alpha1/hub_service" class ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_hub_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_hub_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_path def test_interconnect_attachment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_interconnect_attachment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_spoke_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_spoke_path def test_vpn_tunnel_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_test.rb b/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_test.rb index 702097388f69..84c49be43f06 100644 --- a/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_test.rb +++ b/google-cloud-network_connectivity-v1alpha1/test/google/cloud/network_connectivity/v1alpha1/hub_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_hubs @@ -711,7 +719,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end @@ -729,7 +738,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_management-v1/lib/google/cloud/network_management/v1/reachability_service/rest/service_stub.rb b/google-cloud-network_management-v1/lib/google/cloud/network_management/v1/reachability_service/rest/service_stub.rb index 2684ed8040ec..4b6822a37b1f 100644 --- a/google-cloud-network_management-v1/lib/google/cloud/network_management/v1/reachability_service/rest/service_stub.rb +++ b/google-cloud-network_management-v1/lib/google/cloud/network_management/v1/reachability_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_connectivity_tests REST call # diff --git a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_operations_test.rb b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_operations_test.rb index bb4827e0edc5..305209e8bd2c 100644 --- a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_operations_test.rb +++ b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkManagement::V1::ReachabilityService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_paths_test.rb b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_paths_test.rb index 877403cbbac9..0688a75c8670 100644 --- a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_paths_test.rb +++ b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/network_management/v1/reachability_service" class ::Google::Cloud::NetworkManagement::V1::ReachabilityService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connectivity_test_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_rest_test.rb b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_rest_test.rb index f6cb7401e390..7492cc78afd9 100644 --- a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_rest_test.rb +++ b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connectivity_tests @@ -397,7 +405,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkManagement::V1::ReachabilityService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_test.rb b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_test.rb index 2d427bec14b0..3fc668064aa5 100644 --- a/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_test.rb +++ b/google-cloud-network_management-v1/test/google/cloud/network_management/v1/reachability_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_connectivity_tests @@ -438,7 +446,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new do |config| config.credentials = grpc_channel end @@ -456,7 +465,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/client.rb b/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/client.rb index f11acef0ac4b..86e2f23307eb 100644 --- a/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/client.rb +++ b/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/client.rb @@ -159,20 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @network_security_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Stub, credentials: credentials, @@ -183,6 +169,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @network_security_stub.endpoint + config.universe_domain = @network_security_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @network_security_stub.endpoint + config.universe_domain = @network_security_stub.universe_domain + end end ## diff --git a/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/client.rb b/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/client.rb index 20ee5dc0c52c..376569228029 100644 --- a/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/client.rb +++ b/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/client.rb @@ -156,28 +156,28 @@ def initialize config.universe_domain = @config.universe_domain end + @network_security_stub = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @network_security_stub.endpoint + config.universe_domain = @network_security_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @network_security_stub.endpoint + config.universe_domain = @network_security_stub.universe_domain config.bindings_override = @config.bindings_override end - - @network_security_stub = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/service_stub.rb b/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/service_stub.rb index b01c52a545b4..cc4abf24247a 100644 --- a/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/service_stub.rb +++ b/google-cloud-network_security-v1beta1/lib/google/cloud/network_security/v1beta1/network_security/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_authorization_policies REST call # diff --git a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_operations_test.rb b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_operations_test.rb index a8bc51dc0f94..96a49de3f87c 100644 --- a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_operations_test.rb +++ b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_paths_test.rb b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_paths_test.rb index 08c428d64776..d2be8d748f6e 100644 --- a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_paths_test.rb +++ b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/network_security/v1beta1/network_security" class ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_authorization_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_authorization_policy_path def test_client_tls_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_client_tls_policy_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_server_tls_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_rest_test.rb b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_rest_test.rb index 5a9b19dbc6ab..2c568ea41445 100644 --- a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_rest_test.rb +++ b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_authorization_policies @@ -891,7 +899,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_test.rb b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_test.rb index 956bdf71d663..273304984218 100644 --- a/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_test.rb +++ b/google-cloud-network_security-v1beta1/test/google/cloud/network_security/v1beta1/network_security_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_authorization_policies @@ -1011,7 +1019,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config| config.credentials = grpc_channel end @@ -1029,7 +1038,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb index 9c56cf34d755..6a5556b4fa9f 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb @@ -180,20 +180,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @managed_notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Stub, credentials: credentials, @@ -204,6 +190,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @managed_notebook_service_stub.endpoint + config.universe_domain = @managed_notebook_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @managed_notebook_service_stub.endpoint + config.universe_domain = @managed_notebook_service_stub.universe_domain + end end ## diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/client.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/client.rb index 7adfb56adccc..86b8d9ca7a28 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/client.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/client.rb @@ -177,28 +177,28 @@ def initialize config.universe_domain = @config.universe_domain end + @managed_notebook_service_stub = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @managed_notebook_service_stub.endpoint + config.universe_domain = @managed_notebook_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @managed_notebook_service_stub.endpoint + config.universe_domain = @managed_notebook_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @managed_notebook_service_stub = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/service_stub.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/service_stub.rb index 7ca0e69911fa..4f0c4807f5f4 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/service_stub.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_runtimes REST call # diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb index 005bf8056026..f2458a99ce13 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb @@ -224,20 +224,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V1::NotebookService::Stub, credentials: credentials, @@ -248,6 +234,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + end end ## diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb index 0b699116f912..bcc9ec9034fd 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/client.rb @@ -221,28 +221,28 @@ def initialize config.universe_domain = @config.universe_domain end + @notebook_service_stub = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @notebook_service_stub = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/service_stub.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/service_stub.rb index d5e642523347..651ff3b94f04 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/service_stub.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_operations_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_operations_test.rb index 65478ffcd948..2ec0ff43fb73 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_operations_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb index 61e59daa0798..51c09c618f71 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/notebooks/v1/managed_notebook_service" class ::Google::Cloud::Notebooks::V1::ManagedNotebookService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_runtime_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_rest_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_rest_test.rb index a68984057c30..0d42429d7314 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_rest_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_runtimes @@ -787,7 +795,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb index be3b2ef30ea6..a78c39a608a9 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_runtimes @@ -898,7 +906,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -916,7 +925,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_operations_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_operations_test.rb index 7017ff84a8d9..9558ba936677 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_operations_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::NotebookService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_paths_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_paths_test.rb index f6fe742ebfc6..0c692d187e4c 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_paths_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/notebooks/v1/notebook_service" class ::Google::Cloud::Notebooks::V1::NotebookService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_environment_path def test_execution_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_execution_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_instance_path def test_schedule_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_schedule_path def test_tensorboard_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_rest_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_rest_test.rb index 9ebed31ac987..ab31deae1d94 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_rest_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -1938,7 +1946,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::NotebookService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb index 07ffea48fbdd..1b72436f9cab 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -2230,7 +2238,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -2248,7 +2257,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb index 60fd0196e3a7..bca186583c17 100644 --- a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb +++ b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb @@ -198,20 +198,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V1beta1::NotebookService::Stub, credentials: credentials, @@ -222,6 +208,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + end end ## diff --git a/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_operations_test.rb b/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_operations_test.rb index 79fe099b5cd4..cd17a00c013c 100644 --- a/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_operations_test.rb +++ b/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_paths_test.rb b/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_paths_test.rb index da4d2cfa512b..32a65a3c3c7e 100644 --- a/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_paths_test.rb +++ b/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/notebooks/v1beta1/notebook_service" class ::Google::Cloud::Notebooks::V1beta1::NotebookService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_environment_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_test.rb b/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_test.rb index 47133fd316e1..eb33805ab2aa 100644 --- a/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_test.rb +++ b/google-cloud-notebooks-v1beta1/test/google/cloud/notebooks/v1beta1/notebook_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -1265,7 +1273,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -1283,7 +1292,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/client.rb b/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/client.rb index c586fd3613fc..6e06480bd1ce 100644 --- a/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/client.rb +++ b/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/client.rb @@ -178,20 +178,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V2::NotebookService::Stub, credentials: credentials, @@ -202,6 +188,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain + end end ## diff --git a/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb b/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb index 901a5d1b85a0..588a51b2fb51 100644 --- a/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb +++ b/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/client.rb @@ -175,28 +175,28 @@ def initialize config.universe_domain = @config.universe_domain end + @notebook_service_stub = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @notebook_service_stub.endpoint + config.universe_domain = @notebook_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @notebook_service_stub = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/service_stub.rb b/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/service_stub.rb index 0e3f49001217..1c77e198bfe2 100644 --- a/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/service_stub.rb +++ b/google-cloud-notebooks-v2/lib/google/cloud/notebooks/v2/notebook_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_operations_test.rb b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_operations_test.rb index 2cfdeaba7588..52bc2f265c86 100644 --- a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_operations_test.rb +++ b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V2::NotebookService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_paths_test.rb b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_paths_test.rb index 85c0da27432b..24c947599d9c 100644 --- a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_paths_test.rb +++ b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/notebooks/v2/notebook_service" class ::Google::Cloud::Notebooks::V2::NotebookService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_rest_test.rb b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_rest_test.rb index 2b4516820bb9..693b41416153 100644 --- a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_rest_test.rb +++ b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -728,7 +736,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V2::NotebookService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_test.rb b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_test.rb index e1bad3f0eb14..0753a79c40fd 100644 --- a/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_test.rb +++ b/google-cloud-notebooks-v2/test/google/cloud/notebooks/v2/notebook_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -825,7 +833,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new do |config| config.credentials = grpc_channel end @@ -843,7 +852,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Notebooks::V2::NotebookService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-optimization-v1/lib/google/cloud/optimization/v1/fleet_routing/rest/service_stub.rb b/google-cloud-optimization-v1/lib/google/cloud/optimization/v1/fleet_routing/rest/service_stub.rb index 5ce66e7f24f3..a6e8c9128d81 100644 --- a/google-cloud-optimization-v1/lib/google/cloud/optimization/v1/fleet_routing/rest/service_stub.rb +++ b/google-cloud-optimization-v1/lib/google/cloud/optimization/v1/fleet_routing/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the optimize_tours REST call # diff --git a/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_operations_test.rb b/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_operations_test.rb index bc5c39862a38..4179ae464793 100644 --- a/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_operations_test.rb +++ b/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Optimization::V1::FleetRouting::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_rest_test.rb b/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_rest_test.rb index 8460c02b5465..754423039074 100644 --- a/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_rest_test.rb +++ b/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_optimize_tours @@ -192,7 +200,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Optimization::V1::FleetRouting::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_test.rb b/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_test.rb index e611dced66c8..ff723e42807b 100644 --- a/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_test.rb +++ b/google-cloud-optimization-v1/test/google/cloud/optimization/v1/fleet_routing_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_optimize_tours @@ -210,7 +218,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Optimization::V1::FleetRouting::Client.new do |config| config.credentials = grpc_channel end @@ -228,7 +237,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Optimization::V1::FleetRouting::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/service_stub.rb b/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/service_stub.rb index 5cd51ef41ed3..4b7811648228 100644 --- a/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/service_stub.rb +++ b/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/service_stub.rb @@ -54,6 +54,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_environment REST call # diff --git a/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/image_versions/rest/service_stub.rb b/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/image_versions/rest/service_stub.rb index ceb11b27549a..2cf11d0e343f 100644 --- a/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/image_versions/rest/service_stub.rb +++ b/google-cloud-orchestration-airflow-service-v1/lib/google/cloud/orchestration/airflow/service/v1/image_versions/rest/service_stub.rb @@ -54,6 +54,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_image_versions REST call # diff --git a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_operations_test.rb b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_operations_test.rb index 3568379c6356..5036e9811780 100644 --- a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_operations_test.rb +++ b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_paths_test.rb b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_paths_test.rb index 0ca092380a62..6b902103c8fe 100644 --- a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_paths_test.rb +++ b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/orchestration/airflow/service/v1/environments" class ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_rest_test.rb b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_rest_test.rb index 3710787a6ac5..263b27078de0 100644 --- a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_rest_test.rb +++ b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_environment @@ -736,7 +744,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_test.rb b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_test.rb index 41acfe88b692..6f8f1ef3226a 100644 --- a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_test.rb +++ b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/environments_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_environment @@ -826,7 +834,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new do |config| config.credentials = grpc_channel end @@ -844,7 +853,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_rest_test.rb b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_rest_test.rb index 595402b9dfd3..2e8ea674236f 100644 --- a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_rest_test.rb +++ b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_image_versions @@ -123,7 +131,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_test.rb b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_test.rb index 5a4229cffd62..da5cb819c138 100644 --- a/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_test.rb +++ b/google-cloud-orchestration-airflow-service-v1/test/google/cloud/orchestration/airflow/service/v1/image_versions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_image_versions @@ -120,7 +128,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-org_policy-v2/lib/google/cloud/org_policy/v2/org_policy/rest/service_stub.rb b/google-cloud-org_policy-v2/lib/google/cloud/org_policy/v2/org_policy/rest/service_stub.rb index 3245d51d26e4..2a4262713f83 100644 --- a/google-cloud-org_policy-v2/lib/google/cloud/org_policy/v2/org_policy/rest/service_stub.rb +++ b/google-cloud-org_policy-v2/lib/google/cloud/org_policy/v2/org_policy/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_constraints REST call # diff --git a/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_paths_test.rb b/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_paths_test.rb index 88f2ec277ff0..583b969e1a89 100644 --- a/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_paths_test.rb +++ b/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/org_policy/v2/org_policy" class ::Google::Cloud::OrgPolicy::V2::OrgPolicy::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_custom_constraint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_custom_constraint_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_folder_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_organization_path def test_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_policy_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_rest_test.rb b/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_rest_test.rb index 4b5bd7db2d4e..bae6f812a86a 100644 --- a/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_rest_test.rb +++ b/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_constraints @@ -724,7 +732,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_test.rb b/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_test.rb index 7ec2d08ccb81..d555c4ab81f9 100644 --- a/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_test.rb +++ b/google-cloud-org_policy-v2/test/google/cloud/org_policy/v2/org_policy_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_constraints @@ -782,7 +790,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb b/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb index 1aef9f58aac6..feb8cb8b9336 100644 --- a/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb +++ b/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the execute_patch_job REST call # diff --git a/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb b/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb index 322b9e0e7657..9f51cc0865f3 100644 --- a/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb +++ b/google-cloud-os_config-v1/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_os_policy_assignment REST call # diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_paths_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_paths_test.rb index bd3d4a3b2661..c7e52cbf737b 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_paths_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/os_config/v1/os_config_service" class ::Google::Cloud::OsConfig::V1::OsConfigService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_patch_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_patch_deployment_path def test_patch_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_patch_job_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_rest_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_rest_test.rb index 416cca1364df..3413c5af3b93 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_rest_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_execute_patch_job @@ -732,7 +740,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1::OsConfigService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_test.rb index 094005782311..dda871f9f457 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_execute_patch_job @@ -798,7 +806,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_operations_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_operations_test.rb index 165dcb50f14d..570f30925622 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_operations_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_paths_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_paths_test.rb index bd9db711d0a4..7f6312531e07 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_paths_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/os_config/v1/os_config_zonal_service" class ::Google::Cloud::OsConfig::V1::OsConfigZonalService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_instance_path def test_instance_os_policy_assignment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_instance_os_policy_assignment_path def test_inventory_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -64,7 +74,7 @@ def test_inventory_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -76,7 +86,7 @@ def test_location_path def test_os_policy_assignment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -88,7 +98,7 @@ def test_os_policy_assignment_path def test_os_policy_assignment_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -100,7 +110,7 @@ def test_os_policy_assignment_report_path def test_vulnerability_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_rest_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_rest_test.rb index 93149e51ec8d..4016b8e6785d 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_rest_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_os_policy_assignment @@ -732,7 +740,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_test.rb b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_test.rb index 9bc23fdf1e7e..961f0a541eab 100644 --- a/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_test.rb +++ b/google-cloud-os_config-v1/test/google/cloud/os_config/v1/os_config_zonal_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_os_policy_assignment @@ -823,7 +831,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -841,7 +850,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1alpha/lib/google/cloud/os_config/v1alpha/os_config_zonal_service/rest/service_stub.rb b/google-cloud-os_config-v1alpha/lib/google/cloud/os_config/v1alpha/os_config_zonal_service/rest/service_stub.rb index 7be29a293470..cee167d8871a 100644 --- a/google-cloud-os_config-v1alpha/lib/google/cloud/os_config/v1alpha/os_config_zonal_service/rest/service_stub.rb +++ b/google-cloud-os_config-v1alpha/lib/google/cloud/os_config/v1alpha/os_config_zonal_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_os_policy_assignment REST call # diff --git a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_operations_test.rb b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_operations_test.rb index b1bdd6492248..e3d624d269e8 100644 --- a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_operations_test.rb +++ b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_paths_test.rb b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_paths_test.rb index 14fa06626f02..9ee165d2aefd 100644 --- a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_paths_test.rb +++ b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/os_config/v1alpha/os_config_zonal_service" class ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_instance_os_policies_compliance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_os_policies_compliance_path def test_instance_os_policy_assignment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_instance_os_policy_assignment_path def test_inventory_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_inventory_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_os_policy_assignment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_os_policy_assignment_path def test_os_policy_assignment_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_os_policy_assignment_report_path def test_vulnerability_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_rest_test.rb b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_rest_test.rb index 285795ef630d..18858797e91f 100644 --- a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_rest_test.rb +++ b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_os_policy_assignment @@ -843,7 +851,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_test.rb b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_test.rb index 7eb197d5bee7..bc4131358a47 100644 --- a/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_test.rb +++ b/google-cloud-os_config-v1alpha/test/google/cloud/os_config/v1alpha/os_config_zonal_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_os_policy_assignment @@ -950,7 +958,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end @@ -968,7 +977,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/rest/service_stub.rb b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/rest/service_stub.rb index d5f6cf75bfc7..5f57685a65e2 100644 --- a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/rest/service_stub.rb +++ b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_ssh_public_key REST call # diff --git a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_paths_test.rb b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_paths_test.rb index 0ecfce7b086a..89081d7979e1 100644 --- a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_paths_test.rb +++ b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/os_login/v1/os_login_service" class ::Google::Cloud::OsLogin::V1::OsLoginService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_posix_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_posix_account_path def test_ssh_public_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_ssh_public_key_path def test_user_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_rest_test.rb b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_rest_test.rb index d2a2a1e4f2a0..493ca18283d7 100644 --- a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_rest_test.rb +++ b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_ssh_public_key @@ -452,7 +460,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::OsLogin::V1::OsLoginService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb index b48f24d9945f..1d44399019d6 100644 --- a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb +++ b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_ssh_public_key @@ -473,7 +481,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/rest/service_stub.rb b/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/rest/service_stub.rb index fe48f785c446..74a5076d538b 100644 --- a/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/rest/service_stub.rb +++ b/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_ssh_public_key REST call # diff --git a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_paths_test.rb b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_paths_test.rb index 88b3b6a6cd38..3a9da794d61d 100644 --- a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_paths_test.rb +++ b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/os_login/v1beta/os_login_service" class ::Google::Cloud::OsLogin::V1beta::OsLoginService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_posix_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_posix_account_path def test_ssh_public_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_ssh_public_key_path def test_user_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_rest_test.rb b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_rest_test.rb index 8ade8a9de2cb..3bcefd74cdfb 100644 --- a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_rest_test.rb +++ b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_ssh_public_key @@ -509,7 +517,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb index daf7c21a1fda..e83c162fe678 100644 --- a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb +++ b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_ssh_public_key @@ -537,7 +545,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-phishing_protection-v1beta1/lib/google/cloud/phishing_protection/v1beta1/phishing_protection_service/rest/service_stub.rb b/google-cloud-phishing_protection-v1beta1/lib/google/cloud/phishing_protection/v1beta1/phishing_protection_service/rest/service_stub.rb index 085131543f10..96f01d980492 100644 --- a/google-cloud-phishing_protection-v1beta1/lib/google/cloud/phishing_protection/v1beta1/phishing_protection_service/rest/service_stub.rb +++ b/google-cloud-phishing_protection-v1beta1/lib/google/cloud/phishing_protection/v1beta1/phishing_protection_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the report_phishing REST call # diff --git a/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_paths_test.rb b/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_paths_test.rb index feebea82a832..959aff58ccb1 100644 --- a/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_paths_test.rb +++ b/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/phishing_protection/v1beta1/phishing_protection_service" class ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_rest_test.rb b/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_rest_test.rb index 0417864d80d8..14dfae0b4630 100644 --- a/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_rest_test.rb +++ b/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_report_phishing @@ -121,7 +129,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_test.rb b/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_test.rb index d7b67bc01176..6b880ea34315 100644 --- a/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_test.rb +++ b/google-cloud-phishing_protection-v1beta1/test/google/cloud/phishing_protection/v1beta1/phishing_protection_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_report_phishing @@ -111,7 +119,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-policy_simulator-v1/lib/google/cloud/policy_simulator/v1/simulator/rest/service_stub.rb b/google-cloud-policy_simulator-v1/lib/google/cloud/policy_simulator/v1/simulator/rest/service_stub.rb index a7f253821a84..b00b5297b309 100644 --- a/google-cloud-policy_simulator-v1/lib/google/cloud/policy_simulator/v1/simulator/rest/service_stub.rb +++ b/google-cloud-policy_simulator-v1/lib/google/cloud/policy_simulator/v1/simulator/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_replay REST call # diff --git a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_operations_test.rb b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_operations_test.rb index 5aae978681f2..14ddd3783fcb 100644 --- a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_operations_test.rb +++ b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicySimulator::V1::Simulator::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_paths_test.rb b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_paths_test.rb index 6f5ed3834483..7ac8d4a7a4da 100644 --- a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_paths_test.rb +++ b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/policy_simulator/v1/simulator" class ::Google::Cloud::PolicySimulator::V1::Simulator::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_replay_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PolicySimulator::V1::Simulator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_rest_test.rb b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_rest_test.rb index 16d234748407..ce49bd6f4ddf 100644 --- a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_rest_test.rb +++ b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_replay @@ -231,7 +239,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicySimulator::V1::Simulator::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_test.rb b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_test.rb index a8eb4d5deba9..a54304c755fb 100644 --- a/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_test.rb +++ b/google-cloud-policy_simulator-v1/test/google/cloud/policy_simulator/v1/simulator_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_replay @@ -241,7 +249,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicySimulator::V1::Simulator::Client.new do |config| config.credentials = grpc_channel end @@ -259,7 +268,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicySimulator::V1::Simulator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-policy_troubleshooter-iam-v3/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/service_stub.rb b/google-cloud-policy_troubleshooter-iam-v3/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/service_stub.rb index f875cde19738..3fd4fe3cf8f0 100644 --- a/google-cloud-policy_troubleshooter-iam-v3/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/service_stub.rb +++ b/google-cloud-policy_troubleshooter-iam-v3/lib/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the troubleshoot_iam_policy REST call # diff --git a/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_rest_test.rb b/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_rest_test.rb index 4fc15f7cab5a..33f42be12f67 100644 --- a/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_rest_test.rb +++ b/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_troubleshoot_iam_policy @@ -120,7 +128,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_test.rb b/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_test.rb index 95787b10f665..302bbea718ea 100644 --- a/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_test.rb +++ b/google-cloud-policy_troubleshooter-iam-v3/test/google/cloud/policy_troubleshooter/iam/v3/policy_troubleshooter_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_troubleshoot_iam_policy @@ -109,7 +117,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb b/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb index 52a87d735a91..1b183e3aa3b5 100644 --- a/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb +++ b/google-cloud-policy_troubleshooter-v1/lib/google/cloud/policy_troubleshooter/v1/iam_checker/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the troubleshoot_iam_policy REST call # diff --git a/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb b/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb index c302e9b99030..dd95f043809a 100644 --- a/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb +++ b/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_troubleshoot_iam_policy @@ -120,7 +128,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb b/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb index 67a2ade97b83..64bc04df1521 100644 --- a/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb +++ b/google-cloud-policy_troubleshooter-v1/test/google/cloud/policy_troubleshooter/v1/iam_checker_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_troubleshoot_iam_policy @@ -109,7 +117,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb b/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb index 17ff6716057a..8b6709991920 100644 --- a/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb +++ b/google-cloud-private_catalog-v1beta1/lib/google/cloud/private_catalog/v1beta1/private_catalog/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search_catalogs REST call # diff --git a/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb b/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb index 1b1921fbf5f0..e91f95882b26 100644 --- a/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb +++ b/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_catalogs @@ -237,7 +245,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb b/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb index 48e95726e82e..2c731404027b 100644 --- a/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb +++ b/google-cloud-private_catalog-v1beta1/test/google/cloud/private_catalog/v1beta1/private_catalog_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search_catalogs @@ -258,7 +266,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb b/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb index ada620ccffb3..ff5b262acbb3 100644 --- a/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb +++ b/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_profiles REST call # diff --git a/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb b/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb index 654fec0a2f2c..3d483618b714 100644 --- a/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb +++ b/google-cloud-profiler-v2/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_profile REST call # diff --git a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb index d9a42a3074ae..c87f994ee458 100644 --- a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb +++ b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/profiler/v2/export_service" class ::Google::Cloud::Profiler::V2::ExportService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb index 5acb47ef3fb9..c9ea1fe2c668 100644 --- a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb +++ b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_profiles @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb index 3bf97625bbd0..c858b5ae4158 100644 --- a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb +++ b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/export_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_profiles @@ -118,7 +126,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Profiler::V2::ExportService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb index 561a3f1810ee..c6bcec2a83e6 100644 --- a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb +++ b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/profiler/v2/profiler_service" class ::Google::Cloud::Profiler::V2::ProfilerService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_profile_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb index 380ebb85ed06..7b6a98020bb3 100644 --- a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb +++ b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_profile @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb index e70132e3fda5..a9ed2e93036d 100644 --- a/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb +++ b/google-cloud-profiler-v2/test/google/cloud/profiler/v2/profiler_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_profile @@ -233,7 +241,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Profiler::V2::ProfilerService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb index e16ee0bf780e..7d6270b9fae6 100644 --- a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb +++ b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb @@ -193,13 +193,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @publisher_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::PubSub::V1::Publisher::Stub, credentials: credentials, @@ -210,6 +203,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @publisher_stub.endpoint + config.universe_domain = @publisher_stub.universe_domain + end end ## diff --git a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb index 2c33afc4436f..7bb2bbde8810 100644 --- a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb +++ b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb @@ -197,13 +197,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @schema_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::PubSub::V1::SchemaService::Stub, credentials: credentials, @@ -214,6 +207,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + end end ## diff --git a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb index d90e86bff3a3..f890e05376a3 100644 --- a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb +++ b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb @@ -229,13 +229,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @subscriber_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::PubSub::V1::Subscriber::Stub, credentials: credentials, @@ -246,6 +239,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @subscriber_stub.endpoint + config.universe_domain = @subscriber_stub.universe_domain + end end ## diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher/helpers_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher/helpers_test.rb index d8f726e4462a..95fa2f841ac1 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher/helpers_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher/helpers_test.rb @@ -23,8 +23,18 @@ require "google/cloud/pubsub/v1/publisher" class ::Google::Cloud::PubSub::V1::Publisher::HelpersTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_config_channel_args - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do ::Google::Auth::Credentials.stub :default, :my_creds do ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| channel_args = config.channel_args diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb index 8b4143ef9377..0eb7cc375873 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/pubsub/v1/publisher" class ::Google::Cloud::PubSub::V1::Publisher::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_schema_path def test_subscription_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_subscription_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb index 5010e359bff0..a136f19dbc4b 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_topic @@ -606,7 +614,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb index c4595f32c2e2..ddfd349b2014 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/pubsub/v1/schema_service" class ::Google::Cloud::PubSub::V1::SchemaService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_schema_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb index 6779423407a4..a794458bbbc9 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_schema @@ -674,7 +682,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber/helpers_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber/helpers_test.rb index 6d898aed76ec..61b2359f537d 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber/helpers_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber/helpers_test.rb @@ -23,8 +23,18 @@ require "google/cloud/pubsub/v1/subscriber" class ::Google::Cloud::PubSub::V1::Subscriber::HelpersTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_config_channel_args - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do ::Google::Auth::Credentials.stub :default, :my_creds do ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| channel_args = config.channel_args diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb index 47517c2e5552..767ad41d4a96 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/pubsub/v1/subscriber" class ::Google::Cloud::PubSub::V1::Subscriber::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_snapshot_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_snapshot_path def test_subscription_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_subscription_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb index 124d963151e8..18ab41c22fa1 100644 --- a/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb +++ b/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_subscription @@ -1098,7 +1106,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb b/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb index 3c5a478a84f5..3b595872f24b 100644 --- a/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb +++ b/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb @@ -183,13 +183,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @rapid_migration_assessment_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Stub, credentials: credentials, @@ -200,6 +193,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @rapid_migration_assessment_stub.endpoint + config.universe_domain = @rapid_migration_assessment_stub.universe_domain + end end ## diff --git a/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb b/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb index 1e62ec920a7a..932f742bf01c 100644 --- a/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb +++ b/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb @@ -180,20 +180,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @rapid_migration_assessment_stub = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @rapid_migration_assessment_stub.endpoint + config.universe_domain = @rapid_migration_assessment_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb b/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb index e32b9ec93a3d..ad964702494e 100644 --- a/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb +++ b/google-cloud-rapid_migration_assessment-v1/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_collector REST call # diff --git a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb index db5099c5b008..427f6b87498f 100644 --- a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb +++ b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb index b842be11faae..ffd32aefe064 100644 --- a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb +++ b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment" class ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_annotation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_annotation_path def test_collector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_collector_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb index 4b0de50af202..9d35f64ee35e 100644 --- a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb +++ b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_collector @@ -621,7 +629,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb index 8702dc8102d1..ba649060099b 100644 --- a/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb +++ b/google-cloud-rapid_migration_assessment-v1/test/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_collector @@ -701,7 +709,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| config.credentials = grpc_channel end @@ -719,7 +728,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb b/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb index 4406dfaf55f2..0e42a0aedc5d 100644 --- a/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb +++ b/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service" class ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_assessment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_assessment_path def test_firewall_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_firewall_policy_path def test_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_key_path def test_metrics_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_metrics_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_project_path def test_related_account_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb b/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb index bb4c85bf7f08..59068bd58ee7 100644 --- a/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb +++ b/google-cloud-recaptcha_enterprise-v1/test/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_assessment @@ -1166,7 +1174,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb b/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb index cb4c875d4f50..fbf1bc9baf7a 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb +++ b/google-cloud-recaptcha_enterprise-v1beta1/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_assessment REST call # diff --git a/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb b/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb index acfdbb71b1f3..273d7104593e 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb +++ b/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service" class ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_assessment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_assessment_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb b/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb index c4303d2faf2d..fad7ed0d29b8 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb +++ b/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_assessment @@ -179,7 +187,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb b/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb index 8923901f4173..e299ecf317ed 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb +++ b/google-cloud-recaptcha_enterprise-v1beta1/test/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_assessment @@ -177,7 +185,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb index 250a583e3fa6..4c2ae6798608 100644 --- a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb +++ b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_catalog_item REST call # diff --git a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb index 077e97ac22d2..aa3016f6d4e8 100644 --- a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb +++ b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_prediction_api_key_registration REST call # diff --git a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb index 325af1572bf3..3a90fcbdb68f 100644 --- a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb +++ b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the predict REST call # diff --git a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb index 7c86025c7fa2..36e876ce70d4 100644 --- a/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb +++ b/google-cloud-recommendation_engine-v1beta1/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the write_user_event REST call # diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb index 4bcce38ab7fc..32a864bb7598 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb index 0e49b3dba97c..b80332d4d00a 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recommendation_engine/v1beta1/catalog_service" class ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_catalog_path def test_catalog_item_path_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb index 03e6179848ba..9eaf7a577c86 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_catalog_item @@ -399,7 +407,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb index 789e74757a35..4fc420dd0054 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/catalog_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_catalog_item @@ -427,7 +435,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| config.credentials = grpc_channel end @@ -445,7 +454,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb index f61815344e80..71ebf893e337 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry" class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_event_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_event_store_path def test_prediction_api_key_registration_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb index 9ef14b2607ac..c949e1fd29a0 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_prediction_api_key_registration @@ -231,7 +239,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb index 55278de54435..cccf5decc670 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_prediction_api_key_registration @@ -236,7 +244,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb index 7bfe96847ded..3a4e30560a44 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recommendation_engine/v1beta1/prediction_service" class ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_placement_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb index e80e07ca9305..8beb0cb891da 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -127,7 +135,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb index 436e472e661e..6b700555f85c 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/prediction_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -128,7 +136,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb index 61f819a719e7..f82b6177596c 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb index bbc50fa33702..b87548ba5648 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recommendation_engine/v1beta1/user_event_service" class ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_event_store_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb index b46146d378a0..6359201958ea 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -348,7 +356,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb index 951e8773b243..2f9bc2189430 100644 --- a/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb +++ b/google-cloud-recommendation_engine-v1beta1/test/google/cloud/recommendation_engine/v1beta1/user_event_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -380,7 +388,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -398,7 +407,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb b/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb index 2c646ca4e8db..cd06f02f3c6d 100644 --- a/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb +++ b/google-cloud-recommender-v1/lib/google/cloud/recommender/v1/recommender/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_insights REST call # diff --git a/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb b/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb index 074b163da848..c9e76b540814 100644 --- a/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb +++ b/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/recommender/v1/recommender" class ::Google::Cloud::Recommender::V1::Recommender::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_insight_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end @@ -46,7 +56,7 @@ def test_insight_path def test_insight_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_insight_type_path def test_insight_type_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_insight_type_config_path def test_recommendation_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end @@ -106,7 +116,7 @@ def test_recommendation_path def test_recommender_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end @@ -127,7 +137,7 @@ def test_recommender_path def test_recommender_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb b/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb index c75507b8dff2..ec8535316462 100644 --- a/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb +++ b/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_insights @@ -787,7 +795,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Recommender::V1::Recommender::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb b/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb index aab03d7d932d..337085b7f4e4 100644 --- a/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb +++ b/google-cloud-recommender-v1/test/google/cloud/recommender/v1/recommender_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_insights @@ -853,7 +861,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb b/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb index 168cc1d38a5e..52067ac69cec 100644 --- a/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb +++ b/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb @@ -185,13 +185,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Stub, credentials: credentials, @@ -202,6 +195,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + end end ## diff --git a/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb b/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb index e77985ff4fb9..5b6fd75d586b 100644 --- a/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb +++ b/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb @@ -182,20 +182,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_redis_cluster_stub = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_cluster_stub.endpoint + config.universe_domain = @cloud_redis_cluster_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb b/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb index fc98c17d2f0e..66e4bc5e7046 100644 --- a/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb +++ b/google-cloud-redis-cluster-v1/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_clusters REST call # diff --git a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb index e13ad58ab30a..55ca6784d8cc 100644 --- a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb +++ b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb index 5eff34de9ede..aa169ca40e0a 100644 --- a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb +++ b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/redis/cluster/v1/cloud_redis_cluster" class ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cluster_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb index 7e1168608eec..cfda4404daf8 100644 --- a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb +++ b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -344,7 +352,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb index b95bcdbc9731..a6972f39ac80 100644 --- a/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb +++ b/google-cloud-redis-cluster-v1/test/google/cloud/redis/cluster/v1/cloud_redis_cluster_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_clusters @@ -377,7 +385,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| config.credentials = grpc_channel end @@ -395,7 +404,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb b/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb index 913430850885..5db3ea60170a 100644 --- a/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb +++ b/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/client.rb @@ -190,13 +190,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_redis_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Redis::V1::CloudRedis::Stub, credentials: credentials, @@ -207,6 +200,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_stub.endpoint + config.universe_domain = @cloud_redis_stub.universe_domain + end end ## diff --git a/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb b/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb index 6005c879bea9..2802cf37c5e7 100644 --- a/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb +++ b/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/client.rb @@ -187,20 +187,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_redis_stub = ::Google::Cloud::Redis::V1::CloudRedis::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_redis_stub.endpoint + config.universe_domain = @cloud_redis_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb b/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb index b61ff4fec785..bd8f3f6d3660 100644 --- a/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb +++ b/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb index 56fe03640efe..39e0ac10f74f 100644 --- a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb +++ b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1::CloudRedis::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb index c34a2a7c020e..2b9389afc6ac 100644 --- a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb +++ b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/redis/v1/cloud_redis" class ::Google::Cloud::Redis::V1::CloudRedis::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb index 31e786bb3634..f0dba939d4ba 100644 --- a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb +++ b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -671,7 +679,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1::CloudRedis::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb index 5997993ac8b3..8d07ab8404ba 100644 --- a/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb +++ b/google-cloud-redis-v1/test/google/cloud/redis/v1/cloud_redis_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -756,7 +764,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end @@ -774,7 +783,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb b/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb index 76e40d8100bc..b234f6b207af 100644 --- a/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb +++ b/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb index fc574a3e4387..a29a96fcbc41 100644 --- a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb +++ b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb index 0f419e7eadce..b23bbc32d8e9 100644 --- a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb +++ b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/redis/v1beta1/cloud_redis" class ::Google::Cloud::Redis::V1beta1::CloudRedis::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb index 55f0e2ad626b..3a764c64c26a 100644 --- a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb +++ b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -671,7 +679,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb index 1625855e869b..7eef1e83f215 100644 --- a/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb +++ b/google-cloud-redis-v1beta1/test/google/cloud/redis/v1beta1/cloud_redis_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -756,7 +764,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end @@ -774,7 +783,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb index 948a5fe0f34f..d6ad1523c840 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_folder REST call # diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb index 387284a6cd66..f4d317ed02fa 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_organization REST call # diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb index fde469a84e2e..392a5199f1de 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_project REST call # diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb index 6c763778f137..20a26f5bdf09 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_tag_bindings REST call # diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb index eba58d49664e..93932c24db3c 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_tag_hold REST call # diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb index 86d143db0fd7..e8ea2a902f5f 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_tag_keys REST call # diff --git a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb index 1519e41f0b2b..f294d8e66aab 100644 --- a/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +++ b/google-cloud-resource_manager-v3/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_tag_values REST call # diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb index 8ce13395374e..0df2ad769aa5 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Folders::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb index 208b99d19581..dec65b86eba0 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/folders" class ::Google::Cloud::ResourceManager::V3::Folders::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb index b59acd24d781..842eb541357f 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_folder @@ -671,7 +679,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb index 8e2dc5660917..c93593bfc516 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/folders_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_folder @@ -746,7 +754,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| config.credentials = grpc_channel end @@ -764,7 +773,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Folders::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb index a236957075fe..932458f87c52 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/organizations" class ::Google::Cloud::ResourceManager::V3::Organizations::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb index 652470f804ba..b409c7a6be91 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_organization @@ -342,7 +350,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Organizations::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb index 5ccf4fe90db8..a6cfd8b5b7be 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/organizations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_organization @@ -358,7 +366,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Organizations::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb index f858b96a26f6..b86951a2e135 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Projects::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb index daf7db6425ec..7638ac864424 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/projects" class ::Google::Cloud::ResourceManager::V3::Projects::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb index 82309cba78f1..967353686f26 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_project @@ -671,7 +679,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Projects::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb index 80b0fbea915b..a7f2ce02f05a 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/projects_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_project @@ -746,7 +754,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| config.credentials = grpc_channel end @@ -764,7 +773,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::Projects::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb index 7f0e8c422e97..f0545af35a41 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagBindings::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb index d1e321ac7cce..14da888dc871 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/tag_bindings" class ::Google::Cloud::ResourceManager::V3::TagBindings::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_tag_binding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb index d669cfe3869d..386493734d17 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_tag_bindings @@ -287,7 +295,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb index cc65fe8c62b5..6637b31b4e9d 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_bindings_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_tag_bindings @@ -313,7 +321,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| config.credentials = grpc_channel end @@ -331,7 +340,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagBindings::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb index 56018a48d78c..229bb61f60e1 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagHolds::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb index f1ec56e0e9f2..6c27d931ec7e 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/tag_holds" class ::Google::Cloud::ResourceManager::V3::TagHolds::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_tag_hold_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_tag_hold_path def test_tag_value_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb index 4a6a94ca212c..6232764b4085 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_tag_hold @@ -234,7 +242,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb index aad1b987bd63..78190479b89d 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_holds_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_tag_hold @@ -252,7 +260,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| config.credentials = grpc_channel end @@ -270,7 +279,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagHolds::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb index 233c2f82407a..3c3755fcb7a0 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagKeys::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb index d2f60659dcfe..3ed37ab0656c 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/tag_keys" class ::Google::Cloud::ResourceManager::V3::TagKeys::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_tag_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb index 0d7f54eb1768..3673e782f39d 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_tag_keys @@ -563,7 +571,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb index 4b4d43bac322..d141b645d54a 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_keys_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_tag_keys @@ -615,7 +623,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| config.credentials = grpc_channel end @@ -633,7 +642,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagKeys::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb index 6aae98534e68..1ab49f0034d9 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagValues::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb index 20e02e1417ef..ea5a60d37f3c 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_manager/v3/tag_values" class ::Google::Cloud::ResourceManager::V3::TagValues::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_tag_value_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb index 7f9909b9200f..1c0229f8bb5b 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_tag_values @@ -563,7 +571,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagValues::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb index 1ccd2397c039..ba03ed35278f 100644 --- a/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb +++ b/google-cloud-resource_manager-v3/test/google/cloud/resource_manager/v3/tag_values_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_tag_values @@ -615,7 +623,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| config.credentials = grpc_channel end @@ -633,7 +642,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceManager::V3::TagValues::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_settings-v1/lib/google/cloud/resource_settings/v1/resource_settings_service/rest/service_stub.rb b/google-cloud-resource_settings-v1/lib/google/cloud/resource_settings/v1/resource_settings_service/rest/service_stub.rb index 410788260036..d582f32e3ecf 100644 --- a/google-cloud-resource_settings-v1/lib/google/cloud/resource_settings/v1/resource_settings_service/rest/service_stub.rb +++ b/google-cloud-resource_settings-v1/lib/google/cloud/resource_settings/v1/resource_settings_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_settings REST call # diff --git a/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_paths_test.rb b/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_paths_test.rb index e5ad96eb4fc9..e41926584012 100644 --- a/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_paths_test.rb +++ b/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/resource_settings/v1/resource_settings_service" class ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_setting_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_rest_test.rb b/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_rest_test.rb index 962e4cf04215..5df3cb454b2a 100644 --- a/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_rest_test.rb +++ b/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_settings @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_test.rb b/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_test.rb index a919dd3f05d6..ecb605e9144a 100644 --- a/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_test.rb +++ b/google-cloud-resource_settings-v1/test/google/cloud/resource_settings/v1/resource_settings_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_settings @@ -238,7 +246,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb index bdffdd48eac4..6a4db8fb86b0 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @catalog_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::CatalogService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @catalog_service_stub.endpoint + config.universe_domain = @catalog_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb index d12fc0eebd5b..5d4f0e97c0ed 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @catalog_service_stub = ::Google::Cloud::Retail::V2::CatalogService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @catalog_service_stub.endpoint + config.universe_domain = @catalog_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb index e37415416e6e..c93710adbeaa 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_catalogs REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb index c682fdef2db4..599eb0b9855d 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/client.rb @@ -162,13 +162,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @completion_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::CompletionService::Stub, credentials: credentials, @@ -179,6 +172,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb index ee4b269a27d7..a9a2c296276a 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/client.rb @@ -159,19 +159,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @completion_service_stub = ::Google::Cloud::Retail::V2::CompletionService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb index 4b4703db3908..5fc85e2b12a4 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb index 5bc112bc60ff..c1a9bc4c2dc3 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/client.rb @@ -147,13 +147,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @control_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::ControlService::Stub, credentials: credentials, @@ -164,6 +157,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @control_service_stub.endpoint + config.universe_domain = @control_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb index b29eb9fd8494..358bfb30913e 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/client.rb @@ -144,19 +144,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @control_service_stub = ::Google::Cloud::Retail::V2::ControlService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @control_service_stub.endpoint + config.universe_domain = @control_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb index e7e6909a3825..f544bb2e5c32 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_control REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb index ffe4795834a9..10d83fb26a7c 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/client.rb @@ -170,13 +170,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @model_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::ModelService::Stub, credentials: credentials, @@ -187,6 +180,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb index 31c1f2d1fb0f..9daf48f3b057 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/client.rb @@ -167,19 +167,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @model_service_stub = ::Google::Cloud::Retail::V2::ModelService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @model_service_stub.endpoint + config.universe_domain = @model_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb index ecc4e3ceae72..80d652ce19f8 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_model REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/client.rb index 1a457a1d2d9b..8cb2eea5fd0f 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @prediction_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::PredictionService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb index 0ec1de2d147a..3992478a5f6f 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/client.rb @@ -149,19 +149,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @prediction_service_stub = ::Google::Cloud::Retail::V2::PredictionService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @prediction_service_stub.endpoint + config.universe_domain = @prediction_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb index 45806cf6cec6..1f24db46245d 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the predict REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb index bd5e3984380e..fb0890fcf854 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/client.rb @@ -165,13 +165,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @product_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::ProductService::Stub, credentials: credentials, @@ -182,6 +175,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @product_service_stub.endpoint + config.universe_domain = @product_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb index f0e68c26b664..34157006647e 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/client.rb @@ -162,19 +162,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @product_service_stub = ::Google::Cloud::Retail::V2::ProductService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @product_service_stub.endpoint + config.universe_domain = @product_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb index b96412dbd7fc..3d4ad66b34c3 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_product REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb index 2a71089ad2f8..fb3cd359be68 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/client.rb @@ -155,13 +155,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @search_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::SearchService::Stub, credentials: credentials, @@ -172,6 +165,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb index c1a1253d7cae..19b30f337dfe 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/client.rb @@ -152,19 +152,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @search_service_stub = ::Google::Cloud::Retail::V2::SearchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb index c410739f9f71..47955ac04ba9 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb index abb8c4b7b1ba..51b345204112 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/client.rb @@ -147,13 +147,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @serving_config_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::ServingConfigService::Stub, credentials: credentials, @@ -164,6 +157,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @serving_config_service_stub.endpoint + config.universe_domain = @serving_config_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb index 745ade519159..70cfcfe795f6 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb @@ -144,19 +144,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @serving_config_service_stub = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @serving_config_service_stub.endpoint + config.universe_domain = @serving_config_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb index 4bb15cd49d50..85112119c5b8 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_serving_config REST call # diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb index c253da6c4f7f..c41dc5bf7873 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/client.rb @@ -169,13 +169,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @user_event_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Retail::V2::UserEventService::Stub, credentials: credentials, @@ -186,6 +179,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb index 224a6f0e6cee..44adfabb8279 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/client.rb @@ -166,19 +166,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @user_event_service_stub = ::Google::Cloud::Retail::V2::UserEventService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + end end ## diff --git a/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb b/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb index ab920cdea4ff..b6c408ff6daa 100644 --- a/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +++ b/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the write_user_event REST call # diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb index 8c6183743f85..1f82d5cc78d2 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/catalog_service" class ::Google::Cloud::Retail::V2::CatalogService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_attributes_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_attributes_config_path def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_branch_path def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_catalog_path def test_completion_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_completion_config_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb index c943c6449680..ef13d7390aa8 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_catalogs @@ -672,7 +680,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb index f45a16ef6918..14ce2d32337a 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/catalog_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_catalogs @@ -718,7 +726,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::CatalogService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb index 8daed2e2c81f..98ca9c4d00c4 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::CompletionService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb index fd4afbb3a6a0..150cb25bb4fa 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/completion_service" class ::Google::Cloud::Retail::V2::CompletionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb index 51a07e56ce9b..d7741db09415 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -183,7 +191,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::CompletionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb index 8514c21fd314..15dfb7d85cbe 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/completion_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -190,7 +198,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| config.credentials = grpc_channel end @@ -208,7 +217,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::CompletionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb index 05c854ec99ae..b0ec28994d93 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/control_service" class ::Google::Cloud::Retail::V2::ControlService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_catalog_path def test_control_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb index 284d8ca505e9..339f0735de1e 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_control @@ -342,7 +350,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ControlService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb index 2a5db6f549e5..286d0c69a9f6 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/control_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_control @@ -358,7 +366,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ControlService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb index 256eaa078842..fcd3393fe281 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ModelService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb index 9a13d4f29389..96ea0ecce150 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/model_service" class ::Google::Cloud::Retail::V2::ModelService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_catalog_path def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb index a54e174fb088..65e8c5df96e0 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_model @@ -503,7 +511,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ModelService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb index e3a36fbadd75..dc22a1888ca4 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/model_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_model @@ -540,7 +548,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| config.credentials = grpc_channel end @@ -558,7 +567,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ModelService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb index 96ef67daab70..b4ae84d16945 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/prediction_service" class ::Google::Cloud::Retail::V2::PredictionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb index 452426b0f7dd..465e5bbe646d 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -127,7 +135,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::PredictionService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb index 688bf4662ac7..c93c44a61d8a 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/prediction_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_predict @@ -123,7 +131,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::PredictionService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb index a1a3c7b65faa..3fc606e95b36 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ProductService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb index 6693bc07f96a..86122bf9f5d3 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/product_service" class ::Google::Cloud::Retail::V2::ProductService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_branch_path def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb index ab1fd1d7ff4c..13551adf35ec 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product @@ -692,7 +700,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ProductService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb index 69697c5c060f..89591ef49777 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/product_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product @@ -788,7 +796,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| config.credentials = grpc_channel end @@ -806,7 +815,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ProductService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb index 35bdd69dcf9e..1b79c4bd0195 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/search_service" class ::Google::Cloud::Retail::V2::SearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_branch_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb index 28365a7a61f1..573c452a4845 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -141,7 +149,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::SearchService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb index bc46eed651b4..689c4c103257 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/search_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -157,7 +165,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::SearchService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb index d07f720529f9..85ce3596da7e 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/serving_config_service" class ::Google::Cloud::Retail::V2::ServingConfigService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_catalog_path def test_serving_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb index 38ea0e8ec7a6..d3cd170b9e40 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_serving_config @@ -451,7 +459,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ServingConfigService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb index 53e20e3f7368..6a99c6182e75 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/serving_config_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_serving_config @@ -476,7 +484,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::ServingConfigService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb index d9c7c5f1eadf..f7dbeba706b7 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::UserEventService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb index 2196de49b6f9..dbfebe88f2ba 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/retail/v2/user_event_service" class ::Google::Cloud::Retail::V2::UserEventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_catalog_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_catalog_path def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb index 5ff5b6f3a9bf..bb058ea589b6 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -348,7 +356,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::UserEventService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb index 56aee894761a..95ab603e85ef 100644 --- a/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb +++ b/google-cloud-retail-v2/test/google/cloud/retail/v2/user_event_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_write_user_event @@ -381,7 +389,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| config.credentials = grpc_channel end @@ -399,7 +408,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Retail::V2::UserEventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb index 7fb1c0d34506..a9f86f67e732 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb @@ -154,13 +154,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @executions_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Run::V2::Executions::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @executions_stub.endpoint + config.universe_domain = @executions_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/client.rb index aa43b41920d9..0a1d87731b94 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/client.rb @@ -151,19 +151,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @executions_stub = ::Google::Cloud::Run::V2::Executions::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @executions_stub.endpoint + config.universe_domain = @executions_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/service_stub.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/service_stub.rb index 6bfd9ec4b001..c290aebf6cc3 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/service_stub.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_execution REST call # diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb index 70a3a2306d4e..b624c89d1335 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb @@ -154,13 +154,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @jobs_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Run::V2::Jobs::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @jobs_stub.endpoint + config.universe_domain = @jobs_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/client.rb index a2975ccf3d56..5381f49b9a96 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/client.rb @@ -151,19 +151,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @jobs_stub = ::Google::Cloud::Run::V2::Jobs::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @jobs_stub.endpoint + config.universe_domain = @jobs_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/service_stub.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/service_stub.rb index 2b09d1a40758..9c3507e45266 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb index fb91c35d8a93..5b1f96839695 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb @@ -154,13 +154,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @revisions_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Run::V2::Revisions::Stub, credentials: credentials, @@ -171,6 +164,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @revisions_stub.endpoint + config.universe_domain = @revisions_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/client.rb index c97b5d5a8542..62fc1158bd8b 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/client.rb @@ -151,19 +151,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @revisions_stub = ::Google::Cloud::Run::V2::Revisions::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @revisions_stub.endpoint + config.universe_domain = @revisions_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/service_stub.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/service_stub.rb index 6c1a75db0206..453817020d5b 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_revision REST call # diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb index 6a2ea659f800..e270b88038e8 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb @@ -170,13 +170,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @services_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Run::V2::Services::Stub, credentials: credentials, @@ -187,6 +180,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @services_stub.endpoint + config.universe_domain = @services_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/client.rb index ba08e27ce549..bfd1e9c8dbc7 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/client.rb @@ -167,19 +167,19 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @services_stub = ::Google::Cloud::Run::V2::Services::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @services_stub.endpoint + config.universe_domain = @services_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/service_stub.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/service_stub.rb index b852cf870ff3..826915ada4c3 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/service_stub.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/services/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_service REST call # diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb index 6eef3607d7e6..c88f82e37c9d 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb @@ -147,13 +147,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Run::V2::Tasks::Stub, credentials: credentials, @@ -164,6 +157,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @tasks_stub.endpoint + config.universe_domain = @tasks_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/client.rb index 25535f1fa5dc..d4e2510d2af1 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/client.rb @@ -144,19 +144,19 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @tasks_stub = ::Google::Cloud::Run::V2::Tasks::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @tasks_stub.endpoint + config.universe_domain = @tasks_stub.universe_domain + end end ## diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/service_stub.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/service_stub.rb index f679c88e7faa..5537622bf805 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_task REST call # diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb index ddbb78660678..54bfcc0e5262 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb index 2d6711cd04ca..6ec0fbc98331 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/run/v2/executions" class ::Google::Cloud::Run::V2::Executions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_execution_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_execution_path def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_rest_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_rest_test.rb index 008eac363154..962ab8346591 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/executions_rest_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_execution @@ -289,7 +297,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Executions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb index 4b178f315cce..a0e615e919f5 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_execution @@ -312,7 +320,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| config.credentials = grpc_channel end @@ -330,7 +339,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb index 7ca5dbfaa12e..b3f37d56bb67 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb index 42d9123b7d0a..7bfaeba74d85 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/run/v2/jobs" class ::Google::Cloud::Run::V2::Jobs::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connector_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_crypto_key_path def test_execution_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_execution_path def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_job_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_secret_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_secret_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_rest_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_rest_test.rb index eba9d209e9d9..f9d0e284018d 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_rest_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -569,7 +577,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Jobs::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb index 22462d1a6a1f..6e799f0cf3bf 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -632,7 +640,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end @@ -650,7 +659,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_operations_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_operations_test.rb index 6afb3517500d..f3320c92f772 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_operations_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Revisions::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_paths_test.rb index 78ff026aaaf1..81c39c271a3e 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_paths_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/run/v2/revisions" class ::Google::Cloud::Run::V2::Revisions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_revision_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Revisions::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_revision_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Revisions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_rest_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_rest_test.rb index 4d0d08abcb69..87b277c287ef 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_rest_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_revision @@ -233,7 +241,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Revisions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_test.rb index 359c8767630f..f21171a4d92a 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/revisions_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/revisions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_revision @@ -245,7 +253,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Revisions::Client.new do |config| config.credentials = grpc_channel end @@ -263,7 +272,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Revisions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/services_operations_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/services_operations_test.rb index 7f07596242a8..7902fae9f2a1 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/services_operations_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/services_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Services::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/services_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/services_paths_test.rb index 0ee6eeeae38f..4ab5e626bbc0 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/services_paths_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/services_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/run/v2/services" class ::Google::Cloud::Run::V2::Services::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connector_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_crypto_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_revision_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_revision_path def test_secret_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_secret_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_secret_version_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/services_rest_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/services_rest_test.rb index 1b6494b4ec1c..12ef4302b1ca 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/services_rest_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/services_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_service @@ -512,7 +520,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Services::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/services_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/services_test.rb index f57c9d6a78a3..ffbaa1ab2299 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/services_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/services_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_service @@ -563,7 +571,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end @@ -581,7 +590,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Services::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb index 32106d86d259..afe012e2ca74 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/run/v2/tasks" class ::Google::Cloud::Run::V2::Tasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_execution_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_execution_path def test_task_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_rest_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_rest_test.rb index 1a3995b1fce2..36057cc8de85 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_rest_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_task @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Tasks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb index 817153fbc78b..05a596f2f142 100644 --- a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb +++ b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_task @@ -178,7 +186,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb b/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb index 8b1c864a0b79..e7060bfacc70 100644 --- a/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb +++ b/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb @@ -173,13 +173,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_scheduler_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Scheduler::V1::CloudScheduler::Stub, credentials: credentials, @@ -190,6 +183,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + end end ## diff --git a/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb b/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb index a34f45ad6c80..d544e88b4d30 100644 --- a/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb +++ b/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb @@ -170,20 +170,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb b/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb index e06ec540f95e..be739915adea 100644 --- a/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb +++ b/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_jobs REST call # diff --git a/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb b/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb index c19c3d042990..9b5857ef3455 100644 --- a/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb +++ b/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/scheduler/v1/cloud_scheduler" class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_job_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb b/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb index 70047dc74c80..ec9421985630 100644 --- a/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb +++ b/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_jobs @@ -502,7 +510,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb b/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb index 9c6ad1a747df..018f7b1869fe 100644 --- a/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb +++ b/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_jobs @@ -528,7 +536,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb b/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb index e39919fb0004..cfcc428fab7d 100644 --- a/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb +++ b/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb @@ -179,13 +179,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_scheduler_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Stub, credentials: credentials, @@ -196,6 +189,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + end end ## diff --git a/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb b/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb index 8a214790f81a..0117f0328b46 100644 --- a/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb +++ b/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb @@ -176,20 +176,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_scheduler_stub.endpoint + config.universe_domain = @cloud_scheduler_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb b/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb index ce334a9f4570..3bd2db50ed43 100644 --- a/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb +++ b/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_jobs REST call # diff --git a/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb b/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb index ac8598b48fa2..3b2c42c27347 100644 --- a/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb +++ b/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/scheduler/v1beta1/cloud_scheduler" class ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_job_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb b/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb index 5e5c8699c128..cf090fd064a1 100644 --- a/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb +++ b/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_jobs @@ -506,7 +514,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb b/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb index 66a2700fbd0b..33e2cf7ffc50 100644 --- a/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb +++ b/google-cloud-scheduler-v1beta1/test/google/cloud/scheduler/v1beta1/cloud_scheduler_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_jobs @@ -536,7 +544,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb index 76de9553febd..d59c016db5ce 100644 --- a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb +++ b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_secrets REST call # diff --git a/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb b/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb index 73d5ed89cb74..a9c57008c9fa 100644 --- a/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb +++ b/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/secret_manager/v1/secret_manager_service" class ::Google::Cloud::SecretManager::V1::SecretManagerService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_secret_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_secret_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_secret_version_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb b/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb index c9961bd77898..0e2aff9bb0d5 100644 --- a/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb +++ b/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_secrets @@ -894,7 +902,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb b/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb index fb8a6fdfd4e5..866fac482862 100644 --- a/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb +++ b/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_secrets @@ -967,7 +975,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb b/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb index 0a32f7d7c7ca..660fc74c4ba8 100644 --- a/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb +++ b/google-cloud-secret_manager-v1beta1/lib/google/cloud/secret_manager/v1beta1/secret_manager_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_secrets REST call # diff --git a/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb b/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb index b1c27cbf5fdf..c92ff63f9ca9 100644 --- a/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb +++ b/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/secret_manager/v1beta1/secret_manager_service" class ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_secret_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_secret_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb b/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb index 7311cef069fc..39c8370fb1fd 100644 --- a/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb +++ b/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_secrets @@ -888,7 +896,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb b/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb index 4e99aa84bf3e..234073f60fc2 100644 --- a/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb +++ b/google-cloud-secret_manager-v1beta1/test/google/cloud/secret_manager/v1beta1/secret_manager_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_secrets @@ -955,7 +963,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb b/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb index 63a2cc742da1..3cd02d2a51d4 100644 --- a/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb +++ b/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/client.rb @@ -199,20 +199,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @secure_source_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Stub, credentials: credentials, @@ -223,6 +209,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain + end end ## diff --git a/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb b/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb index 2354f9b684a6..7ffcaefd67f5 100644 --- a/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb +++ b/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb @@ -196,28 +196,28 @@ def initialize config.universe_domain = @config.universe_domain end + @secure_source_manager_stub = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @secure_source_manager_stub.endpoint + config.universe_domain = @secure_source_manager_stub.universe_domain config.bindings_override = @config.bindings_override end - - @secure_source_manager_stub = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb b/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb index 251fef0bb155..86c6d5579b19 100644 --- a/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb +++ b/google-cloud-secure_source_manager-v1/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instances REST call # diff --git a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb index 75278add4f8c..c1f1a950e535 100644 --- a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb +++ b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb index 2a9a2d8f3b2b..22e2ca284be8 100644 --- a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb +++ b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/secure_source_manager/v1/secure_source_manager" class ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_crypto_key_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_repository_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb index 7134d794ffff..41a334aae391 100644 --- a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb +++ b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -678,7 +686,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb index 1af08a1028af..3e25ed2eedfa 100644 --- a/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb +++ b/google-cloud-secure_source_manager-v1/test/google/cloud/secure_source_manager/v1/secure_source_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instances @@ -755,7 +763,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| config.credentials = grpc_channel end @@ -773,7 +782,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb b/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb index 6f1a087e0c6f..f794d5c3e0a5 100644 --- a/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb +++ b/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/client.rb @@ -163,20 +163,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @certificate_authority_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Stub, credentials: credentials, @@ -187,6 +173,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain + end end ## diff --git a/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb b/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb index 90d78f1de329..acd72964bd0d 100644 --- a/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb +++ b/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/client.rb @@ -160,28 +160,28 @@ def initialize config.universe_domain = @config.universe_domain end + @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @certificate_authority_service_stub.endpoint + config.universe_domain = @certificate_authority_service_stub.universe_domain config.bindings_override = @config.bindings_override end - - @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb b/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb index 53403b942d0b..45d72269bd06 100644 --- a/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb +++ b/google-cloud-security-private_ca-v1/lib/google/cloud/security/private_ca/v1/certificate_authority_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_certificate REST call # diff --git a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb index ad7c62d9b8f1..7e9472321a6d 100644 --- a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb +++ b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb index 4bb17ee8cce2..2d497f5163d9 100644 --- a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb +++ b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/security/private_ca/v1/certificate_authority_service" class ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_ca_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_ca_pool_path def test_certificate_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_certificate_path def test_certificate_authority_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_certificate_authority_path def test_certificate_revocation_list_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_certificate_revocation_list_path def test_certificate_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_certificate_template_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb index d446700d2f5d..e2a46990456d 100644 --- a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb +++ b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_certificate @@ -1693,7 +1701,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb index 14e6df42a662..9d1740ce5c73 100644 --- a/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb +++ b/google-cloud-security-private_ca-v1/test/google/cloud/security/private_ca/v1/certificate_authority_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_certificate @@ -1950,7 +1958,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -1968,7 +1977,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb b/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb index 14d0f630915e..74b8441817cf 100644 --- a/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb +++ b/google-cloud-security-private_ca-v1beta1/lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_certificate REST call # diff --git a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb index f8b9e213bcc4..853e65da392a 100644 --- a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb +++ b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb index 27b12e10ae9c..f5def551ac36 100644 --- a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb +++ b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/security/private_ca/v1beta1/certificate_authority_service" class ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_certificate_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_certificate_path def test_certificate_authority_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_certificate_authority_path def test_certificate_revocation_list_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_certificate_revocation_list_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_location_path def test_reusable_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb index 112638acacf6..ef7d7d78b60c 100644 --- a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb +++ b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_certificate @@ -1183,7 +1191,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb index 342c35f9e4a1..cc5e5e21b6fa 100644 --- a/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb +++ b/google-cloud-security-private_ca-v1beta1/test/google/cloud/security/private_ca/v1beta1/certificate_authority_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_certificate @@ -1345,7 +1353,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -1363,7 +1372,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb b/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb index e274019d1476..eaf68d941d35 100644 --- a/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb +++ b/google-cloud-security-public_ca-v1beta1/lib/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_external_account_key REST call # diff --git a/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb b/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb index 65980ba8f7ab..d13d2ea82ea3 100644 --- a/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb +++ b/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/security/public_ca/v1beta1/public_certificate_authority_service" class ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_external_account_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_external_account_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb b/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb index f3f633b5d165..796857990de7 100644 --- a/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb +++ b/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_external_account_key @@ -121,7 +129,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb b/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb index 36f4bb5740b7..721d8c6a3477 100644 --- a/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb +++ b/google-cloud-security-public_ca-v1beta1/test/google/cloud/security/public_ca/v1beta1/public_certificate_authority_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_external_account_key @@ -111,7 +119,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb b/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb index 464f5947e7a4..9fa94c860f91 100644 --- a/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb +++ b/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the bulk_mute_findings REST call # diff --git a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb index ca8f1cfad92b..9ae67a615ce7 100644 --- a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb +++ b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb index 9c43dc970b4c..e68323be3aa0 100644 --- a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb +++ b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/security_center/v1/security_center" class ::Google::Cloud::SecurityCenter::V1::SecurityCenter::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_big_query_export_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_big_query_export_path def test_dlp_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -58,7 +68,7 @@ def test_dlp_job_path def test_effective_security_health_analytics_custom_module_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -76,7 +86,7 @@ def test_effective_security_health_analytics_custom_module_path def test_external_system_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -94,7 +104,7 @@ def test_external_system_path def test_finding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -112,7 +122,7 @@ def test_finding_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -124,7 +134,7 @@ def test_folder_path def test_mute_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +152,7 @@ def test_mute_config_path def test_notification_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -160,7 +170,7 @@ def test_notification_config_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -172,7 +182,7 @@ def test_organization_path def test_organization_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -184,7 +194,7 @@ def test_organization_settings_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -196,7 +206,7 @@ def test_project_path def test_security_health_analytics_custom_module_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -214,7 +224,7 @@ def test_security_health_analytics_custom_module_path def test_security_health_analytics_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -232,7 +242,7 @@ def test_security_health_analytics_settings_path def test_security_marks_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -259,7 +269,7 @@ def test_security_marks_path def test_source_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -277,7 +287,7 @@ def test_source_path def test_table_data_profile_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -292,7 +302,7 @@ def test_table_data_profile_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb index a395a2671409..85e8084b798b 100644 --- a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb +++ b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_bulk_mute_findings @@ -2567,7 +2575,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb index ac2e26b7b7ba..469ff4894008 100644 --- a/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb +++ b/google-cloud-security_center-v1/test/google/cloud/security_center/v1/security_center_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_bulk_mute_findings @@ -2868,7 +2876,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -2886,7 +2895,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb b/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb index 7c03ebbf29d0..b399a41a99f1 100644 --- a/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb +++ b/google-cloud-security_center-v1p1beta1/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_source REST call # diff --git a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb index 00d10306c873..568b06712e71 100644 --- a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb +++ b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb index 76eca76d1e43..34a46c16459e 100644 --- a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb +++ b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/security_center/v1p1beta1/security_center" class ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_finding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -43,7 +53,7 @@ def test_finding_path def test_folder_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_folder_path def test_notification_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_notification_config_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -79,7 +89,7 @@ def test_organization_path def test_organization_settings_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -91,7 +101,7 @@ def test_organization_settings_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -103,7 +113,7 @@ def test_project_path def test_security_marks_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -130,7 +140,7 @@ def test_security_marks_path def test_source_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -148,7 +158,7 @@ def test_source_path def test_topic_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb index a9bbe38336c6..419f0b95a120 100644 --- a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb +++ b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_source @@ -1355,7 +1363,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb index 22a68fd0ea27..00b43fff6be0 100644 --- a/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb +++ b/google-cloud-security_center-v1p1beta1/test/google/cloud/security_center/v1p1beta1/security_center_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_source @@ -1514,7 +1522,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end @@ -1532,7 +1541,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb b/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb index a6a02f6a01b0..ba88e408102a 100644 --- a/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb +++ b/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/quota_controller/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the allocate_quota REST call # diff --git a/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb b/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb index 2bccd192ffd5..6e81c498ad85 100644 --- a/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb +++ b/google-cloud-service_control-v1/lib/google/cloud/service_control/v1/service_controller/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the check REST call # diff --git a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb index 600113edbfd2..d763ac4db256 100644 --- a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb +++ b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_allocate_quota @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceControl::V1::QuotaController::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb index 45558c06c1c2..eee6bd7342b0 100644 --- a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb +++ b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/quota_controller_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_allocate_quota @@ -113,7 +121,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceControl::V1::QuotaController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb index 39a09540fc6c..95b21bbdfcc5 100644 --- a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb +++ b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_check @@ -178,7 +186,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceControl::V1::ServiceController::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb index 8a24a750f087..30a77581f821 100644 --- a/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb +++ b/google-cloud-service_control-v1/test/google/cloud/service_control/v1/service_controller_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_check @@ -175,7 +183,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceControl::V1::ServiceController::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb index 32e77c5d806c..56a503c32790 100644 --- a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb +++ b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @lookup_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceDirectory::V1::LookupService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + end end ## diff --git a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb index d386a9a70b6c..39d9bb76109a 100644 --- a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb +++ b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/client.rb @@ -149,20 +149,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb index 81017c9a8474..292ed5162890 100644 --- a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb +++ b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/lookup_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the resolve_service REST call # diff --git a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb index 5d386ac8805e..053570b487da 100644 --- a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb +++ b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/client.rb @@ -166,13 +166,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @registration_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Stub, credentials: credentials, @@ -183,6 +176,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + end end ## diff --git a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb index c5d3d45ba57b..9f6ceaec65e0 100644 --- a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb +++ b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/client.rb @@ -163,20 +163,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @registration_service_stub = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb index 4ab0a0903f9f..87bc647787fe 100644 --- a/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb +++ b/google-cloud-service_directory-v1/lib/google/cloud/service_directory/v1/registration_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_namespace REST call # diff --git a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb index a39185afe8fe..eaf58d46bc24 100644 --- a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb +++ b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/service_directory/v1/lookup_service" class ::Google::Cloud::ServiceDirectory::V1::LookupService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb index 1641253d88e3..0921b930652c 100644 --- a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb +++ b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_resolve_service @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb index 813bcb5d2018..9299c0553631 100644 --- a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb +++ b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/lookup_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_resolve_service @@ -113,7 +121,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1::LookupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb index 279a516b3e3c..6bfefa1048d2 100644 --- a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb +++ b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/service_directory/v1/registration_service" class ::Google::Cloud::ServiceDirectory::V1::RegistrationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_endpoint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_endpoint_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_namespace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_namespace_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_network_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb index 56e94e9715cc..8c7589a2b245 100644 --- a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb +++ b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_namespace @@ -1063,7 +1071,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb index 685996beda39..000d9c12126e 100644 --- a/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb +++ b/google-cloud-service_directory-v1/test/google/cloud/service_directory/v1/registration_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_namespace @@ -1160,7 +1168,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb index 66654b46527b..398b2c61644b 100644 --- a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb +++ b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/client.rb @@ -152,13 +152,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @lookup_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Stub, credentials: credentials, @@ -169,6 +162,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + end end ## diff --git a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb index 2563e227af8b..7d2302508482 100644 --- a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb +++ b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/client.rb @@ -149,20 +149,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @lookup_service_stub = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @lookup_service_stub.endpoint + config.universe_domain = @lookup_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb index 50e3560d3d03..1f9f54c068e1 100644 --- a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb +++ b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/lookup_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the resolve_service REST call # diff --git a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb index 6461f2a496b8..866076a24f41 100644 --- a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb +++ b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/client.rb @@ -166,13 +166,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @registration_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Stub, credentials: credentials, @@ -183,6 +176,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + end end ## diff --git a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb index f9872274b08a..84fe7b451661 100644 --- a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb +++ b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/client.rb @@ -163,20 +163,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @registration_service_stub = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @registration_service_stub.endpoint + config.universe_domain = @registration_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb index c557fb8a6585..42bc4dc4495d 100644 --- a/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb +++ b/google-cloud-service_directory-v1beta1/lib/google/cloud/service_directory/v1beta1/registration_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_namespace REST call # diff --git a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb index fe91c438d7c2..6e6eecc09ee7 100644 --- a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb +++ b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/service_directory/v1beta1/lookup_service" class ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb index 870bd484f341..f91903fedcf8 100644 --- a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb +++ b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_resolve_service @@ -122,7 +130,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb index eaba8da250a8..68dd77583e10 100644 --- a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb +++ b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/lookup_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_resolve_service @@ -113,7 +121,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb index 82a9f55407df..63691a3fb6eb 100644 --- a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb +++ b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/service_directory/v1beta1/registration_service" class ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_endpoint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_endpoint_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_namespace_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_namespace_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_network_path def test_service_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb index 89bec8d68fe4..ff614670de1a 100644 --- a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb +++ b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_namespace @@ -1063,7 +1071,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb index fcac83ee2666..9cf235477403 100644 --- a/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb +++ b/google-cloud-service_directory-v1beta1/test/google/cloud/service_directory/v1beta1/registration_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_namespace @@ -1160,7 +1168,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb b/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb index 42d30b230a47..9c0f787b1c7b 100644 --- a/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb +++ b/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/client.rb @@ -155,13 +155,6 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @service_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceManagement::V1::ServiceManager::Stub, credentials: credentials, @@ -172,6 +165,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @service_manager_stub.endpoint + config.universe_domain = @service_manager_stub.universe_domain + end end ## diff --git a/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb b/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb index 364b86cdca48..189a492dbe0a 100644 --- a/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb +++ b/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/client.rb @@ -152,20 +152,20 @@ def initialize config.universe_domain = @config.universe_domain end - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @service_manager_stub = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @service_manager_stub.endpoint + config.universe_domain = @service_manager_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb b/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb index 161aca725368..a94fc7d5d79e 100644 --- a/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb +++ b/google-cloud-service_management-v1/lib/google/cloud/service_management/v1/service_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_services REST call # diff --git a/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb b/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb index 456db2241dd2..505f76210141 100644 --- a/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb +++ b/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb b/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb index 32d503b84896..848cb41a84ae 100644 --- a/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb +++ b/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -784,7 +792,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb b/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb index e28816981b8d..5d9846458058 100644 --- a/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb +++ b/google-cloud-service_management-v1/test/google/cloud/service_management/v1/service_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_services @@ -877,7 +885,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| config.credentials = grpc_channel end @@ -895,7 +904,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb b/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb index 343b3faaf8f4..522ec9898c93 100644 --- a/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb +++ b/google-cloud-service_usage-v1/lib/google/cloud/service_usage/v1/service_usage/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the enable_service REST call # diff --git a/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb b/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb index b1d8a2a6f6fc..8d0e29777d2e 100644 --- a/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb +++ b/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb b/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb index 681db95bbfa2..c53d8d02d770 100644 --- a/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb +++ b/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_enable_service @@ -397,7 +405,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb b/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb index df7d0b255ad8..587657ca28be 100644 --- a/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb +++ b/google-cloud-service_usage-v1/test/google/cloud/service_usage/v1/service_usage_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_enable_service @@ -433,7 +441,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| config.credentials = grpc_channel end @@ -451,7 +460,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb b/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb index 8683d204003d..a2aafab6ab7e 100644 --- a/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb +++ b/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloud_shell_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_environment REST call # diff --git a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb index 7ff1b0b320be..2ab88036bdad 100644 --- a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb +++ b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Shell::V1::CloudShellService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb index 1b4d8aac95fe..ac3b79afc8f8 100644 --- a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb +++ b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/shell/v1/cloud_shell_service" class ::Google::Cloud::Shell::V1::CloudShellService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_environment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb index 17f7d5da0c13..c8cb67428a5f 100644 --- a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb +++ b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_environment @@ -343,7 +351,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Shell::V1::CloudShellService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb index 30382882b7f0..559155f6c298 100644 --- a/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb +++ b/google-cloud-shell-v1/test/google/cloud/shell/v1/cloud_shell_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_environment @@ -375,7 +383,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| config.credentials = grpc_channel end @@ -393,7 +402,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Shell::V1::CloudShellService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb b/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb index 9f04787f67d7..3bf49d043ceb 100644 --- a/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb +++ b/google-cloud-spanner-admin-database-v1/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb @@ -54,6 +54,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_databases REST call # diff --git a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb index 755ba50a2d57..d7da1f661195 100644 --- a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb +++ b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb index 7b648dd6c261..4152e48b4665 100644 --- a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb +++ b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/spanner/admin/database/v1/database_admin" class ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_backup_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_backup_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_crypto_key_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_version_path def test_database_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_database_path def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb index dece3081695a..0f9dc6a3c1ee 100644 --- a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb +++ b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_databases @@ -1181,7 +1189,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb index 021965cd2256..9d270d20cd44 100644 --- a/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb +++ b/google-cloud-spanner-admin-database-v1/test/google/cloud/spanner/admin/database/v1/database_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_databases @@ -1337,7 +1345,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -1355,7 +1364,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb b/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb index 3659694e148e..030986e4b090 100644 --- a/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb +++ b/google-cloud-spanner-admin-instance-v1/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb @@ -54,6 +54,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_instance_configs REST call # diff --git a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb index 859e1eddd9da..9e3671db020f 100644 --- a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb +++ b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb index 87a4afe5069a..5ee8ae6b00b0 100644 --- a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb +++ b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/spanner/admin/instance/v1/instance_admin" class ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_instance_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_instance_path def test_instance_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_instance_config_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb index b6fc3fa7edd7..3f90ae1ff633 100644 --- a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb +++ b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instance_configs @@ -845,7 +853,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb index 52fed51710c9..226a9e9c8e28 100644 --- a/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb +++ b/google-cloud-spanner-admin-instance-v1/test/google/cloud/spanner/admin/instance/v1/instance_admin_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_instance_configs @@ -944,7 +952,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| config.credentials = grpc_channel end @@ -962,7 +971,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb b/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb index 1c0079505503..71b01fad2dfb 100644 --- a/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb +++ b/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/spanner/v1/spanner" class ::Google::Cloud::Spanner::V1::Spanner::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_database_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_database_path def test_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb b/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb index 85f2fe75c227..e56100df4a10 100644 --- a/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb +++ b/google-cloud-spanner-v1/test/google/cloud/spanner/v1/spanner_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_session @@ -1182,7 +1190,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Spanner::V1::Spanner::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb b/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb index a792581d2265..b1f9e572d92e 100644 --- a/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb +++ b/google-cloud-speech-v1/lib/google/cloud/speech/v1/adaptation/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_phrase_set REST call # diff --git a/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb b/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb index 1ced2bc3e41e..bfe7e9c8e68d 100644 --- a/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb +++ b/google-cloud-speech-v1/lib/google/cloud/speech/v1/speech/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the recognize REST call # diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb index a2acf9fe898a..860c99cb2b99 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/speech/v1/adaptation" class ::Google::Cloud::Speech::V1::Adaptation::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_custom_class_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_custom_class_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_phrase_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb index f0f2ae41e71c..4d7ec3647e0b 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_phrase_set @@ -616,7 +624,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1::Adaptation::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb index 408e00355e62..ee04819b8fa8 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/adaptation_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_phrase_set @@ -661,7 +669,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1::Adaptation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb index 3ee385f27fd7..fde10d4090c3 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1::Speech::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb index cffcb8f55b7c..ba26d74ae6a3 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/speech/v1/speech" class ::Google::Cloud::Speech::V1::Speech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_custom_class_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_custom_class_path def test_phrase_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb index efc9146d5b9b..484aca29acf7 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_recognize @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1::Speech::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb index 062f14c72144..88970b6bc810 100644 --- a/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb +++ b/google-cloud-speech-v1/test/google/cloud/speech/v1/speech_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_recognize @@ -267,7 +275,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -285,7 +294,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb b/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb index 4f5a6a482c25..b804d9ad493a 100644 --- a/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb +++ b/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/adaptation/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_phrase_set REST call # diff --git a/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb b/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb index a27d5af4ca60..53092906407c 100644 --- a/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb +++ b/google-cloud-speech-v1p1beta1/lib/google/cloud/speech/v1p1beta1/speech/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the recognize REST call # diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb index 406790546f16..193180c7cd58 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/speech/v1p1beta1/adaptation" class ::Google::Cloud::Speech::V1p1beta1::Adaptation::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_custom_class_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_custom_class_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_phrase_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb index 6ac59373ad6d..46932fda980c 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_phrase_set @@ -616,7 +624,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb index 7d08bec88a9a..f74aece6d413 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/adaptation_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_phrase_set @@ -661,7 +669,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb index d52639b0482e..a28b14c9104d 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1p1beta1::Speech::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb index db17d798ec61..a5c10a05d2e1 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/speech/v1p1beta1/speech" class ::Google::Cloud::Speech::V1p1beta1::Speech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_custom_class_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_custom_class_path def test_phrase_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb index 724740d1cddd..0660294df380 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_recognize @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1p1beta1::Speech::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb index b5dc169c43c6..6eabee737a39 100644 --- a/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb +++ b/google-cloud-speech-v1p1beta1/test/google/cloud/speech/v1p1beta1/speech_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_recognize @@ -267,7 +275,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -285,7 +294,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb b/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb index 5c084076b9cf..4defd63f5087 100644 --- a/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb +++ b/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/client.rb @@ -159,13 +159,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @speech_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Speech::V2::Speech::Stub, credentials: credentials, @@ -176,6 +169,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @speech_stub.endpoint + config.universe_domain = @speech_stub.universe_domain + end end ## diff --git a/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb b/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb index 8241f2f007aa..d24674fc10c3 100644 --- a/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb +++ b/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/client.rb @@ -156,20 +156,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @speech_stub = ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @speech_stub.endpoint + config.universe_domain = @speech_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb b/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb index bc1f72c1f84b..2eadfbe01a31 100644 --- a/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb +++ b/google-cloud-speech-v2/lib/google/cloud/speech/v2/speech/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_recognizer REST call # diff --git a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb index ead8acebae82..4a119485bc8a 100644 --- a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb +++ b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V2::Speech::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb index f67f55262f5d..da5ef756e8b8 100644 --- a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb +++ b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/speech/v2/speech" class ::Google::Cloud::Speech::V2::Speech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_config_path def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_crypto_key_path def test_crypto_key_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_crypto_key_version_path def test_custom_class_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_custom_class_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_phrase_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_phrase_set_path def test_recognizer_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb index 312a44cbdb14..07e0e713ae06 100644 --- a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb +++ b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_recognizer @@ -1302,7 +1310,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb index ba9f8b7981f2..d29774ae24ac 100644 --- a/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb +++ b/google-cloud-speech-v2/test/google/cloud/speech/v2/speech_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_recognizer @@ -1595,7 +1603,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end @@ -1613,7 +1622,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Speech::V2::Speech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb b/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb index 66a376a2668d..748efa4b064c 100644 --- a/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb +++ b/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/client.rb @@ -169,13 +169,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @storage_insights_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::StorageInsights::V1::StorageInsights::Stub, credentials: credentials, @@ -186,6 +179,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @storage_insights_stub.endpoint + config.universe_domain = @storage_insights_stub.universe_domain + end end ## diff --git a/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb b/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb index bfd40a931d48..f1396c461b41 100644 --- a/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb +++ b/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb @@ -166,20 +166,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @storage_insights_stub = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @storage_insights_stub.endpoint + config.universe_domain = @storage_insights_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb b/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb index 61c18524ca46..0ff60d168249 100644 --- a/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb +++ b/google-cloud-storage_insights-v1/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_report_configs REST call # diff --git a/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb b/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb index e1e2dd8015ca..7603a1699b05 100644 --- a/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb +++ b/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/storage_insights/v1/storage_insights" class ::Google::Cloud::StorageInsights::V1::StorageInsights::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_report_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_report_config_path def test_report_detail_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb b/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb index 3a09a1c8b576..7154d9f04e58 100644 --- a/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb +++ b/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_report_configs @@ -458,7 +466,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb b/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb index 3de046fb97dd..c2d2a74bf7a6 100644 --- a/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb +++ b/google-cloud-storage_insights-v1/test/google/cloud/storage_insights/v1/storage_insights_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_report_configs @@ -495,7 +503,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb b/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb index d47349f86e0a..c5d5c80374a7 100644 --- a/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb +++ b/google-cloud-storage_transfer-v1/lib/google/cloud/storage_transfer/v1/storage_transfer_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the get_google_service_account REST call # diff --git a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb index 7543ace6b299..94dcc8dbe4c7 100644 --- a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb +++ b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb index 24ea179c05d1..65813be8df84 100644 --- a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb +++ b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/storage_transfer/v1/storage_transfer_service" class ::Google::Cloud::StorageTransfer::V1::StorageTransferService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_agent_pools_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb index 8e8dabd327e7..813d7c1570f6 100644 --- a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb +++ b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_google_service_account @@ -836,7 +844,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb index 0f0a0670ebc4..53f6a693ffcc 100644 --- a/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb +++ b/google-cloud-storage_transfer-v1/test/google/cloud/storage_transfer/v1/storage_transfer_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_google_service_account @@ -906,7 +914,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| config.credentials = grpc_channel end @@ -924,7 +933,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb b/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb index 122a56fe46de..25131afc1f28 100644 --- a/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb +++ b/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/support/v2/case_attachment_service" class ::Google::Cloud::Support::V2::CaseAttachmentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_case_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb b/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb index 7d1dd538526e..99cc9744aebc 100644 --- a/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb +++ b/google-cloud-support-v2/test/google/cloud/support/v2/case_attachment_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_attachments @@ -118,7 +126,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb b/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb index 069d646e36ad..de1d8abfba92 100644 --- a/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb +++ b/google-cloud-support-v2/test/google/cloud/support/v2/case_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/support/v2/case_service" class ::Google::Cloud::Support::V2::CaseService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_case_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_case_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_organization_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb b/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb index 372822c33897..0688ad16d86b 100644 --- a/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb +++ b/google-cloud-support-v2/test/google/cloud/support/v2/case_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_case @@ -552,7 +560,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb b/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb index 7f9668c99ca8..af43f2b92085 100644 --- a/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb +++ b/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/support/v2/comment_service" class ::Google::Cloud::Support::V2::CommentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_case_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_case_path def test_comment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb b/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb index 67fa46fb340e..4021c58cff50 100644 --- a/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb +++ b/google-cloud-support-v2/test/google/cloud/support/v2/comment_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_comments @@ -178,7 +186,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Support::V2::CommentService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb index 09d48ad3cf53..1e0b4b284bbb 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_company REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb index bde0d14f5784..89ce8f15432e 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb index c26242c009ce..4d5b9bc8e505 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_client_event REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb index b028ff064f0b..865bbebf3960 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb index e031321d1eee..481a5ded2cc1 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_tenant REST call # diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb index 869ba2703594..0891028ad4bf 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4/company_service" class ::Google::Cloud::Talent::V4::CompanyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_company_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_company_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb index 4f51138e9d76..9439f7e41a0b 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_company @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb index 826a1233e791..7f907ef9adb5 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_company @@ -356,7 +364,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb index 9bec41a90a73..fea583071145 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4/completion" class ::Google::Cloud::Talent::V4::Completion::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_company_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_company_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb index dc686e258d6a..0bfac14ef589 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -126,7 +134,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb index 7173c51eecb7..20656ba6a328 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -121,7 +129,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb index a264830c5e38..e91e50593330 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4/event_service" class ::Google::Cloud::Talent::V4::EventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb index 28f55c19d22f..e48786df985e 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_client_event @@ -121,7 +129,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb index 63334b4d18f9..3f439668b293 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_client_event @@ -111,7 +119,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb index cf216434f915..f90586b17585 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::JobService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb index eb28aeb05ad4..dff06b7f6092 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4/job_service" class ::Google::Cloud::Talent::V4::JobService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_company_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_company_path def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_job_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb index 982a19c86e8d..7a71950a7304 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -644,7 +652,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb index a6915ae10a78..a9fb60a688d4 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -727,7 +735,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -745,7 +754,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb index 6fbe002b8d66..3bf64ee60ea1 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4/tenant_service" class ::Google::Cloud::Talent::V4::TenantService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb index 1b39f45d74d2..5db77ed8faab 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_tenant @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb b/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb index c228407a209a..d4fe3eb5115d 100644 --- a/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb +++ b/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_tenant @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb index aefa9ed37827..65a7e77b32e3 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_company REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb index 1072c8c9eb02..bc3fd0dd98cc 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb index 457289cc2b4b..fb6a9e3c1ac3 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_client_event REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb index 73dc55a476fa..19653c6acf31 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb index 627bec3d8d8f..aa5f1cc068d8 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_tenant REST call # diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb index 9609e79fd2c8..8225aae0ed9f 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4beta1/company_service" class ::Google::Cloud::Talent::V4beta1::CompanyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_company_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_company_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_project_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb index 8e43a507c002..78f4a30b3d99 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_company @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb index e756b8eeec1a..7be9c174d947 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_company @@ -356,7 +364,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb index 7084aba881af..15578785e2b9 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4beta1/completion" class ::Google::Cloud::Talent::V4beta1::Completion::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_company_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_company_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| config.credentials = grpc_channel end @@ -52,7 +62,7 @@ def test_project_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb index a551b485b2d3..66794ccdddad 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -126,7 +134,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb index 37a16f26119d..c22ecd84bf5f 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_complete_query @@ -121,7 +129,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb index a317e7e33bab..d7f953e408a3 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4beta1/event_service" class ::Google::Cloud::Talent::V4beta1::EventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb index 509818ec7de8..9657566c05d9 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_client_event @@ -121,7 +129,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb index 895bbed303e5..c5c95877cb5c 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_client_event @@ -111,7 +119,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb index ff5e7f7378c0..3310bdad8660 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::JobService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb index 5469cec547ab..614b66a3ca3f 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4beta1/job_service" class ::Google::Cloud::Talent::V4beta1::JobService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_company_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -40,7 +50,7 @@ def test_company_path def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -55,7 +65,7 @@ def test_job_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -67,7 +77,7 @@ def test_project_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb index 29991aa0a768..b4b94e2a77aa 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -646,7 +654,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb index 1d5aae1700b4..eee967c0434b 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -726,7 +734,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| config.credentials = grpc_channel end @@ -744,7 +753,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb index 1e6ff39952aa..1460977151ac 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/talent/v4beta1/tenant_service" class ::Google::Cloud::Talent::V4beta1::TenantService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_tenant_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb index 4bc3d8b63bf4..23244f2fa773 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_tenant @@ -340,7 +348,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb index c551c35deb77..46813b971384 100644 --- a/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb +++ b/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_tenant @@ -354,7 +362,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb index 32dc59a3cd9e..cbc375c506bf 100644 --- a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb +++ b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb @@ -204,13 +204,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2::CloudTasks::Stub, credentials: credentials, @@ -221,6 +214,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + end end ## diff --git a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb index e8d3a06a8cfd..4fc2973a6c12 100644 --- a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb +++ b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb @@ -201,20 +201,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb index 3a1a6c4785f6..efa01a1a6505 100644 --- a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb +++ b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_queues REST call # diff --git a/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb b/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb index ec5298717d32..0758a8b5b84a 100644 --- a/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb +++ b/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/tasks/v2/cloud_tasks" class ::Google::Cloud::Tasks::V2::CloudTasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_queue_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_queue_path def test_task_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb b/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb index 00c774cca00c..fbb3911e4cae 100644 --- a/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb +++ b/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_queues @@ -946,7 +954,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb b/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb index 3e52ebddda7b..323250075ef4 100644 --- a/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb +++ b/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_queues @@ -1021,7 +1029,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb index fa739530cb01..e49748aa8853 100644 --- a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb +++ b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb @@ -216,13 +216,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2beta2::CloudTasks::Stub, credentials: credentials, @@ -233,6 +226,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + end end ## diff --git a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb index 95c4a37b6856..16e1af7cc85d 100644 --- a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb +++ b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb @@ -211,20 +211,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb index bbf0f4ab301f..06d778f44a6b 100644 --- a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb +++ b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_queues REST call # diff --git a/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb b/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb index fa83e6edac25..e2619c549e40 100644 --- a/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb +++ b/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/tasks/v2beta2/cloud_tasks" class ::Google::Cloud::Tasks::V2beta2::CloudTasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_queue_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_queue_path def test_task_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb b/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb index f8fb31abdc75..88e11b168f6b 100644 --- a/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb +++ b/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_queues @@ -1230,7 +1238,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb b/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb index 4538ea46599e..85e688073654 100644 --- a/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb +++ b/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_queues @@ -1400,7 +1408,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb index a3dbabdf4473..76f7d780d58b 100644 --- a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb +++ b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb @@ -206,13 +206,6 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2beta3::CloudTasks::Stub, credentials: credentials, @@ -223,6 +216,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + end end ## diff --git a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb index 7706e25f6e98..39f49a05d6d9 100644 --- a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb +++ b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb @@ -203,20 +203,20 @@ def initialize @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb index b0a80386cea0..f3521cf59391 100644 --- a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb +++ b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_queues REST call # diff --git a/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb b/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb index 8d0ae2041edf..58bbcb651532 100644 --- a/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb +++ b/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/tasks/v2beta3/cloud_tasks" class ::Google::Cloud::Tasks::V2beta3::CloudTasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_queue_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_queue_path def test_task_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb b/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb index c0e213566459..6272e656ad71 100644 --- a/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb +++ b/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_queues @@ -1004,7 +1012,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb b/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb index 5b68e848ecc7..b1332840587f 100644 --- a/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb +++ b/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_queues @@ -1087,7 +1095,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb index aa58e1905b13..47091690a67c 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb @@ -158,13 +158,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @telco_automation_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Stub, credentials: credentials, @@ -175,6 +168,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @telco_automation_stub.endpoint + config.universe_domain = @telco_automation_stub.universe_domain + end end ## diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb index 16e145cd97dc..1604b39d8203 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb @@ -155,20 +155,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @telco_automation_stub = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @telco_automation_stub.endpoint + config.universe_domain = @telco_automation_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb index aef5b26d1d07..558c542f2502 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_orchestration_clusters REST call # diff --git a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb index a9f1a26dd19c..b1ae81e272e6 100644 --- a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb +++ b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb index f71f069adfba..be503156cbef 100644 --- a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb +++ b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/telco_automation/v1/telco_automation" class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_blueprint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_blueprint_path def test_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_deployment_path def test_edge_slm_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_edge_slm_path def test_hydrated_deployment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_hydrated_deployment_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_orchestration_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_orchestration_cluster_path def test_public_blueprint_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb index 5f9c3f9670af..f2ea635ad0cd 100644 --- a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb +++ b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_orchestration_clusters @@ -2056,7 +2064,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb index ddd44fe85ef6..a204ec4ac3a2 100644 --- a/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb +++ b/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_orchestration_clusters @@ -2301,7 +2309,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end @@ -2319,7 +2328,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb index 0a9794e343ed..f09e429a4f3a 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_voices REST call # diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb index fcf77a7858c2..6acc6ba8d4af 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the synthesize_long_audio REST call # diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb index 3fedba894120..635ceaf18ba8 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb index a249b71bc569..9d814156b092 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb index c9a3854b54a9..c7eaf62d2ec0 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_synthesize_long_audio @@ -124,7 +132,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb index 8bc9500ddd8b..a27cfa30abbd 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_synthesize_long_audio @@ -122,7 +130,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| config.credentials = grpc_channel end @@ -140,7 +149,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb index c3772eb2711b..ab1277ea10b4 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/text_to_speech/v1/text_to_speech" class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb index bd1147c61f6f..cd44efe56bcd 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_voices @@ -176,7 +184,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb index 7aef6b34f243..9496a2b4cd40 100644 --- a/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb +++ b/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_voices @@ -171,7 +179,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb index 21da587d40e1..2091571f70c5 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_voices REST call # diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb index a492162ab61e..d5edae44378b 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the synthesize_long_audio REST call # diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb index b5fc93b8a7b6..1c46af87bbf4 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb index 236aeb7c4186..9ca37814cb75 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb index 67815fed86a1..963618e88714 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_synthesize_long_audio @@ -124,7 +132,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb index 0a468ebf327b..d5ea0ecfc57a 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_synthesize_long_audio @@ -122,7 +130,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| config.credentials = grpc_channel end @@ -140,7 +149,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb index 0ae730a769b7..d8ca01dc8242 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/text_to_speech/v1beta1/text_to_speech" class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_model_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb index 0c6c8bcec208..73301fa0ea94 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_voices @@ -177,7 +185,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb index a7ccaecf95b1..a53e7b801146 100644 --- a/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb +++ b/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_voices @@ -173,7 +181,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb b/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb index 8298c67e13b1..d558ad81f420 100644 --- a/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb +++ b/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb @@ -158,13 +158,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @tpu_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tpu::V1::Tpu::Stub, credentials: credentials, @@ -175,6 +168,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @tpu_stub.endpoint + config.universe_domain = @tpu_stub.universe_domain + end end ## diff --git a/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb b/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb index 9d89b139b438..422ab0575180 100644 --- a/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb +++ b/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Tpu::V1::Tpu::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb b/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb index 0279a9e87b1e..b97f402ba9dc 100644 --- a/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb +++ b/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/tpu/v1/tpu" class ::Google::Cloud::Tpu::V1::Tpu::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_accelerator_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_accelerator_type_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_node_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_node_path def test_tensor_flow_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb b/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb index 5595f3953926..96e0fc6823c3 100644 --- a/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb +++ b/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_nodes @@ -755,7 +763,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| config.credentials = grpc_channel end @@ -773,7 +782,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb index bb220bbd25ec..2f1658b704df 100644 --- a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb +++ b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_traces REST call # diff --git a/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb b/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb index d7f175256ffe..fa5411ea48e4 100644 --- a/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb +++ b/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_traces @@ -237,7 +245,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb b/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb index ff4429ee0608..c2383abb4cb2 100644 --- a/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb +++ b/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_traces @@ -248,7 +256,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb index 694e5ca99416..1cd53b73cf21 100644 --- a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb +++ b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the batch_write_spans REST call # diff --git a/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb b/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb index 423d512c271d..d0bb8f318f93 100644 --- a/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb +++ b/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/trace/v2/trace_service" class ::Google::Cloud::Trace::V2::TraceService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_span_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb b/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb index 48250e5903a1..03ad9dc7b489 100644 --- a/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb +++ b/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_write_spans @@ -188,7 +196,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb b/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb index 045ac0225e83..24902140a3d5 100644 --- a/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb +++ b/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_write_spans @@ -195,7 +203,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb index 7e1616631aa2..8eddf6b43990 100644 --- a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +++ b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the translate_text REST call # diff --git a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb index d4454b4e3956..7bc9cb4b4b61 100644 --- a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb +++ b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Translate::V3::TranslationService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb index c36c85aa148a..45a347f4bfa9 100644 --- a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb +++ b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/translate/v3/translation_service" class ::Google::Cloud::Translate::V3::TranslationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_adaptive_mt_dataset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_adaptive_mt_dataset_path def test_adaptive_mt_file_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_adaptive_mt_file_path def test_glossary_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_glossary_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb index 822f3be6b939..c4690b93901c 100644 --- a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb +++ b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_translate_text @@ -1202,7 +1210,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb index 1c045dde5b3c..3950b76bb658 100644 --- a/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb +++ b/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_translate_text @@ -1365,7 +1373,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| config.credentials = grpc_channel end @@ -1383,7 +1392,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb index 85d3c2245c54..0b8ac889b41d 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb @@ -209,13 +209,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @livestream_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Stub, credentials: credentials, @@ -226,6 +219,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @livestream_service_stub.endpoint + config.universe_domain = @livestream_service_stub.universe_domain + end end ## diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb index 509f6ac2eab5..6992b6bb9fbb 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb @@ -206,20 +206,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @livestream_service_stub = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @livestream_service_stub.endpoint + config.universe_domain = @livestream_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb index 2095bc3038c6..16098b66a77f 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_channel REST call # diff --git a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb index c7792edc42c0..b958a04906bb 100644 --- a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb +++ b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb index 9934c40da96f..2a9d72b922ab 100644 --- a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb +++ b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/video/live_stream/v1/livestream_service" class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_asset_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_asset_path def test_channel_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_channel_path def test_event_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_event_path def test_input_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_input_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_network_path def test_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_pool_path def test_secret_version_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb index 08a46e2d804d..38e2b9ce4f33 100644 --- a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb +++ b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_channel @@ -1295,7 +1303,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb index 055cfc27c471..bcdf99a4bba2 100644 --- a/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb +++ b/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_channel @@ -1484,7 +1492,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end @@ -1502,7 +1511,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_operations_test.rb b/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_operations_test.rb index f8310fa5f55e..5ff1929a9d68 100644 --- a/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_operations_test.rb +++ b/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_paths_test.rb b/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_paths_test.rb index 8353b844243c..f251c2659db0 100644 --- a/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_paths_test.rb +++ b/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/video/stitcher/v1/video_stitcher_service" class ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cdn_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cdn_key_path def test_live_ad_tag_detail_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_live_ad_tag_detail_path def test_live_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_live_config_path def test_live_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_live_session_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_slate_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_slate_path def test_vod_ad_tag_detail_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_vod_ad_tag_detail_path def test_vod_session_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_vod_session_path def test_vod_stitch_detail_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_test.rb b/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_test.rb index 0d825963c941..0ef5efbf334c 100644 --- a/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_test.rb +++ b/google-cloud-video-stitcher-v1/test/google/cloud/video/stitcher/v1/video_stitcher_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_cdn_key @@ -1573,7 +1581,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end @@ -1591,7 +1600,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/transcoder_service/rest/service_stub.rb b/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/transcoder_service/rest/service_stub.rb index cee3d79704ce..ac21a1e95d03 100644 --- a/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/transcoder_service/rest/service_stub.rb +++ b/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/transcoder_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_paths_test.rb b/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_paths_test.rb index d63b81f77bca..c05783b736f5 100644 --- a/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_paths_test.rb +++ b/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/video/transcoder/v1/transcoder_service" class ::Google::Cloud::Video::Transcoder::V1::TranscoderService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_job_path def test_job_template_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_job_template_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_rest_test.rb b/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_rest_test.rb index 30c4b670e160..6917d1abb911 100644 --- a/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_rest_test.rb +++ b/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -511,7 +519,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::Transcoder::V1::TranscoderService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_test.rb b/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_test.rb index 96eda0682f07..8152ccc71dc9 100644 --- a/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_test.rb +++ b/google-cloud-video-transcoder-v1/test/google/cloud/video/transcoder/v1/transcoder_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_job @@ -551,7 +559,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/service_stub.rb b/google-cloud-video_intelligence-v1/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/service_stub.rb index 2ae7096b64f2..5b84fccc4b79 100644 --- a/google-cloud-video_intelligence-v1/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/service_stub.rb +++ b/google-cloud-video_intelligence-v1/lib/google/cloud/video_intelligence/v1/video_intelligence_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the annotate_video REST call # diff --git a/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_operations_test.rb b/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_operations_test.rb index 73b1170d4de8..55220e5c8833 100644 --- a/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_operations_test.rb +++ b/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_rest_test.rb b/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_rest_test.rb index da2daed00bec..7bcd9d5f0d94 100644 --- a/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_rest_test.rb +++ b/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -125,7 +133,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_test.rb b/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_test.rb index 4f94d249b2ad..f23f38fdebe1 100644 --- a/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_test.rb +++ b/google-cloud-video_intelligence-v1/test/google/cloud/video_intelligence/v1/video_intelligence_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -124,7 +132,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +151,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1beta2/lib/google/cloud/video_intelligence/v1beta2/video_intelligence_service/rest/service_stub.rb b/google-cloud-video_intelligence-v1beta2/lib/google/cloud/video_intelligence/v1beta2/video_intelligence_service/rest/service_stub.rb index 8c4c2a30c513..8317a9d36548 100644 --- a/google-cloud-video_intelligence-v1beta2/lib/google/cloud/video_intelligence/v1beta2/video_intelligence_service/rest/service_stub.rb +++ b/google-cloud-video_intelligence-v1beta2/lib/google/cloud/video_intelligence/v1beta2/video_intelligence_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the annotate_video REST call # diff --git a/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_operations_test.rb b/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_operations_test.rb index 227106ba5956..afdb5e5ea90c 100644 --- a/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_operations_test.rb +++ b/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_rest_test.rb b/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_rest_test.rb index 8414a0816ae1..6220873cd898 100644 --- a/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_rest_test.rb +++ b/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -125,7 +133,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_test.rb b/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_test.rb index 5ba54f929ccb..c3223d65b479 100644 --- a/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_test.rb +++ b/google-cloud-video_intelligence-v1beta2/test/google/cloud/video_intelligence/v1beta2/video_intelligence_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -124,7 +132,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +151,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p1beta1/lib/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service/rest/service_stub.rb b/google-cloud-video_intelligence-v1p1beta1/lib/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service/rest/service_stub.rb index fa69b9d12948..70a9929de15b 100644 --- a/google-cloud-video_intelligence-v1p1beta1/lib/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service/rest/service_stub.rb +++ b/google-cloud-video_intelligence-v1p1beta1/lib/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the annotate_video REST call # diff --git a/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_operations_test.rb b/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_operations_test.rb index 1bd25c0347ae..6f0c3b56370f 100644 --- a/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_operations_test.rb +++ b/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_rest_test.rb b/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_rest_test.rb index d11de0ac967d..15c1d7b857b5 100644 --- a/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_rest_test.rb +++ b/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -125,7 +133,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_test.rb b/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_test.rb index 556f17d0cc9b..1a38daff4f88 100644 --- a/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_test.rb +++ b/google-cloud-video_intelligence-v1p1beta1/test/google/cloud/video_intelligence/v1p1beta1/video_intelligence_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -124,7 +132,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +151,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p2beta1/lib/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service/rest/service_stub.rb b/google-cloud-video_intelligence-v1p2beta1/lib/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service/rest/service_stub.rb index 2e42f9767d00..0986aaa2c7d9 100644 --- a/google-cloud-video_intelligence-v1p2beta1/lib/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service/rest/service_stub.rb +++ b/google-cloud-video_intelligence-v1p2beta1/lib/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the annotate_video REST call # diff --git a/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_operations_test.rb b/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_operations_test.rb index 084c42e58cbb..ab6deaeaa2a4 100644 --- a/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_operations_test.rb +++ b/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_rest_test.rb b/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_rest_test.rb index 191c780651c6..00c2b1e31102 100644 --- a/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_rest_test.rb +++ b/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -125,7 +133,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_test.rb b/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_test.rb index 925e432a3723..1b6557f6c151 100644 --- a/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_test.rb +++ b/google-cloud-video_intelligence-v1p2beta1/test/google/cloud/video_intelligence/v1p2beta1/video_intelligence_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -124,7 +132,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +151,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p3beta1/lib/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service/rest/service_stub.rb b/google-cloud-video_intelligence-v1p3beta1/lib/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service/rest/service_stub.rb index 4f585a4683f5..4b2fc419f6d2 100644 --- a/google-cloud-video_intelligence-v1p3beta1/lib/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service/rest/service_stub.rb +++ b/google-cloud-video_intelligence-v1p3beta1/lib/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the annotate_video REST call # diff --git a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/streaming_video_intelligence_service_test.rb b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/streaming_video_intelligence_service_test.rb index ec7765f60531..c393bfdf355b 100644 --- a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/streaming_video_intelligence_service_test.rb +++ b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/streaming_video_intelligence_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_streaming_annotate_video @@ -140,7 +148,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_operations_test.rb b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_operations_test.rb index 2710efb149ef..ade81d24ca5b 100644 --- a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_operations_test.rb +++ b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_rest_test.rb b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_rest_test.rb index ebca0348d7dd..b3d7012d38c0 100644 --- a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_rest_test.rb +++ b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -125,7 +133,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_test.rb b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_test.rb index df183b8f8731..627076abf495 100644 --- a/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_test.rb +++ b/google-cloud-video_intelligence-v1p3beta1/test/google/cloud/video_intelligence/v1p3beta1/video_intelligence_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_annotate_video @@ -124,7 +132,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end @@ -142,7 +151,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1/lib/google/cloud/vision/v1/image_annotator/rest/service_stub.rb b/google-cloud-vision-v1/lib/google/cloud/vision/v1/image_annotator/rest/service_stub.rb index 844811f85d20..a69485c40181 100644 --- a/google-cloud-vision-v1/lib/google/cloud/vision/v1/image_annotator/rest/service_stub.rb +++ b/google-cloud-vision-v1/lib/google/cloud/vision/v1/image_annotator/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the batch_annotate_images REST call # diff --git a/google-cloud-vision-v1/lib/google/cloud/vision/v1/product_search/rest/service_stub.rb b/google-cloud-vision-v1/lib/google/cloud/vision/v1/product_search/rest/service_stub.rb index 81a3f40f7787..e4b09f1547f1 100644 --- a/google-cloud-vision-v1/lib/google/cloud/vision/v1/product_search/rest/service_stub.rb +++ b/google-cloud-vision-v1/lib/google/cloud/vision/v1/product_search/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_product_set REST call # diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_operations_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_operations_test.rb index c2b42caa32d4..9da92b5738ef 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_operations_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ImageAnnotator::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_paths_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_paths_test.rb index f7cc8f678af8..3a5a4db30d6f 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_paths_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vision/v1/image_annotator" class ::Google::Cloud::Vision::V1::ImageAnnotator::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_product_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_rest_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_rest_test.rb index 9a6842fcb3c1..4f7b4143c9fe 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_rest_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_annotate_images @@ -287,7 +295,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ImageAnnotator::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_test.rb index 7cd053d46b85..8fc15525bb6f 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/image_annotator_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_annotate_images @@ -303,7 +311,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end @@ -321,7 +330,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_operations_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_operations_test.rb index 8877647e03bb..11d42377a5ff 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_operations_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ProductSearch::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_paths_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_paths_test.rb index 16e6370d0a42..7901eb1de057 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_paths_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vision/v1/product_search" class ::Google::Cloud::Vision::V1::ProductSearch::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_product_path def test_product_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_product_set_path def test_reference_image_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_rest_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_rest_test.rb index 19134ef7c852..f42e3ef55d66 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_rest_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product_set @@ -1113,7 +1121,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ProductSearch::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_test.rb b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_test.rb index 3a54b88dc1ed..bac56944c5c6 100644 --- a/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_test.rb +++ b/google-cloud-vision-v1/test/google/cloud/vision/v1/product_search_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product_set @@ -1226,7 +1234,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -1244,7 +1253,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb b/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb index 3cc9e76d7f1e..16cd91c24a27 100644 --- a/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb +++ b/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the batch_annotate_images REST call # diff --git a/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb b/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb index 9f69eef2874f..bf8344543868 100644 --- a/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb +++ b/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_product_set REST call # diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb index 23dc2aacb8db..cd44c1d39924 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb index 05aecf971454..f0e91bfe13cf 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vision/v1p3beta1/image_annotator" class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_product_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb index be03d60de982..dbca0d0f4b56 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_annotate_images @@ -174,7 +182,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb index da4486be4b64..64467c1160da 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_annotate_images @@ -172,7 +180,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end @@ -190,7 +199,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb index 801fb416c50f..a79630a45fb0 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb index f7a33866b08f..a4faa5822fe5 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vision/v1p3beta1/product_search" class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_product_path def test_product_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_product_set_path def test_reference_image_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb index 0acb68240fd5..d808eb38cc74 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product_set @@ -1057,7 +1065,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb index 9205e99ff934..9c4d72efc791 100644 --- a/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb +++ b/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product_set @@ -1158,7 +1166,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -1176,7 +1185,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb b/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb index 735ac7a150e3..d3f4211ca101 100644 --- a/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb +++ b/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the batch_annotate_images REST call # diff --git a/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb b/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb index 437162d7a742..826915fe2b9a 100644 --- a/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb +++ b/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_product_set REST call # diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb index 0cb161a19017..7ceaa9884258 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb index 97e2a45e4b1a..ce767dc610af 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vision/v1p4beta1/image_annotator" class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_product_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb index e1f49ab53fff..3c9da9f58d17 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_annotate_images @@ -283,7 +291,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb index ce49ebb61021..030821fe4f10 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_batch_annotate_images @@ -295,7 +303,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end @@ -313,7 +322,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb index a3f985453054..166e30d960c1 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb index f00105c2a175..15cb237f4952 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vision/v1p4beta1/product_search" class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_product_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_product_path def test_product_set_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_product_set_path def test_reference_image_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb index 8a8c3528b5c5..5773d9ba1087 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product_set @@ -1113,7 +1121,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb index a56a0979fc69..c71f2f49b878 100644 --- a/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb +++ b/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_product_set @@ -1226,7 +1234,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end @@ -1244,7 +1253,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb b/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb index 5b3b9a0dd87f..4deae2673633 100755 --- a/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb +++ b/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb @@ -163,20 +163,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @vm_migration_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::VMMigration::V1::VmMigration::Stub, credentials: credentials, @@ -187,6 +173,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @vm_migration_stub.endpoint + config.universe_domain = @vm_migration_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @vm_migration_stub.endpoint + config.universe_domain = @vm_migration_stub.universe_domain + end end ## diff --git a/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb b/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb index f6b37cf6feb5..c9bfe3ecd90c 100644 --- a/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb +++ b/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb @@ -160,27 +160,27 @@ def initialize config.universe_domain = @config.universe_domain end + @vm_migration_stub = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @vm_migration_stub.endpoint + config.universe_domain = @vm_migration_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @vm_migration_stub.endpoint + config.universe_domain = @vm_migration_stub.universe_domain end - - @vm_migration_stub = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb b/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb index 9449e2fa5a1b..bc451054ef1b 100644 --- a/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb +++ b/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_sources REST call # diff --git a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb index 8e2fe571ea2d..90461a9e65d9 100755 --- a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb +++ b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VMMigration::V1::VMMigration::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb index 090f508cb629..91b14be173d5 100755 --- a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb +++ b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vm_migration/v1/vm_migration" class ::Google::Cloud::VMMigration::V1::VMMigration::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_clone_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_clone_job_path def test_cutover_job_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_cutover_job_path def test_datacenter_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_datacenter_connector_path def test_group_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_group_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_location_path def test_migrating_vm_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_migrating_vm_path def test_replication_cycle_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_replication_cycle_path def test_source_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_source_path def test_target_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_target_project_path def test_utilization_report_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb index 9b4242daad7e..5f20b154bb81 100644 --- a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb +++ b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_sources @@ -2631,7 +2639,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb index 2ace11329ed1..749feb2d8111 100755 --- a/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb +++ b/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_sources @@ -3061,7 +3069,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end @@ -3079,7 +3088,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb b/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb index 921e6e0c9394..05ceea9abb8c 100644 --- a/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb +++ b/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb @@ -254,20 +254,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @vmware_engine_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Stub, credentials: credentials, @@ -278,6 +264,20 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain + end end ## diff --git a/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb b/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb index 4d316ccbb2de..e871e6ce251f 100644 --- a/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb +++ b/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb @@ -251,28 +251,28 @@ def initialize config.universe_domain = @config.universe_domain end + @vmware_engine_stub = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain + config.endpoint = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain config.bindings_override = @config.bindings_override end - - @vmware_engine_stub = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) end ## diff --git a/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb b/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb index 878a9baa5b38..dba0158a2825 100644 --- a/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb +++ b/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_private_clouds REST call # diff --git a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb index 014b53ddcbc1..864a2b8cfaee 100644 --- a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb +++ b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb index 067ac1c58355..490af185d509 100644 --- a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb +++ b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vmware_engine/v1/vmware_engine" class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_cluster_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_cluster_path def test_hcx_activation_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_hcx_activation_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_location_path def test_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_network_path def test_network_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -85,7 +95,7 @@ def test_network_policy_path def test_node_type_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -97,7 +107,7 @@ def test_node_type_path def test_private_cloud_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -109,7 +119,7 @@ def test_private_cloud_path def test_private_connection_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -121,7 +131,7 @@ def test_private_connection_path def test_subnet_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -133,7 +143,7 @@ def test_subnet_path def test_vmware_engine_network_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb index 3fbe194de3af..715f8edd0ebb 100644 --- a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb +++ b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_private_clouds @@ -2244,7 +2252,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb index 05f69985e1a4..6b08bda5b1eb 100644 --- a/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb +++ b/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_private_clouds @@ -2603,7 +2611,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end @@ -2621,7 +2630,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb b/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb index 33a42c2e54f1..943e32e5898b 100644 --- a/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb +++ b/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb @@ -169,13 +169,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @vpc_access_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::VpcAccess::V1::VpcAccessService::Stub, credentials: credentials, @@ -186,6 +179,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @vpc_access_service_stub.endpoint + config.universe_domain = @vpc_access_service_stub.universe_domain + end end ## diff --git a/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb b/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb index dc882f390434..aabbdc2b4164 100644 --- a/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb +++ b/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb @@ -166,20 +166,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @vpc_access_service_stub = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @vpc_access_service_stub.endpoint + config.universe_domain = @vpc_access_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb b/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb index 8e37b7a5fd39..866d25884f36 100644 --- a/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb +++ b/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_connector REST call # diff --git a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb index 4588fd420be4..402d9d59444e 100644 --- a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb +++ b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb index 035e204c6d9d..bbe99ed7bfe7 100644 --- a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb +++ b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/vpc_access/v1/vpc_access_service" class ::Google::Cloud::VpcAccess::V1::VpcAccessService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_connector_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_connector_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb index 7bb480a2875e..f43e9f5f1196 100644 --- a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb +++ b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_connector @@ -286,7 +294,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb index 08f23988a6f9..63a6f0d7b036 100644 --- a/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb +++ b/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_connector @@ -306,7 +314,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| config.credentials = grpc_channel end @@ -324,7 +333,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb b/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb index d2529614f720..a7eb6ea108fc 100644 --- a/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb +++ b/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the compute_threat_list_diff REST call # diff --git a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb index bbbe90ee17af..20562f8c5edf 100644 --- a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb +++ b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::WebRisk::V1::WebRiskService::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb index 625a9af9095c..f94169e87f68 100644 --- a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb +++ b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/web_risk/v1/web_risk_service" class ::Google::Cloud::WebRisk::V1::WebRiskService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb index 31f88278f5b7..5970d581fd67 100644 --- a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb +++ b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_compute_threat_list_diff @@ -344,7 +352,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb index 30e45ffc0c65..6039c9947e8b 100644 --- a/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb +++ b/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_compute_threat_list_diff @@ -362,7 +370,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| config.credentials = grpc_channel end @@ -380,7 +389,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb b/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb index 5d1da8177965..036a46bf0c2b 100644 --- a/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb +++ b/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the compute_threat_list_diff REST call # diff --git a/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb b/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb index 0cec1d298c3a..d41672d5b285 100644 --- a/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb +++ b/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_compute_threat_list_diff @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb b/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb index 706739fc1559..ea0bacf6ba18 100644 --- a/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb +++ b/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_compute_threat_list_diff @@ -233,7 +241,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb b/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb index 7b6a4cc955b3..7112a3769040 100644 --- a/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb +++ b/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_scan_config REST call # diff --git a/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb b/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb index 272651c92c63..a511d5d6acfd 100644 --- a/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb +++ b/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_scan_config @@ -779,7 +787,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb b/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb index 9fccaae868a6..f5ead914b9af 100644 --- a/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb +++ b/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_scan_config @@ -847,7 +855,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb b/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb index 536e851e9637..82fbb3a45df0 100644 --- a/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb +++ b/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the create_scan_config REST call # diff --git a/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb b/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb index 01680bfc60ed..0b743300e305 100644 --- a/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb +++ b/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/web_security_scanner/v1beta/web_security_scanner" class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_finding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_finding_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_project_path def test_scan_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_scan_config_path def test_scan_run_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb b/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb index 7a5f8056b720..b9f4c8ba06d2 100644 --- a/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb +++ b/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_scan_config @@ -779,7 +787,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb b/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb index 90123c9973ae..b2365028f972 100644 --- a/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb +++ b/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_create_scan_config @@ -847,7 +855,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb b/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb index 3a630eea9f49..3787babdbcdc 100644 --- a/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb +++ b/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_executions REST call # diff --git a/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb b/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb index 083f9588d51d..5e539a330197 100644 --- a/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb +++ b/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/workflows/executions/v1/executions" class ::Google::Cloud::Workflows::Executions::V1::Executions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_execution_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_execution_path def test_workflow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb b/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb index 1411f74e9138..56da2f7a08fe 100644 --- a/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb +++ b/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_executions @@ -289,7 +297,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb b/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb index 634a697c778c..96e68ebcd55c 100644 --- a/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb +++ b/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_executions @@ -302,7 +310,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb b/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb index e78142299f2c..a14a312f0943 100644 --- a/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb +++ b/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/workflows/executions/v1beta/executions" class ::Google::Cloud::Workflows::Executions::V1beta::Executions::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_execution_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_execution_path def test_workflow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb b/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb index 961fdc9743d6..7685498b7c94 100644 --- a/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb +++ b/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_executions @@ -298,7 +306,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb b/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb index 1e6306c4b27d..de35a6113424 100644 --- a/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb +++ b/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb @@ -156,13 +156,6 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - @workflows_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Workflows::V1::Workflows::Stub, credentials: credentials, @@ -173,6 +166,13 @@ def initialize interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflows_stub.endpoint + config.universe_domain = @workflows_stub.universe_domain + end end ## diff --git a/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb b/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb index 9c7d641ddf69..6183372276dd 100644 --- a/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb +++ b/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb @@ -153,20 +153,20 @@ def initialize config.universe_domain = @config.universe_domain end - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - @workflows_stub = ::Google::Cloud::Workflows::V1::Workflows::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflows_stub.endpoint + config.universe_domain = @workflows_stub.universe_domain + config.bindings_override = @config.bindings_override + end end ## diff --git a/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb b/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb index b1e487e110ee..1099f04afd8a 100644 --- a/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb +++ b/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_workflows REST call # diff --git a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb index 914c72b0d6a7..c07064a79041 100644 --- a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb +++ b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1::Workflows::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb index a522159e009e..6b952f65aaba 100644 --- a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb +++ b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/workflows/v1/workflows" class ::Google::Cloud::Workflows::V1::Workflows::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_crypto_key_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_crypto_key_path def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_location_path def test_workflow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb index 98a3cd84e019..e3dbef7f441b 100644 --- a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb +++ b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_workflows @@ -344,7 +352,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb index 76aba4fc65e2..f250d96217a6 100644 --- a/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb +++ b/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_workflows @@ -377,7 +385,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| config.credentials = grpc_channel end @@ -395,7 +404,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb b/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb index 7a116cdda49c..20f40ffcb43a 100644 --- a/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb +++ b/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_workflows REST call # diff --git a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb index 32aecff64549..611311f5e413 100644 --- a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb +++ b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1beta::Workflows::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb index be247dd27c53..e89c7f6593d0 100644 --- a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb +++ b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb @@ -23,9 +23,19 @@ require "google/cloud/workflows/v1beta/workflows" class ::Google::Cloud::Workflows::V1beta::Workflows::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_location_path def test_workflow_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb index 0bc658527846..ab4df5306fda 100644 --- a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb +++ b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_workflows @@ -343,7 +351,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb index 6c142c3b188c..e860cbe88222 100644 --- a/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb +++ b/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_workflows @@ -375,7 +383,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| config.credentials = grpc_channel end @@ -393,7 +402,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb b/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb index 829db205ea45..a5a52d93618a 100644 --- a/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb +++ b/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the generate_access_token REST call # diff --git a/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb b/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb index 672c47976229..ce11ebfa7087 100644 --- a/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb +++ b/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb @@ -23,9 +23,19 @@ require "google/iam/credentials/v1/iam_credentials" class ::Google::Iam::Credentials::V1::IAMCredentials::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_service_account_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb b/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb index 304998426bf6..550ba696ec84 100644 --- a/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb +++ b/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_generate_access_token @@ -292,7 +300,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb b/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb index 5654e5ec3709..c48f5b1190bb 100644 --- a/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb +++ b/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_generate_access_token @@ -303,7 +311,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb index c9acf5b17ab2..6b88d8157ba8 100644 --- a/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb +++ b/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb @@ -51,6 +51,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the set_iam_policy REST call # diff --git a/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb b/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb index 28b7f766256f..96cbd79b10f1 100644 --- a/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb +++ b/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -232,7 +240,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-iam-v1/test/google/iam/v1/iam_policy_test.rb b/google-iam-v1/test/google/iam/v1/iam_policy_test.rb index 44f5f82b5375..6ca26a2312ef 100644 --- a/google-iam-v1/test/google/iam/v1/iam_policy_test.rb +++ b/google-iam-v1/test/google/iam/v1/iam_policy_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_set_iam_policy @@ -233,7 +241,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb b/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb index ca7fe9f2e882..a70d6d458b3d 100644 --- a/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb +++ b/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V1beta::WorkloadIdentityPools::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb b/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb index 757a5b1470af..05fbd19fd9ee 100644 --- a/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb +++ b/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb @@ -23,9 +23,19 @@ require "google/iam/v1beta/workload_identity_pools" class ::Google::Iam::V1beta::WorkloadIdentityPools::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_project_path def test_workload_identity_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_workload_identity_pool_path def test_workload_identity_pool_provider_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb b/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb index b044be5c03ee..ce3ae8cdf270 100644 --- a/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb +++ b/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_workload_identity_pools @@ -821,7 +829,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| config.credentials = grpc_channel end @@ -839,7 +848,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb b/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb index 4fb37aec0719..ae8599d21720 100644 --- a/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb +++ b/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb @@ -51,6 +51,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_policies REST call # diff --git a/google-iam-v2/test/google/iam/v2/policies_operations_test.rb b/google-iam-v2/test/google/iam/v2/policies_operations_test.rb index 2842acecf848..f77026962b9c 100644 --- a/google-iam-v2/test/google/iam/v2/policies_operations_test.rb +++ b/google-iam-v2/test/google/iam/v2/policies_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V2::Policies::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-iam-v2/test/google/iam/v2/policies_rest_test.rb b/google-iam-v2/test/google/iam/v2/policies_rest_test.rb index 861cd90eab95..741fee6875fd 100644 --- a/google-iam-v2/test/google/iam/v2/policies_rest_test.rb +++ b/google-iam-v2/test/google/iam/v2/policies_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_policies @@ -341,7 +349,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-iam-v2/test/google/iam/v2/policies_test.rb b/google-iam-v2/test/google/iam/v2/policies_test.rb index 921107f7aaa3..997d26af8fe6 100644 --- a/google-iam-v2/test/google/iam/v2/policies_test.rb +++ b/google-iam-v2/test/google/iam/v2/policies_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_policies @@ -371,7 +379,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V2::Policies::Client.new do |config| config.credentials = grpc_channel end @@ -389,7 +398,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Iam::V2::Policies::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/rest/service_stub.rb b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/rest/service_stub.rb index 27a9d3566d82..2928280ecd35 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/rest/service_stub.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/rest/service_stub.rb @@ -52,6 +52,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_access_policies REST call # diff --git a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_operations_test.rb b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_operations_test.rb index 845ec1648fcc..c96ef8d1f8df 100644 --- a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_operations_test.rb +++ b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_operations_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_operations @@ -364,7 +372,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Operations.new do |config| config.credentials = grpc_channel end diff --git a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_paths_test.rb b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_paths_test.rb index b79b66f8b756..abb78ae8e3c4 100644 --- a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_paths_test.rb +++ b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_paths_test.rb @@ -23,9 +23,19 @@ require "google/identity/access_context_manager/v1/access_context_manager" class ::Google::Identity::AccessContextManager::V1::AccessContextManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_access_level_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_access_level_path def test_access_policy_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_access_policy_path def test_gcp_user_access_binding_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end @@ -61,7 +71,7 @@ def test_gcp_user_access_binding_path def test_organization_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end @@ -73,7 +83,7 @@ def test_organization_path def test_service_perimeter_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_rest_test.rb b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_rest_test.rb index 7ea8483944e9..8ebce009f73b 100644 --- a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_rest_test.rb +++ b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_access_policies @@ -1502,7 +1510,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb index 07552eb40d88..7feb6343074d 100644 --- a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb +++ b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_access_policies @@ -1718,7 +1726,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end @@ -1736,7 +1745,8 @@ def test_operations_client grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/service_stub.rb b/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/service_stub.rb index 9ea92344dc23..a1a69553c24e 100644 --- a/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/service_stub.rb +++ b/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/local_inventory_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_local_inventories REST call # diff --git a/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest/service_stub.rb b/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest/service_stub.rb index 3451d6adb476..34e43d2993e0 100644 --- a/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest/service_stub.rb +++ b/google-shopping-merchant-inventories-v1beta/lib/google/shopping/merchant/inventories/v1beta/regional_inventory_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the list_regional_inventories REST call # diff --git a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_paths_test.rb b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_paths_test.rb index 9a5e2832d606..a6ef41d5a9bb 100644 --- a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_paths_test.rb +++ b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/shopping/merchant/inventories/v1beta/local_inventory_service" class ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_local_inventory_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_rest_test.rb b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_rest_test.rb index 7926f5b9d9e1..bbbc3aff9624 100644 --- a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_rest_test.rb +++ b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_local_inventories @@ -231,7 +239,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_test.rb b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_test.rb index 93c190b85e2b..af46f987faaf 100644 --- a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_test.rb +++ b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/local_inventory_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_local_inventories @@ -236,7 +244,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Shopping::Merchant::Inventories::V1beta::LocalInventoryService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_paths_test.rb b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_paths_test.rb index a1c5b73fa5f3..6a121c2d90b5 100644 --- a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_paths_test.rb +++ b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_paths_test.rb @@ -23,9 +23,19 @@ require "google/shopping/merchant/inventories/v1beta/regional_inventory_service" class ::Google::Shopping::Merchant::Inventories::V1beta::RegionalInventoryService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_regional_inventory_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Google::Shopping::Merchant::Inventories::V1beta::RegionalInventoryService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_rest_test.rb b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_rest_test.rb index 04133471f397..b3b1790a16ec 100644 --- a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_rest_test.rb +++ b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_regional_inventories @@ -231,7 +239,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Shopping::Merchant::Inventories::V1beta::RegionalInventoryService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_test.rb b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_test.rb index f09e27802ea6..52d5d4c4d9d4 100644 --- a/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_test.rb +++ b/google-shopping-merchant-inventories-v1beta/test/google/shopping/merchant/inventories/v1beta/regional_inventory_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_list_regional_inventories @@ -236,7 +244,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Shopping::Merchant::Inventories::V1beta::RegionalInventoryService::Client.new do |config| config.credentials = grpc_channel end diff --git a/google-shopping-merchant-reports-v1beta/lib/google/shopping/merchant/reports/v1beta/report_service/rest/service_stub.rb b/google-shopping-merchant-reports-v1beta/lib/google/shopping/merchant/reports/v1beta/report_service/rest/service_stub.rb index 49f2df421bdc..288f88db4b50 100644 --- a/google-shopping-merchant-reports-v1beta/lib/google/shopping/merchant/reports/v1beta/report_service/rest/service_stub.rb +++ b/google-shopping-merchant-reports-v1beta/lib/google/shopping/merchant/reports/v1beta/report_service/rest/service_stub.rb @@ -53,6 +53,15 @@ def universe_domain @client_stub.universe_domain end + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + ## # Baseline implementation for the search REST call # diff --git a/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_rest_test.rb b/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_rest_test.rb index b5e735c00f8c..555ebce31cfe 100644 --- a/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_rest_test.rb +++ b/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_rest_test.rb @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -123,7 +131,8 @@ def test_configure credentials_token = :dummy_value client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do client = ::Google::Shopping::Merchant::Reports::V1beta::ReportService::Rest::Client.new do |config| config.credentials = credentials_token end diff --git a/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_test.rb b/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_test.rb index 5a7668f572be..59abbbad88aa 100644 --- a/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_test.rb +++ b/google-shopping-merchant-reports-v1beta/test/google/shopping/merchant/reports/v1beta/report_service_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_search @@ -120,7 +128,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Google::Shopping::Merchant::Reports::V1beta::ReportService::Client.new do |config| config.credentials = grpc_channel end diff --git a/grafeas-v1/test/grafeas/v1/grafeas_paths_test.rb b/grafeas-v1/test/grafeas/v1/grafeas_paths_test.rb index c088f38271ec..4c84ccb6536a 100644 --- a/grafeas-v1/test/grafeas/v1/grafeas_paths_test.rb +++ b/grafeas-v1/test/grafeas/v1/grafeas_paths_test.rb @@ -23,9 +23,19 @@ require "grafeas/v1/grafeas" class ::Grafeas::V1::Grafeas::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + def test_note_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Grafeas::V1::Grafeas::Client.new do |config| config.credentials = grpc_channel end @@ -37,7 +47,7 @@ def test_note_path def test_occurrence_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Grafeas::V1::Grafeas::Client.new do |config| config.credentials = grpc_channel end @@ -49,7 +59,7 @@ def test_occurrence_path def test_project_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do + ::Gapic::ServiceStub.stub :new, DummyStub.new do client = ::Grafeas::V1::Grafeas::Client.new do |config| config.credentials = grpc_channel end diff --git a/grafeas-v1/test/grafeas/v1/grafeas_test.rb b/grafeas-v1/test/grafeas/v1/grafeas_test.rb index f4308d2a0892..dc483b5f838d 100644 --- a/grafeas-v1/test/grafeas/v1/grafeas_test.rb +++ b/grafeas-v1/test/grafeas/v1/grafeas_test.rb @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs @response end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end end def test_get_occurrence @@ -914,7 +922,8 @@ def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do client = ::Grafeas::V1::Grafeas::Client.new do |config| config.credentials = grpc_channel end