From 13537fcd6e3c552199d5057daf3b00c24033c908 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:50:27 -0700 Subject: [PATCH] fix: [Many APIs] simplify logic for HTTP/1.1 REST fallback option (#4584) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: simplify logic for HTTP/1.1 REST fallback option For the `fallback` parameter, all values considered as `true` in Boolean context will enable HTTP/1.1 REST fallback, since the other fallback transport, proto over HTTP, is removed from `google-gax` v4. PiperOrigin-RevId: 559812260 Source-Link: https://github.com/googleapis/googleapis/commit/6a6fd29a79fe2846001d90d93e79a19fcc303b85 Source-Link: https://github.com/googleapis/googleapis-gen/commit/56c16657e7a59122b1da94771a9ef40989c282c0 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwY29ubmVjdG9ycy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtYXBwZ2F0ZXdheXMvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtY2xpZW50Y29ubmVjdG9yc2VydmljZXMvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJleW9uZGNvcnAtY2xpZW50Z2F0ZXdheXMvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWFuYWx5dGljc2h1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWNvbm5lY3Rpb24vLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWRhdGFleGNoYW5nZS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWRhdGFwb2xpY2llcy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LWRhdGF0cmFuc2Zlci8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LXJlc2VydmF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmctYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmcvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbmFyeWF1dGhvcml6YXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNlcnRpZmljYXRlbWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNoYW5uZWwvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNsb3VkZG1zLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbW1lcmNlLWNvbnN1bWVyLXByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbXB1dGUvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZGVudGlhbGNvbXB1dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3RjZW50ZXJpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../src/v1/app_connectors_service_client.ts | 9 ++++----- .../src/v1/app_gateways_service_client.ts | 9 ++++----- ...lient_connector_services_service_client.ts | 9 ++++----- .../samples/quickstart.js | 5 +++-- .../src/v1/client_gateways_service_client.ts | 9 ++++----- .../src/v1/analytics_hub_service_client.ts | 7 +++---- .../src/v1/connection_service_client.ts | 7 +++---- .../src/v1beta1/connection_service_client.ts | 7 +++---- .../v1beta1/analytics_hub_service_client.ts | 7 +++---- .../src/v1/data_policy_service_client.ts | 7 +++---- .../src/v1beta1/data_policy_service_client.ts | 7 +++---- .../src/v1/data_transfer_service_client.ts | 7 +++---- .../src/v1/reservation_service_client.ts | 7 +++---- .../src/v1/budget_service_client.ts | 7 +++---- .../src/v1beta1/budget_service_client.ts | 7 +++---- .../src/v1/cloud_billing_client.ts | 7 +++---- .../src/v1/cloud_catalog_client.ts | 7 +++---- .../binauthz_management_service_v1_client.ts | 7 +++---- .../src/v1/system_policy_v1_client.ts | 7 +++---- .../src/v1/validation_helper_v1_client.ts | 7 +++---- ...uthz_management_service_v1_beta1_client.ts | 7 +++---- .../v1beta1/system_policy_v1_beta1_client.ts | 7 +++---- .../samples/quickstart.js | 5 +++-- .../src/v1/certificate_manager_client.ts | 9 ++++----- .../cloud_channel_reports_service_client.ts | 9 ++++----- .../src/v1/cloud_channel_service_client.ts | 9 ++++----- .../test/gapic_cloud_channel_service_v1.ts | 20 +++++++++++-------- .../src/v1/data_migration_service_client.ts | 9 ++++----- .../test/gapic_data_migration_service_v1.ts | 5 +++-- .../v1/consumer_procurement_service_client.ts | 9 ++++----- .../consumer_procurement_service_client.ts | 9 ++++----- .../src/v1/accelerator_types_client.ts | 13 ++++++------ .../src/v1/addresses_client.ts | 13 ++++++------ .../src/v1/autoscalers_client.ts | 13 ++++++------ .../src/v1/backend_buckets_client.ts | 13 ++++++------ .../src/v1/backend_services_client.ts | 13 ++++++------ .../src/v1/disk_types_client.ts | 13 ++++++------ .../src/v1/disks_client.ts | 13 ++++++------ .../src/v1/external_vpn_gateways_client.ts | 13 ++++++------ .../src/v1/firewall_policies_client.ts | 13 ++++++------ .../src/v1/firewalls_client.ts | 13 ++++++------ .../src/v1/forwarding_rules_client.ts | 13 ++++++------ .../src/v1/global_addresses_client.ts | 13 ++++++------ .../src/v1/global_forwarding_rules_client.ts | 13 ++++++------ .../global_network_endpoint_groups_client.ts | 13 ++++++------ .../src/v1/global_operations_client.ts | 13 ++++++------ .../global_organization_operations_client.ts | 13 ++++++------ ...global_public_delegated_prefixes_client.ts | 13 ++++++------ .../src/v1/health_checks_client.ts | 13 ++++++------ .../src/v1/image_family_views_client.ts | 13 ++++++------ .../src/v1/images_client.ts | 13 ++++++------ .../src/v1/instance_group_managers_client.ts | 13 ++++++------ .../src/v1/instance_groups_client.ts | 13 ++++++------ .../src/v1/instance_templates_client.ts | 13 ++++++------ .../src/v1/instances_client.ts | 13 ++++++------ .../src/v1/interconnect_attachments_client.ts | 13 ++++++------ .../src/v1/interconnect_locations_client.ts | 13 ++++++------ .../interconnect_remote_locations_client.ts | 13 ++++++------ .../src/v1/interconnects_client.ts | 13 ++++++------ .../src/v1/license_codes_client.ts | 13 ++++++------ .../src/v1/licenses_client.ts | 13 ++++++------ .../src/v1/machine_images_client.ts | 13 ++++++------ .../src/v1/machine_types_client.ts | 13 ++++++------ .../src/v1/network_attachments_client.ts | 13 ++++++------ .../network_edge_security_services_client.ts | 13 ++++++------ .../src/v1/network_endpoint_groups_client.ts | 13 ++++++------ .../v1/network_firewall_policies_client.ts | 13 ++++++------ .../src/v1/networks_client.ts | 13 ++++++------ .../src/v1/node_groups_client.ts | 13 ++++++------ .../src/v1/node_templates_client.ts | 13 ++++++------ .../src/v1/node_types_client.ts | 13 ++++++------ .../src/v1/packet_mirrorings_client.ts | 13 ++++++------ .../src/v1/projects_client.ts | 13 ++++++------ .../v1/public_advertised_prefixes_client.ts | 13 ++++++------ .../v1/public_delegated_prefixes_client.ts | 13 ++++++------ .../src/v1/region_autoscalers_client.ts | 13 ++++++------ .../src/v1/region_backend_services_client.ts | 13 ++++++------ .../src/v1/region_commitments_client.ts | 13 ++++++------ .../src/v1/region_disk_types_client.ts | 13 ++++++------ .../src/v1/region_disks_client.ts | 13 ++++++------ .../v1/region_health_check_services_client.ts | 13 ++++++------ .../src/v1/region_health_checks_client.ts | 13 ++++++------ .../region_instance_group_managers_client.ts | 13 ++++++------ .../src/v1/region_instance_groups_client.ts | 13 ++++++------ .../v1/region_instance_templates_client.ts | 13 ++++++------ .../src/v1/region_instances_client.ts | 13 ++++++------ .../region_network_endpoint_groups_client.ts | 13 ++++++------ ...region_network_firewall_policies_client.ts | 13 ++++++------ .../region_notification_endpoints_client.ts | 13 ++++++------ .../src/v1/region_operations_client.ts | 13 ++++++------ .../src/v1/region_security_policies_client.ts | 13 ++++++------ .../src/v1/region_ssl_certificates_client.ts | 13 ++++++------ .../src/v1/region_ssl_policies_client.ts | 13 ++++++------ .../v1/region_target_http_proxies_client.ts | 13 ++++++------ .../v1/region_target_https_proxies_client.ts | 13 ++++++------ .../v1/region_target_tcp_proxies_client.ts | 13 ++++++------ .../src/v1/region_url_maps_client.ts | 13 ++++++------ .../src/v1/regions_client.ts | 13 ++++++------ .../src/v1/reservations_client.ts | 13 ++++++------ .../src/v1/resource_policies_client.ts | 13 ++++++------ .../src/v1/routers_client.ts | 13 ++++++------ .../src/v1/routes_client.ts | 13 ++++++------ .../src/v1/security_policies_client.ts | 13 ++++++------ .../src/v1/service_attachments_client.ts | 13 ++++++------ .../src/v1/snapshots_client.ts | 13 ++++++------ .../src/v1/ssl_certificates_client.ts | 13 ++++++------ .../src/v1/ssl_policies_client.ts | 13 ++++++------ .../src/v1/subnetworks_client.ts | 13 ++++++------ .../src/v1/target_grpc_proxies_client.ts | 13 ++++++------ .../src/v1/target_http_proxies_client.ts | 13 ++++++------ .../src/v1/target_https_proxies_client.ts | 13 ++++++------ .../src/v1/target_instances_client.ts | 13 ++++++------ .../src/v1/target_pools_client.ts | 13 ++++++------ .../src/v1/target_ssl_proxies_client.ts | 13 ++++++------ .../src/v1/target_tcp_proxies_client.ts | 13 ++++++------ .../src/v1/target_vpn_gateways_client.ts | 13 ++++++------ .../src/v1/url_maps_client.ts | 13 ++++++------ .../src/v1/vpn_gateways_client.ts | 13 ++++++------ .../src/v1/vpn_tunnels_client.ts | 13 ++++++------ .../src/v1/zone_operations_client.ts | 13 ++++++------ .../src/v1/zones_client.ts | 13 ++++++------ .../src/v1small/addresses_client.ts | 13 ++++++------ .../src/v1small/region_operations_client.ts | 13 ++++++------ .../test/gapic_instances_v1.ts | 5 +++-- .../src/v1/confidential_computing_client.ts | 7 +++---- .../v1alpha1/confidential_computing_client.ts | 7 +++---- .../src/v1/contact_center_insights_client.ts | 9 ++++----- 127 files changed, 677 insertions(+), 791 deletions(-) diff --git a/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts b/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts index d5890308d13..fb984ccbc17 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts @@ -112,8 +112,7 @@ export class AppConnectorsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -121,7 +120,7 @@ export class AppConnectorsServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AppConnectorsServiceClient({fallback: 'rest'}, gax); + * const client = new AppConnectorsServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -193,7 +192,7 @@ export class AppConnectorsServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -236,7 +235,7 @@ export class AppConnectorsServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts b/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts index 18f293372bf..a8896eb2450 100644 --- a/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts +++ b/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts @@ -112,8 +112,7 @@ export class AppGatewaysServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -121,7 +120,7 @@ export class AppGatewaysServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AppGatewaysServiceClient({fallback: 'rest'}, gax); + * const client = new AppGatewaysServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -193,7 +192,7 @@ export class AppGatewaysServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -236,7 +235,7 @@ export class AppGatewaysServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts index 5ca9951cd8f..20269d5b7ad 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts @@ -109,8 +109,7 @@ export class ClientConnectorServicesServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -118,7 +117,7 @@ export class ClientConnectorServicesServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ClientConnectorServicesServiceClient({fallback: 'rest'}, gax); + * const client = new ClientConnectorServicesServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -191,7 +190,7 @@ export class ClientConnectorServicesServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -234,7 +233,7 @@ export class ClientConnectorServicesServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/quickstart.js b/packages/google-cloud-beyondcorp-clientgateways/samples/quickstart.js index 75986c795b3..181d9cfd7c2 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/quickstart.js +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/quickstart.js @@ -59,8 +59,9 @@ function main(parent) { }; // Run request - const iterable = - await clientgatewaysClient.listClientGatewaysAsync(request); + const iterable = await clientgatewaysClient.listClientGatewaysAsync( + request + ); for await (const response of iterable) { console.log(response); } diff --git a/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts b/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts index 4226c89c89f..7e573f6583d 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts @@ -109,8 +109,7 @@ export class ClientGatewaysServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -118,7 +117,7 @@ export class ClientGatewaysServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ClientGatewaysServiceClient({fallback: 'rest'}, gax); + * const client = new ClientGatewaysServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -191,7 +190,7 @@ export class ClientGatewaysServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -234,7 +233,7 @@ export class ClientGatewaysServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts b/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts index acce9c5611d..65674c467fe 100644 --- a/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts +++ b/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts @@ -95,8 +95,7 @@ export class AnalyticsHubServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -104,7 +103,7 @@ export class AnalyticsHubServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AnalyticsHubServiceClient({fallback: 'rest'}, gax); + * const client = new AnalyticsHubServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -167,7 +166,7 @@ export class AnalyticsHubServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts b/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts index 783cb1b535a..6657a942b02 100644 --- a/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts +++ b/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts @@ -90,8 +90,7 @@ export class ConnectionServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ConnectionServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ConnectionServiceClient({fallback: 'rest'}, gax); + * const client = new ConnectionServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class ConnectionServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts b/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts index 4f0ff0ed566..c53c843abb5 100644 --- a/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts +++ b/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts @@ -88,8 +88,7 @@ export class ConnectionServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -97,7 +96,7 @@ export class ConnectionServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ConnectionServiceClient({fallback: 'rest'}, gax); + * const client = new ConnectionServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class ConnectionServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts index f6cffeb9237..5968bc05e69 100644 --- a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts @@ -98,8 +98,7 @@ export class AnalyticsHubServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -107,7 +106,7 @@ export class AnalyticsHubServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AnalyticsHubServiceClient({fallback: 'rest'}, gax); + * const client = new AnalyticsHubServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -174,7 +173,7 @@ export class AnalyticsHubServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts b/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts index 8ed31504503..f7e229c131b 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts @@ -90,8 +90,7 @@ export class DataPolicyServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class DataPolicyServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DataPolicyServiceClient({fallback: 'rest'}, gax); + * const client = new DataPolicyServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class DataPolicyServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts index 350a6f72ae8..d8b6317a635 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts @@ -90,8 +90,7 @@ export class DataPolicyServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class DataPolicyServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DataPolicyServiceClient({fallback: 'rest'}, gax); + * const client = new DataPolicyServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -162,7 +161,7 @@ export class DataPolicyServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts index 3313e0c0d22..b4abf380753 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts @@ -93,8 +93,7 @@ export class DataTransferServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -102,7 +101,7 @@ export class DataTransferServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DataTransferServiceClient({fallback: 'rest'}, gax); + * const client = new DataTransferServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -172,7 +171,7 @@ export class DataTransferServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 922aed4fb59..18bcdde4a00 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -104,8 +104,7 @@ export class ReservationServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -113,7 +112,7 @@ export class ReservationServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ReservationServiceClient({fallback: 'rest'}, gax); + * const client = new ReservationServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -179,7 +178,7 @@ export class ReservationServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts b/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts index a09e9dcc8e4..b978d9d8ecc 100644 --- a/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts +++ b/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts @@ -91,8 +91,7 @@ export class BudgetServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -100,7 +99,7 @@ export class BudgetServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BudgetServiceClient({fallback: 'rest'}, gax); + * const client = new BudgetServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class BudgetServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts b/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts index 9fd51445eb5..57d36296a56 100644 --- a/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts +++ b/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts @@ -91,8 +91,7 @@ export class BudgetServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -100,7 +99,7 @@ export class BudgetServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BudgetServiceClient({fallback: 'rest'}, gax); + * const client = new BudgetServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class BudgetServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-billing/src/v1/cloud_billing_client.ts b/packages/google-cloud-billing/src/v1/cloud_billing_client.ts index dc26593549f..7e2732d48bb 100644 --- a/packages/google-cloud-billing/src/v1/cloud_billing_client.ts +++ b/packages/google-cloud-billing/src/v1/cloud_billing_client.ts @@ -91,8 +91,7 @@ export class CloudBillingClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -100,7 +99,7 @@ export class CloudBillingClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CloudBillingClient({fallback: 'rest'}, gax); + * const client = new CloudBillingClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class CloudBillingClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts b/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts index 12a843271b7..756c45b9f50 100644 --- a/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts +++ b/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts @@ -92,8 +92,7 @@ export class CloudCatalogClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -101,7 +100,7 @@ export class CloudCatalogClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CloudCatalogClient({fallback: 'rest'}, gax); + * const client = new CloudCatalogClient({fallback: true}, gax); * ``` */ constructor( @@ -167,7 +166,7 @@ export class CloudCatalogClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts index 208c4ceaa5d..ede64d31892 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts @@ -96,8 +96,7 @@ export class BinauthzManagementServiceV1Client { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -105,7 +104,7 @@ export class BinauthzManagementServiceV1Client { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BinauthzManagementServiceV1Client({fallback: 'rest'}, gax); + * const client = new BinauthzManagementServiceV1Client({fallback: true}, gax); * ``` */ constructor( @@ -172,7 +171,7 @@ export class BinauthzManagementServiceV1Client { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts index 9936fcfb7c4..141fac93942 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts @@ -88,8 +88,7 @@ export class SystemPolicyV1Client { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -97,7 +96,7 @@ export class SystemPolicyV1Client { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SystemPolicyV1Client({fallback: 'rest'}, gax); + * const client = new SystemPolicyV1Client({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class SystemPolicyV1Client { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts index 56428859586..43d809436d1 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts @@ -88,8 +88,7 @@ export class ValidationHelperV1Client { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -97,7 +96,7 @@ export class ValidationHelperV1Client { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ValidationHelperV1Client({fallback: 'rest'}, gax); + * const client = new ValidationHelperV1Client({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class ValidationHelperV1Client { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 80896a1be2b..87aab7ff492 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -96,8 +96,7 @@ export class BinauthzManagementServiceV1Beta1Client { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -105,7 +104,7 @@ export class BinauthzManagementServiceV1Beta1Client { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BinauthzManagementServiceV1Beta1Client({fallback: 'rest'}, gax); + * const client = new BinauthzManagementServiceV1Beta1Client({fallback: true}, gax); * ``` */ constructor( @@ -172,7 +171,7 @@ export class BinauthzManagementServiceV1Beta1Client { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts index 9496b09ed9b..84c97a2ed5c 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts @@ -88,8 +88,7 @@ export class SystemPolicyV1Beta1Client { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -97,7 +96,7 @@ export class SystemPolicyV1Beta1Client { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SystemPolicyV1Beta1Client({fallback: 'rest'}, gax); + * const client = new SystemPolicyV1Beta1Client({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class SystemPolicyV1Beta1Client { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-certificatemanager/samples/quickstart.js b/packages/google-cloud-certificatemanager/samples/quickstart.js index bbf543a71e5..84d9c417431 100644 --- a/packages/google-cloud-certificatemanager/samples/quickstart.js +++ b/packages/google-cloud-certificatemanager/samples/quickstart.js @@ -63,8 +63,9 @@ function main(parent) { }; // Run request - const iterable = - await certificatemanagerClient.listCertificatesAsync(request); + const iterable = await certificatemanagerClient.listCertificatesAsync( + request + ); for await (const response of iterable) { console.log(response); } diff --git a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts index e4c7e9b9899..075255693de 100644 --- a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts +++ b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts @@ -121,8 +121,7 @@ export class CertificateManagerClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -130,7 +129,7 @@ export class CertificateManagerClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CertificateManagerClient({fallback: 'rest'}, gax); + * const client = new CertificateManagerClient({fallback: true}, gax); * ``` */ constructor( @@ -200,7 +199,7 @@ export class CertificateManagerClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -272,7 +271,7 @@ export class CertificateManagerClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts index 83c6a2f108a..3f6d39c30ad 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts @@ -95,8 +95,7 @@ export class CloudChannelReportsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -104,7 +103,7 @@ export class CloudChannelReportsServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CloudChannelReportsServiceClient({fallback: 'rest'}, gax); + * const client = new CloudChannelReportsServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -171,7 +170,7 @@ export class CloudChannelReportsServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -244,7 +243,7 @@ export class CloudChannelReportsServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts index 00e4674ed7f..fab52333d5b 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts @@ -112,8 +112,7 @@ export class CloudChannelServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -121,7 +120,7 @@ export class CloudChannelServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new CloudChannelServiceClient({fallback: 'rest'}, gax); + * const client = new CloudChannelServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -187,7 +186,7 @@ export class CloudChannelServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -330,7 +329,7 @@ export class CloudChannelServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts b/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts index 63af4b21753..c2d06909a9e 100644 --- a/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts +++ b/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts @@ -2436,8 +2436,9 @@ describe('v1.CloudChannelServiceClient', () => { ); client.innerApiCalls.createChannelPartnerRepricingConfig = stubSimpleCall(expectedResponse); - const [response] = - await client.createChannelPartnerRepricingConfig(request); + const [response] = await client.createChannelPartnerRepricingConfig( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub @@ -2583,8 +2584,9 @@ describe('v1.CloudChannelServiceClient', () => { ); client.innerApiCalls.updateChannelPartnerRepricingConfig = stubSimpleCall(expectedResponse); - const [response] = - await client.updateChannelPartnerRepricingConfig(request); + const [response] = await client.updateChannelPartnerRepricingConfig( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub @@ -2732,8 +2734,9 @@ describe('v1.CloudChannelServiceClient', () => { ); client.innerApiCalls.deleteChannelPartnerRepricingConfig = stubSimpleCall(expectedResponse); - const [response] = - await client.deleteChannelPartnerRepricingConfig(request); + const [response] = await client.deleteChannelPartnerRepricingConfig( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub @@ -7656,8 +7659,9 @@ describe('v1.CloudChannelServiceClient', () => { ]; client.innerApiCalls.listChannelPartnerRepricingConfigs = stubSimpleCall(expectedResponse); - const [response] = - await client.listChannelPartnerRepricingConfigs(request); + const [response] = await client.listChannelPartnerRepricingConfigs( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts index 079a387f963..13412c84bf3 100644 --- a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts @@ -99,8 +99,7 @@ export class DataMigrationServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -108,7 +107,7 @@ export class DataMigrationServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DataMigrationServiceClient({fallback: 'rest'}, gax); + * const client = new DataMigrationServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -180,7 +179,7 @@ export class DataMigrationServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -257,7 +256,7 @@ export class DataMigrationServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts index efda9ca373b..2983ee96829 100644 --- a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts +++ b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts @@ -1109,8 +1109,9 @@ describe('v1.DataMigrationServiceClient', () => { ); client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCall(expectedResponse); - const [response] = - await client.describeConversionWorkspaceRevisions(request); + const [response] = await client.describeConversionWorkspaceRevisions( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts index 1f82316e032..b6ba2a56d3c 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts @@ -102,8 +102,7 @@ export class ConsumerProcurementServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -111,7 +110,7 @@ export class ConsumerProcurementServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ConsumerProcurementServiceClient({fallback: 'rest'}, gax); + * const client = new ConsumerProcurementServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -178,7 +177,7 @@ export class ConsumerProcurementServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -218,7 +217,7 @@ export class ConsumerProcurementServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts index f10f954914d..6efb019f53c 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts @@ -102,8 +102,7 @@ export class ConsumerProcurementServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -111,7 +110,7 @@ export class ConsumerProcurementServiceClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ConsumerProcurementServiceClient({fallback: 'rest'}, gax); + * const client = new ConsumerProcurementServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -178,7 +177,7 @@ export class ConsumerProcurementServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -218,7 +217,7 @@ export class ConsumerProcurementServiceClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/packages/google-cloud-compute/src/v1/accelerator_types_client.ts b/packages/google-cloud-compute/src/v1/accelerator_types_client.ts index 17e24a7b507..cb4c931ad14 100644 --- a/packages/google-cloud-compute/src/v1/accelerator_types_client.ts +++ b/packages/google-cloud-compute/src/v1/accelerator_types_client.ts @@ -92,8 +92,7 @@ export class AcceleratorTypesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -101,7 +100,7 @@ export class AcceleratorTypesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AcceleratorTypesClient({fallback: 'rest'}, gax); + * const client = new AcceleratorTypesClient({fallback: true}, gax); * ``` */ constructor( @@ -117,11 +116,11 @@ export class AcceleratorTypesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -167,7 +166,7 @@ export class AcceleratorTypesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/addresses_client.ts b/packages/google-cloud-compute/src/v1/addresses_client.ts index 3d6c98969d3..4721d48d0c1 100644 --- a/packages/google-cloud-compute/src/v1/addresses_client.ts +++ b/packages/google-cloud-compute/src/v1/addresses_client.ts @@ -90,8 +90,7 @@ export class AddressesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class AddressesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AddressesClient({fallback: 'rest'}, gax); + * const client = new AddressesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class AddressesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class AddressesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/autoscalers_client.ts b/packages/google-cloud-compute/src/v1/autoscalers_client.ts index 6117f5957a1..f1cffc94cd1 100644 --- a/packages/google-cloud-compute/src/v1/autoscalers_client.ts +++ b/packages/google-cloud-compute/src/v1/autoscalers_client.ts @@ -90,8 +90,7 @@ export class AutoscalersClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class AutoscalersClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AutoscalersClient({fallback: 'rest'}, gax); + * const client = new AutoscalersClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class AutoscalersClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class AutoscalersClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/backend_buckets_client.ts b/packages/google-cloud-compute/src/v1/backend_buckets_client.ts index 0a26c679536..da4d411cc96 100644 --- a/packages/google-cloud-compute/src/v1/backend_buckets_client.ts +++ b/packages/google-cloud-compute/src/v1/backend_buckets_client.ts @@ -90,8 +90,7 @@ export class BackendBucketsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class BackendBucketsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BackendBucketsClient({fallback: 'rest'}, gax); + * const client = new BackendBucketsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class BackendBucketsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class BackendBucketsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/backend_services_client.ts b/packages/google-cloud-compute/src/v1/backend_services_client.ts index 3cd14ae714e..3b45106fb57 100644 --- a/packages/google-cloud-compute/src/v1/backend_services_client.ts +++ b/packages/google-cloud-compute/src/v1/backend_services_client.ts @@ -90,8 +90,7 @@ export class BackendServicesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class BackendServicesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BackendServicesClient({fallback: 'rest'}, gax); + * const client = new BackendServicesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class BackendServicesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class BackendServicesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/disk_types_client.ts b/packages/google-cloud-compute/src/v1/disk_types_client.ts index a91fc3efe35..247954e961e 100644 --- a/packages/google-cloud-compute/src/v1/disk_types_client.ts +++ b/packages/google-cloud-compute/src/v1/disk_types_client.ts @@ -89,8 +89,7 @@ export class DiskTypesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class DiskTypesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DiskTypesClient({fallback: 'rest'}, gax); + * const client = new DiskTypesClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class DiskTypesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class DiskTypesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/disks_client.ts b/packages/google-cloud-compute/src/v1/disks_client.ts index 4661da301b1..2a1ca005978 100644 --- a/packages/google-cloud-compute/src/v1/disks_client.ts +++ b/packages/google-cloud-compute/src/v1/disks_client.ts @@ -90,8 +90,7 @@ export class DisksClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class DisksClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DisksClient({fallback: 'rest'}, gax); + * const client = new DisksClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class DisksClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class DisksClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/external_vpn_gateways_client.ts b/packages/google-cloud-compute/src/v1/external_vpn_gateways_client.ts index 9b50c2f7ab3..6052c453c98 100644 --- a/packages/google-cloud-compute/src/v1/external_vpn_gateways_client.ts +++ b/packages/google-cloud-compute/src/v1/external_vpn_gateways_client.ts @@ -90,8 +90,7 @@ export class ExternalVpnGatewaysClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ExternalVpnGatewaysClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ExternalVpnGatewaysClient({fallback: 'rest'}, gax); + * const client = new ExternalVpnGatewaysClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ExternalVpnGatewaysClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ExternalVpnGatewaysClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/firewall_policies_client.ts b/packages/google-cloud-compute/src/v1/firewall_policies_client.ts index be82ce7a750..c95cfc01ac5 100644 --- a/packages/google-cloud-compute/src/v1/firewall_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/firewall_policies_client.ts @@ -90,8 +90,7 @@ export class FirewallPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class FirewallPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new FirewallPoliciesClient({fallback: 'rest'}, gax); + * const client = new FirewallPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class FirewallPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class FirewallPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/firewalls_client.ts b/packages/google-cloud-compute/src/v1/firewalls_client.ts index 8b850c0af9e..9dcfbf471d5 100644 --- a/packages/google-cloud-compute/src/v1/firewalls_client.ts +++ b/packages/google-cloud-compute/src/v1/firewalls_client.ts @@ -90,8 +90,7 @@ export class FirewallsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class FirewallsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new FirewallsClient({fallback: 'rest'}, gax); + * const client = new FirewallsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class FirewallsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class FirewallsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/forwarding_rules_client.ts b/packages/google-cloud-compute/src/v1/forwarding_rules_client.ts index 87a729b9fda..e7cdd4dce09 100644 --- a/packages/google-cloud-compute/src/v1/forwarding_rules_client.ts +++ b/packages/google-cloud-compute/src/v1/forwarding_rules_client.ts @@ -90,8 +90,7 @@ export class ForwardingRulesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ForwardingRulesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ForwardingRulesClient({fallback: 'rest'}, gax); + * const client = new ForwardingRulesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ForwardingRulesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ForwardingRulesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/global_addresses_client.ts b/packages/google-cloud-compute/src/v1/global_addresses_client.ts index e829ae792a0..093a3bbeeaa 100644 --- a/packages/google-cloud-compute/src/v1/global_addresses_client.ts +++ b/packages/google-cloud-compute/src/v1/global_addresses_client.ts @@ -90,8 +90,7 @@ export class GlobalAddressesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class GlobalAddressesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GlobalAddressesClient({fallback: 'rest'}, gax); + * const client = new GlobalAddressesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class GlobalAddressesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class GlobalAddressesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/global_forwarding_rules_client.ts b/packages/google-cloud-compute/src/v1/global_forwarding_rules_client.ts index cf16ffb8951..ab3b1158b4c 100644 --- a/packages/google-cloud-compute/src/v1/global_forwarding_rules_client.ts +++ b/packages/google-cloud-compute/src/v1/global_forwarding_rules_client.ts @@ -90,8 +90,7 @@ export class GlobalForwardingRulesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class GlobalForwardingRulesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GlobalForwardingRulesClient({fallback: 'rest'}, gax); + * const client = new GlobalForwardingRulesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class GlobalForwardingRulesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class GlobalForwardingRulesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/global_network_endpoint_groups_client.ts b/packages/google-cloud-compute/src/v1/global_network_endpoint_groups_client.ts index cf53f2325d1..461bc45237c 100644 --- a/packages/google-cloud-compute/src/v1/global_network_endpoint_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/global_network_endpoint_groups_client.ts @@ -90,8 +90,7 @@ export class GlobalNetworkEndpointGroupsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class GlobalNetworkEndpointGroupsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GlobalNetworkEndpointGroupsClient({fallback: 'rest'}, gax); + * const client = new GlobalNetworkEndpointGroupsClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class GlobalNetworkEndpointGroupsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class GlobalNetworkEndpointGroupsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/global_operations_client.ts b/packages/google-cloud-compute/src/v1/global_operations_client.ts index 3c3f3ad99b1..73203ac8ccf 100644 --- a/packages/google-cloud-compute/src/v1/global_operations_client.ts +++ b/packages/google-cloud-compute/src/v1/global_operations_client.ts @@ -89,8 +89,7 @@ export class GlobalOperationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class GlobalOperationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GlobalOperationsClient({fallback: 'rest'}, gax); + * const client = new GlobalOperationsClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class GlobalOperationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class GlobalOperationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/global_organization_operations_client.ts b/packages/google-cloud-compute/src/v1/global_organization_operations_client.ts index 79ecf0080ee..9e9c49c2fb2 100644 --- a/packages/google-cloud-compute/src/v1/global_organization_operations_client.ts +++ b/packages/google-cloud-compute/src/v1/global_organization_operations_client.ts @@ -89,8 +89,7 @@ export class GlobalOrganizationOperationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class GlobalOrganizationOperationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GlobalOrganizationOperationsClient({fallback: 'rest'}, gax); + * const client = new GlobalOrganizationOperationsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class GlobalOrganizationOperationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class GlobalOrganizationOperationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/global_public_delegated_prefixes_client.ts b/packages/google-cloud-compute/src/v1/global_public_delegated_prefixes_client.ts index 7e0d6969714..c5cf9dfb476 100644 --- a/packages/google-cloud-compute/src/v1/global_public_delegated_prefixes_client.ts +++ b/packages/google-cloud-compute/src/v1/global_public_delegated_prefixes_client.ts @@ -90,8 +90,7 @@ export class GlobalPublicDelegatedPrefixesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class GlobalPublicDelegatedPrefixesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new GlobalPublicDelegatedPrefixesClient({fallback: 'rest'}, gax); + * const client = new GlobalPublicDelegatedPrefixesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class GlobalPublicDelegatedPrefixesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class GlobalPublicDelegatedPrefixesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/health_checks_client.ts b/packages/google-cloud-compute/src/v1/health_checks_client.ts index af7227ca214..3f13bf2df1d 100644 --- a/packages/google-cloud-compute/src/v1/health_checks_client.ts +++ b/packages/google-cloud-compute/src/v1/health_checks_client.ts @@ -90,8 +90,7 @@ export class HealthChecksClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class HealthChecksClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new HealthChecksClient({fallback: 'rest'}, gax); + * const client = new HealthChecksClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class HealthChecksClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class HealthChecksClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/image_family_views_client.ts b/packages/google-cloud-compute/src/v1/image_family_views_client.ts index d7432eedff0..1da4e70b1a6 100644 --- a/packages/google-cloud-compute/src/v1/image_family_views_client.ts +++ b/packages/google-cloud-compute/src/v1/image_family_views_client.ts @@ -87,8 +87,7 @@ export class ImageFamilyViewsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -96,7 +95,7 @@ export class ImageFamilyViewsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ImageFamilyViewsClient({fallback: 'rest'}, gax); + * const client = new ImageFamilyViewsClient({fallback: true}, gax); * ``` */ constructor( @@ -112,11 +111,11 @@ export class ImageFamilyViewsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -162,7 +161,7 @@ export class ImageFamilyViewsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/images_client.ts b/packages/google-cloud-compute/src/v1/images_client.ts index 177e629ed03..d09d1378626 100644 --- a/packages/google-cloud-compute/src/v1/images_client.ts +++ b/packages/google-cloud-compute/src/v1/images_client.ts @@ -90,8 +90,7 @@ export class ImagesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ImagesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ImagesClient({fallback: 'rest'}, gax); + * const client = new ImagesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ImagesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ImagesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/instance_group_managers_client.ts b/packages/google-cloud-compute/src/v1/instance_group_managers_client.ts index 0e0da19c6e1..ea6fb8962a3 100644 --- a/packages/google-cloud-compute/src/v1/instance_group_managers_client.ts +++ b/packages/google-cloud-compute/src/v1/instance_group_managers_client.ts @@ -90,8 +90,7 @@ export class InstanceGroupManagersClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class InstanceGroupManagersClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InstanceGroupManagersClient({fallback: 'rest'}, gax); + * const client = new InstanceGroupManagersClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class InstanceGroupManagersClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class InstanceGroupManagersClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/instance_groups_client.ts b/packages/google-cloud-compute/src/v1/instance_groups_client.ts index c23b62d688f..9a73d58ec69 100644 --- a/packages/google-cloud-compute/src/v1/instance_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/instance_groups_client.ts @@ -90,8 +90,7 @@ export class InstanceGroupsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class InstanceGroupsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InstanceGroupsClient({fallback: 'rest'}, gax); + * const client = new InstanceGroupsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class InstanceGroupsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class InstanceGroupsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/instance_templates_client.ts b/packages/google-cloud-compute/src/v1/instance_templates_client.ts index f93e88aed4b..44f3f44d26a 100644 --- a/packages/google-cloud-compute/src/v1/instance_templates_client.ts +++ b/packages/google-cloud-compute/src/v1/instance_templates_client.ts @@ -90,8 +90,7 @@ export class InstanceTemplatesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class InstanceTemplatesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InstanceTemplatesClient({fallback: 'rest'}, gax); + * const client = new InstanceTemplatesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class InstanceTemplatesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class InstanceTemplatesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/instances_client.ts b/packages/google-cloud-compute/src/v1/instances_client.ts index a2bc548d002..58bb41e4c63 100644 --- a/packages/google-cloud-compute/src/v1/instances_client.ts +++ b/packages/google-cloud-compute/src/v1/instances_client.ts @@ -90,8 +90,7 @@ export class InstancesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class InstancesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InstancesClient({fallback: 'rest'}, gax); + * const client = new InstancesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class InstancesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class InstancesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/interconnect_attachments_client.ts b/packages/google-cloud-compute/src/v1/interconnect_attachments_client.ts index 1c68e7c6078..107e09b29c6 100644 --- a/packages/google-cloud-compute/src/v1/interconnect_attachments_client.ts +++ b/packages/google-cloud-compute/src/v1/interconnect_attachments_client.ts @@ -90,8 +90,7 @@ export class InterconnectAttachmentsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class InterconnectAttachmentsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InterconnectAttachmentsClient({fallback: 'rest'}, gax); + * const client = new InterconnectAttachmentsClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class InterconnectAttachmentsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class InterconnectAttachmentsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/interconnect_locations_client.ts b/packages/google-cloud-compute/src/v1/interconnect_locations_client.ts index e0aeff39513..be393980a50 100644 --- a/packages/google-cloud-compute/src/v1/interconnect_locations_client.ts +++ b/packages/google-cloud-compute/src/v1/interconnect_locations_client.ts @@ -89,8 +89,7 @@ export class InterconnectLocationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class InterconnectLocationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InterconnectLocationsClient({fallback: 'rest'}, gax); + * const client = new InterconnectLocationsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class InterconnectLocationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class InterconnectLocationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/interconnect_remote_locations_client.ts b/packages/google-cloud-compute/src/v1/interconnect_remote_locations_client.ts index 5e7ae422d28..f5e65351b96 100644 --- a/packages/google-cloud-compute/src/v1/interconnect_remote_locations_client.ts +++ b/packages/google-cloud-compute/src/v1/interconnect_remote_locations_client.ts @@ -89,8 +89,7 @@ export class InterconnectRemoteLocationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class InterconnectRemoteLocationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InterconnectRemoteLocationsClient({fallback: 'rest'}, gax); + * const client = new InterconnectRemoteLocationsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class InterconnectRemoteLocationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class InterconnectRemoteLocationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/interconnects_client.ts b/packages/google-cloud-compute/src/v1/interconnects_client.ts index 89549b4199d..ca8474d0f43 100644 --- a/packages/google-cloud-compute/src/v1/interconnects_client.ts +++ b/packages/google-cloud-compute/src/v1/interconnects_client.ts @@ -90,8 +90,7 @@ export class InterconnectsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class InterconnectsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new InterconnectsClient({fallback: 'rest'}, gax); + * const client = new InterconnectsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class InterconnectsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class InterconnectsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/license_codes_client.ts b/packages/google-cloud-compute/src/v1/license_codes_client.ts index dfc6e6c4db6..167a87817f2 100644 --- a/packages/google-cloud-compute/src/v1/license_codes_client.ts +++ b/packages/google-cloud-compute/src/v1/license_codes_client.ts @@ -87,8 +87,7 @@ export class LicenseCodesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -96,7 +95,7 @@ export class LicenseCodesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new LicenseCodesClient({fallback: 'rest'}, gax); + * const client = new LicenseCodesClient({fallback: true}, gax); * ``` */ constructor( @@ -112,11 +111,11 @@ export class LicenseCodesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -162,7 +161,7 @@ export class LicenseCodesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/licenses_client.ts b/packages/google-cloud-compute/src/v1/licenses_client.ts index a33fec4d0e6..da0ae3b0eb5 100644 --- a/packages/google-cloud-compute/src/v1/licenses_client.ts +++ b/packages/google-cloud-compute/src/v1/licenses_client.ts @@ -90,8 +90,7 @@ export class LicensesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class LicensesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new LicensesClient({fallback: 'rest'}, gax); + * const client = new LicensesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class LicensesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class LicensesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/machine_images_client.ts b/packages/google-cloud-compute/src/v1/machine_images_client.ts index 448c90b3e6c..ef3787c4a2b 100644 --- a/packages/google-cloud-compute/src/v1/machine_images_client.ts +++ b/packages/google-cloud-compute/src/v1/machine_images_client.ts @@ -90,8 +90,7 @@ export class MachineImagesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class MachineImagesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new MachineImagesClient({fallback: 'rest'}, gax); + * const client = new MachineImagesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class MachineImagesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class MachineImagesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/machine_types_client.ts b/packages/google-cloud-compute/src/v1/machine_types_client.ts index e7970e85b7b..b2ede1e5da0 100644 --- a/packages/google-cloud-compute/src/v1/machine_types_client.ts +++ b/packages/google-cloud-compute/src/v1/machine_types_client.ts @@ -89,8 +89,7 @@ export class MachineTypesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class MachineTypesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new MachineTypesClient({fallback: 'rest'}, gax); + * const client = new MachineTypesClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class MachineTypesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class MachineTypesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/network_attachments_client.ts b/packages/google-cloud-compute/src/v1/network_attachments_client.ts index ba5f3164f92..caa134cf40a 100644 --- a/packages/google-cloud-compute/src/v1/network_attachments_client.ts +++ b/packages/google-cloud-compute/src/v1/network_attachments_client.ts @@ -90,8 +90,7 @@ export class NetworkAttachmentsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NetworkAttachmentsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NetworkAttachmentsClient({fallback: 'rest'}, gax); + * const client = new NetworkAttachmentsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class NetworkAttachmentsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class NetworkAttachmentsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/network_edge_security_services_client.ts b/packages/google-cloud-compute/src/v1/network_edge_security_services_client.ts index 6a7440cd16d..aa1efc8e772 100644 --- a/packages/google-cloud-compute/src/v1/network_edge_security_services_client.ts +++ b/packages/google-cloud-compute/src/v1/network_edge_security_services_client.ts @@ -90,8 +90,7 @@ export class NetworkEdgeSecurityServicesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NetworkEdgeSecurityServicesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NetworkEdgeSecurityServicesClient({fallback: 'rest'}, gax); + * const client = new NetworkEdgeSecurityServicesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class NetworkEdgeSecurityServicesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class NetworkEdgeSecurityServicesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/network_endpoint_groups_client.ts b/packages/google-cloud-compute/src/v1/network_endpoint_groups_client.ts index 54d11831d0c..cb4128583ad 100644 --- a/packages/google-cloud-compute/src/v1/network_endpoint_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/network_endpoint_groups_client.ts @@ -90,8 +90,7 @@ export class NetworkEndpointGroupsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NetworkEndpointGroupsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NetworkEndpointGroupsClient({fallback: 'rest'}, gax); + * const client = new NetworkEndpointGroupsClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class NetworkEndpointGroupsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class NetworkEndpointGroupsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/network_firewall_policies_client.ts b/packages/google-cloud-compute/src/v1/network_firewall_policies_client.ts index 603c46f9266..1b2c5abace6 100644 --- a/packages/google-cloud-compute/src/v1/network_firewall_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/network_firewall_policies_client.ts @@ -90,8 +90,7 @@ export class NetworkFirewallPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NetworkFirewallPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NetworkFirewallPoliciesClient({fallback: 'rest'}, gax); + * const client = new NetworkFirewallPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class NetworkFirewallPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class NetworkFirewallPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/networks_client.ts b/packages/google-cloud-compute/src/v1/networks_client.ts index 26cedf08766..3be1ea89c6f 100644 --- a/packages/google-cloud-compute/src/v1/networks_client.ts +++ b/packages/google-cloud-compute/src/v1/networks_client.ts @@ -90,8 +90,7 @@ export class NetworksClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NetworksClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NetworksClient({fallback: 'rest'}, gax); + * const client = new NetworksClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class NetworksClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class NetworksClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/node_groups_client.ts b/packages/google-cloud-compute/src/v1/node_groups_client.ts index 966c63ab35d..219e84b5223 100644 --- a/packages/google-cloud-compute/src/v1/node_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/node_groups_client.ts @@ -90,8 +90,7 @@ export class NodeGroupsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NodeGroupsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NodeGroupsClient({fallback: 'rest'}, gax); + * const client = new NodeGroupsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class NodeGroupsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class NodeGroupsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/node_templates_client.ts b/packages/google-cloud-compute/src/v1/node_templates_client.ts index 7f6a2d906ae..c538fa06ba3 100644 --- a/packages/google-cloud-compute/src/v1/node_templates_client.ts +++ b/packages/google-cloud-compute/src/v1/node_templates_client.ts @@ -90,8 +90,7 @@ export class NodeTemplatesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class NodeTemplatesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NodeTemplatesClient({fallback: 'rest'}, gax); + * const client = new NodeTemplatesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class NodeTemplatesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class NodeTemplatesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/node_types_client.ts b/packages/google-cloud-compute/src/v1/node_types_client.ts index a42c3687d8f..d24af096056 100644 --- a/packages/google-cloud-compute/src/v1/node_types_client.ts +++ b/packages/google-cloud-compute/src/v1/node_types_client.ts @@ -89,8 +89,7 @@ export class NodeTypesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class NodeTypesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new NodeTypesClient({fallback: 'rest'}, gax); + * const client = new NodeTypesClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class NodeTypesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class NodeTypesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/packet_mirrorings_client.ts b/packages/google-cloud-compute/src/v1/packet_mirrorings_client.ts index 0d4f2d11a13..79775075bb9 100644 --- a/packages/google-cloud-compute/src/v1/packet_mirrorings_client.ts +++ b/packages/google-cloud-compute/src/v1/packet_mirrorings_client.ts @@ -90,8 +90,7 @@ export class PacketMirroringsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class PacketMirroringsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PacketMirroringsClient({fallback: 'rest'}, gax); + * const client = new PacketMirroringsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class PacketMirroringsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class PacketMirroringsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/projects_client.ts b/packages/google-cloud-compute/src/v1/projects_client.ts index e48a7bc6e65..9b5f43f3656 100644 --- a/packages/google-cloud-compute/src/v1/projects_client.ts +++ b/packages/google-cloud-compute/src/v1/projects_client.ts @@ -90,8 +90,7 @@ export class ProjectsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ProjectsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ProjectsClient({fallback: 'rest'}, gax); + * const client = new ProjectsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ProjectsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ProjectsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/public_advertised_prefixes_client.ts b/packages/google-cloud-compute/src/v1/public_advertised_prefixes_client.ts index 07c671b10b2..1ed488c692a 100644 --- a/packages/google-cloud-compute/src/v1/public_advertised_prefixes_client.ts +++ b/packages/google-cloud-compute/src/v1/public_advertised_prefixes_client.ts @@ -90,8 +90,7 @@ export class PublicAdvertisedPrefixesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class PublicAdvertisedPrefixesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PublicAdvertisedPrefixesClient({fallback: 'rest'}, gax); + * const client = new PublicAdvertisedPrefixesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class PublicAdvertisedPrefixesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class PublicAdvertisedPrefixesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/public_delegated_prefixes_client.ts b/packages/google-cloud-compute/src/v1/public_delegated_prefixes_client.ts index fc89ff337d4..78b5ff606af 100644 --- a/packages/google-cloud-compute/src/v1/public_delegated_prefixes_client.ts +++ b/packages/google-cloud-compute/src/v1/public_delegated_prefixes_client.ts @@ -90,8 +90,7 @@ export class PublicDelegatedPrefixesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class PublicDelegatedPrefixesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PublicDelegatedPrefixesClient({fallback: 'rest'}, gax); + * const client = new PublicDelegatedPrefixesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class PublicDelegatedPrefixesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class PublicDelegatedPrefixesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_autoscalers_client.ts b/packages/google-cloud-compute/src/v1/region_autoscalers_client.ts index 8446948e004..4e2f44a159d 100644 --- a/packages/google-cloud-compute/src/v1/region_autoscalers_client.ts +++ b/packages/google-cloud-compute/src/v1/region_autoscalers_client.ts @@ -90,8 +90,7 @@ export class RegionAutoscalersClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionAutoscalersClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionAutoscalersClient({fallback: 'rest'}, gax); + * const client = new RegionAutoscalersClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionAutoscalersClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionAutoscalersClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_backend_services_client.ts b/packages/google-cloud-compute/src/v1/region_backend_services_client.ts index 8f91bb856ef..98429c0aaa2 100644 --- a/packages/google-cloud-compute/src/v1/region_backend_services_client.ts +++ b/packages/google-cloud-compute/src/v1/region_backend_services_client.ts @@ -90,8 +90,7 @@ export class RegionBackendServicesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionBackendServicesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionBackendServicesClient({fallback: 'rest'}, gax); + * const client = new RegionBackendServicesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionBackendServicesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionBackendServicesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_commitments_client.ts b/packages/google-cloud-compute/src/v1/region_commitments_client.ts index eaffb2fef87..a0b83f89d2e 100644 --- a/packages/google-cloud-compute/src/v1/region_commitments_client.ts +++ b/packages/google-cloud-compute/src/v1/region_commitments_client.ts @@ -90,8 +90,7 @@ export class RegionCommitmentsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionCommitmentsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionCommitmentsClient({fallback: 'rest'}, gax); + * const client = new RegionCommitmentsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionCommitmentsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionCommitmentsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_disk_types_client.ts b/packages/google-cloud-compute/src/v1/region_disk_types_client.ts index 1ddbefd5573..10a1ac8a501 100644 --- a/packages/google-cloud-compute/src/v1/region_disk_types_client.ts +++ b/packages/google-cloud-compute/src/v1/region_disk_types_client.ts @@ -89,8 +89,7 @@ export class RegionDiskTypesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class RegionDiskTypesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionDiskTypesClient({fallback: 'rest'}, gax); + * const client = new RegionDiskTypesClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class RegionDiskTypesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class RegionDiskTypesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_disks_client.ts b/packages/google-cloud-compute/src/v1/region_disks_client.ts index 9ed4b6869e2..faab8a58df7 100644 --- a/packages/google-cloud-compute/src/v1/region_disks_client.ts +++ b/packages/google-cloud-compute/src/v1/region_disks_client.ts @@ -90,8 +90,7 @@ export class RegionDisksClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionDisksClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionDisksClient({fallback: 'rest'}, gax); + * const client = new RegionDisksClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionDisksClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionDisksClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_health_check_services_client.ts b/packages/google-cloud-compute/src/v1/region_health_check_services_client.ts index e8de1290a0b..2a39cd50a14 100644 --- a/packages/google-cloud-compute/src/v1/region_health_check_services_client.ts +++ b/packages/google-cloud-compute/src/v1/region_health_check_services_client.ts @@ -90,8 +90,7 @@ export class RegionHealthCheckServicesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionHealthCheckServicesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionHealthCheckServicesClient({fallback: 'rest'}, gax); + * const client = new RegionHealthCheckServicesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionHealthCheckServicesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionHealthCheckServicesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_health_checks_client.ts b/packages/google-cloud-compute/src/v1/region_health_checks_client.ts index 24ef125ccd0..e5345be3ca0 100644 --- a/packages/google-cloud-compute/src/v1/region_health_checks_client.ts +++ b/packages/google-cloud-compute/src/v1/region_health_checks_client.ts @@ -90,8 +90,7 @@ export class RegionHealthChecksClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionHealthChecksClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionHealthChecksClient({fallback: 'rest'}, gax); + * const client = new RegionHealthChecksClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionHealthChecksClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionHealthChecksClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_instance_group_managers_client.ts b/packages/google-cloud-compute/src/v1/region_instance_group_managers_client.ts index dca2e9bb8e9..8e19d084281 100644 --- a/packages/google-cloud-compute/src/v1/region_instance_group_managers_client.ts +++ b/packages/google-cloud-compute/src/v1/region_instance_group_managers_client.ts @@ -90,8 +90,7 @@ export class RegionInstanceGroupManagersClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionInstanceGroupManagersClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionInstanceGroupManagersClient({fallback: 'rest'}, gax); + * const client = new RegionInstanceGroupManagersClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionInstanceGroupManagersClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionInstanceGroupManagersClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_instance_groups_client.ts b/packages/google-cloud-compute/src/v1/region_instance_groups_client.ts index 9ed8092130c..34a42135020 100644 --- a/packages/google-cloud-compute/src/v1/region_instance_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/region_instance_groups_client.ts @@ -90,8 +90,7 @@ export class RegionInstanceGroupsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionInstanceGroupsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionInstanceGroupsClient({fallback: 'rest'}, gax); + * const client = new RegionInstanceGroupsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionInstanceGroupsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionInstanceGroupsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_instance_templates_client.ts b/packages/google-cloud-compute/src/v1/region_instance_templates_client.ts index 877b9796b82..17083cc08dc 100644 --- a/packages/google-cloud-compute/src/v1/region_instance_templates_client.ts +++ b/packages/google-cloud-compute/src/v1/region_instance_templates_client.ts @@ -90,8 +90,7 @@ export class RegionInstanceTemplatesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionInstanceTemplatesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionInstanceTemplatesClient({fallback: 'rest'}, gax); + * const client = new RegionInstanceTemplatesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionInstanceTemplatesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionInstanceTemplatesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_instances_client.ts b/packages/google-cloud-compute/src/v1/region_instances_client.ts index 550a5347e3c..f806994e324 100644 --- a/packages/google-cloud-compute/src/v1/region_instances_client.ts +++ b/packages/google-cloud-compute/src/v1/region_instances_client.ts @@ -88,8 +88,7 @@ export class RegionInstancesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -97,7 +96,7 @@ export class RegionInstancesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionInstancesClient({fallback: 'rest'}, gax); + * const client = new RegionInstancesClient({fallback: true}, gax); * ``` */ constructor( @@ -113,11 +112,11 @@ export class RegionInstancesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -163,7 +162,7 @@ export class RegionInstancesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_network_endpoint_groups_client.ts b/packages/google-cloud-compute/src/v1/region_network_endpoint_groups_client.ts index 3bee18c66a5..65b306b6bb0 100644 --- a/packages/google-cloud-compute/src/v1/region_network_endpoint_groups_client.ts +++ b/packages/google-cloud-compute/src/v1/region_network_endpoint_groups_client.ts @@ -90,8 +90,7 @@ export class RegionNetworkEndpointGroupsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionNetworkEndpointGroupsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionNetworkEndpointGroupsClient({fallback: 'rest'}, gax); + * const client = new RegionNetworkEndpointGroupsClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionNetworkEndpointGroupsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionNetworkEndpointGroupsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_network_firewall_policies_client.ts b/packages/google-cloud-compute/src/v1/region_network_firewall_policies_client.ts index ad3ef68b296..5f770f66056 100644 --- a/packages/google-cloud-compute/src/v1/region_network_firewall_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/region_network_firewall_policies_client.ts @@ -90,8 +90,7 @@ export class RegionNetworkFirewallPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionNetworkFirewallPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionNetworkFirewallPoliciesClient({fallback: 'rest'}, gax); + * const client = new RegionNetworkFirewallPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionNetworkFirewallPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionNetworkFirewallPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_notification_endpoints_client.ts b/packages/google-cloud-compute/src/v1/region_notification_endpoints_client.ts index a8ffc3e991f..e29125859c4 100644 --- a/packages/google-cloud-compute/src/v1/region_notification_endpoints_client.ts +++ b/packages/google-cloud-compute/src/v1/region_notification_endpoints_client.ts @@ -90,8 +90,7 @@ export class RegionNotificationEndpointsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionNotificationEndpointsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionNotificationEndpointsClient({fallback: 'rest'}, gax); + * const client = new RegionNotificationEndpointsClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionNotificationEndpointsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionNotificationEndpointsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_operations_client.ts b/packages/google-cloud-compute/src/v1/region_operations_client.ts index 7f7942d28c3..ff20197f469 100644 --- a/packages/google-cloud-compute/src/v1/region_operations_client.ts +++ b/packages/google-cloud-compute/src/v1/region_operations_client.ts @@ -89,8 +89,7 @@ export class RegionOperationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class RegionOperationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionOperationsClient({fallback: 'rest'}, gax); + * const client = new RegionOperationsClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class RegionOperationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class RegionOperationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_security_policies_client.ts b/packages/google-cloud-compute/src/v1/region_security_policies_client.ts index ec4f81d1eda..913cdff3226 100644 --- a/packages/google-cloud-compute/src/v1/region_security_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/region_security_policies_client.ts @@ -90,8 +90,7 @@ export class RegionSecurityPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionSecurityPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionSecurityPoliciesClient({fallback: 'rest'}, gax); + * const client = new RegionSecurityPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionSecurityPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionSecurityPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_ssl_certificates_client.ts b/packages/google-cloud-compute/src/v1/region_ssl_certificates_client.ts index 7a697278a21..3d1d8b7c518 100644 --- a/packages/google-cloud-compute/src/v1/region_ssl_certificates_client.ts +++ b/packages/google-cloud-compute/src/v1/region_ssl_certificates_client.ts @@ -90,8 +90,7 @@ export class RegionSslCertificatesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionSslCertificatesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionSslCertificatesClient({fallback: 'rest'}, gax); + * const client = new RegionSslCertificatesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionSslCertificatesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionSslCertificatesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_ssl_policies_client.ts b/packages/google-cloud-compute/src/v1/region_ssl_policies_client.ts index b27ecdeb6bb..1e2f5f048ae 100644 --- a/packages/google-cloud-compute/src/v1/region_ssl_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/region_ssl_policies_client.ts @@ -90,8 +90,7 @@ export class RegionSslPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionSslPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionSslPoliciesClient({fallback: 'rest'}, gax); + * const client = new RegionSslPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionSslPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionSslPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_target_http_proxies_client.ts b/packages/google-cloud-compute/src/v1/region_target_http_proxies_client.ts index 4ade92728a0..8e748e805cb 100644 --- a/packages/google-cloud-compute/src/v1/region_target_http_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/region_target_http_proxies_client.ts @@ -90,8 +90,7 @@ export class RegionTargetHttpProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionTargetHttpProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionTargetHttpProxiesClient({fallback: 'rest'}, gax); + * const client = new RegionTargetHttpProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionTargetHttpProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionTargetHttpProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_target_https_proxies_client.ts b/packages/google-cloud-compute/src/v1/region_target_https_proxies_client.ts index 2e831ddfe89..e1d9f6344aa 100644 --- a/packages/google-cloud-compute/src/v1/region_target_https_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/region_target_https_proxies_client.ts @@ -90,8 +90,7 @@ export class RegionTargetHttpsProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionTargetHttpsProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionTargetHttpsProxiesClient({fallback: 'rest'}, gax); + * const client = new RegionTargetHttpsProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionTargetHttpsProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionTargetHttpsProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_target_tcp_proxies_client.ts b/packages/google-cloud-compute/src/v1/region_target_tcp_proxies_client.ts index e9494515d7f..979df8c20fa 100644 --- a/packages/google-cloud-compute/src/v1/region_target_tcp_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/region_target_tcp_proxies_client.ts @@ -90,8 +90,7 @@ export class RegionTargetTcpProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionTargetTcpProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionTargetTcpProxiesClient({fallback: 'rest'}, gax); + * const client = new RegionTargetTcpProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -116,11 +115,11 @@ export class RegionTargetTcpProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -166,7 +165,7 @@ export class RegionTargetTcpProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/region_url_maps_client.ts b/packages/google-cloud-compute/src/v1/region_url_maps_client.ts index f51fd55a4a9..7502158df3d 100644 --- a/packages/google-cloud-compute/src/v1/region_url_maps_client.ts +++ b/packages/google-cloud-compute/src/v1/region_url_maps_client.ts @@ -90,8 +90,7 @@ export class RegionUrlMapsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RegionUrlMapsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionUrlMapsClient({fallback: 'rest'}, gax); + * const client = new RegionUrlMapsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RegionUrlMapsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RegionUrlMapsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/regions_client.ts b/packages/google-cloud-compute/src/v1/regions_client.ts index 994008018bf..413a269ddab 100644 --- a/packages/google-cloud-compute/src/v1/regions_client.ts +++ b/packages/google-cloud-compute/src/v1/regions_client.ts @@ -89,8 +89,7 @@ export class RegionsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class RegionsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionsClient({fallback: 'rest'}, gax); + * const client = new RegionsClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class RegionsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class RegionsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/reservations_client.ts b/packages/google-cloud-compute/src/v1/reservations_client.ts index 413e1e8e3c7..b2a14205f40 100644 --- a/packages/google-cloud-compute/src/v1/reservations_client.ts +++ b/packages/google-cloud-compute/src/v1/reservations_client.ts @@ -90,8 +90,7 @@ export class ReservationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ReservationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ReservationsClient({fallback: 'rest'}, gax); + * const client = new ReservationsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ReservationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ReservationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/resource_policies_client.ts b/packages/google-cloud-compute/src/v1/resource_policies_client.ts index 99206fd9de4..13867fd8d56 100644 --- a/packages/google-cloud-compute/src/v1/resource_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/resource_policies_client.ts @@ -90,8 +90,7 @@ export class ResourcePoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ResourcePoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ResourcePoliciesClient({fallback: 'rest'}, gax); + * const client = new ResourcePoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ResourcePoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ResourcePoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/routers_client.ts b/packages/google-cloud-compute/src/v1/routers_client.ts index e2d790c648f..e1f3328966b 100644 --- a/packages/google-cloud-compute/src/v1/routers_client.ts +++ b/packages/google-cloud-compute/src/v1/routers_client.ts @@ -90,8 +90,7 @@ export class RoutersClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RoutersClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RoutersClient({fallback: 'rest'}, gax); + * const client = new RoutersClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RoutersClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RoutersClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/routes_client.ts b/packages/google-cloud-compute/src/v1/routes_client.ts index 686a9637c43..50996d56d2c 100644 --- a/packages/google-cloud-compute/src/v1/routes_client.ts +++ b/packages/google-cloud-compute/src/v1/routes_client.ts @@ -90,8 +90,7 @@ export class RoutesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class RoutesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RoutesClient({fallback: 'rest'}, gax); + * const client = new RoutesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class RoutesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class RoutesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/security_policies_client.ts b/packages/google-cloud-compute/src/v1/security_policies_client.ts index 47dd7907a25..2ade56d169f 100644 --- a/packages/google-cloud-compute/src/v1/security_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/security_policies_client.ts @@ -90,8 +90,7 @@ export class SecurityPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class SecurityPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SecurityPoliciesClient({fallback: 'rest'}, gax); + * const client = new SecurityPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class SecurityPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class SecurityPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/service_attachments_client.ts b/packages/google-cloud-compute/src/v1/service_attachments_client.ts index cfca1cc0626..7489525b2d8 100644 --- a/packages/google-cloud-compute/src/v1/service_attachments_client.ts +++ b/packages/google-cloud-compute/src/v1/service_attachments_client.ts @@ -90,8 +90,7 @@ export class ServiceAttachmentsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class ServiceAttachmentsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ServiceAttachmentsClient({fallback: 'rest'}, gax); + * const client = new ServiceAttachmentsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class ServiceAttachmentsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class ServiceAttachmentsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/snapshots_client.ts b/packages/google-cloud-compute/src/v1/snapshots_client.ts index 6da4a44b7bb..653fe1963b4 100644 --- a/packages/google-cloud-compute/src/v1/snapshots_client.ts +++ b/packages/google-cloud-compute/src/v1/snapshots_client.ts @@ -90,8 +90,7 @@ export class SnapshotsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class SnapshotsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SnapshotsClient({fallback: 'rest'}, gax); + * const client = new SnapshotsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class SnapshotsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class SnapshotsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/ssl_certificates_client.ts b/packages/google-cloud-compute/src/v1/ssl_certificates_client.ts index bc2fcde5f61..47667e9b5a2 100644 --- a/packages/google-cloud-compute/src/v1/ssl_certificates_client.ts +++ b/packages/google-cloud-compute/src/v1/ssl_certificates_client.ts @@ -90,8 +90,7 @@ export class SslCertificatesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class SslCertificatesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SslCertificatesClient({fallback: 'rest'}, gax); + * const client = new SslCertificatesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class SslCertificatesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class SslCertificatesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/ssl_policies_client.ts b/packages/google-cloud-compute/src/v1/ssl_policies_client.ts index efc541e95b1..a7364fe5a56 100644 --- a/packages/google-cloud-compute/src/v1/ssl_policies_client.ts +++ b/packages/google-cloud-compute/src/v1/ssl_policies_client.ts @@ -90,8 +90,7 @@ export class SslPoliciesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class SslPoliciesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SslPoliciesClient({fallback: 'rest'}, gax); + * const client = new SslPoliciesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class SslPoliciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class SslPoliciesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/subnetworks_client.ts b/packages/google-cloud-compute/src/v1/subnetworks_client.ts index 9ce592845ad..38b5dfaba62 100644 --- a/packages/google-cloud-compute/src/v1/subnetworks_client.ts +++ b/packages/google-cloud-compute/src/v1/subnetworks_client.ts @@ -90,8 +90,7 @@ export class SubnetworksClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class SubnetworksClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SubnetworksClient({fallback: 'rest'}, gax); + * const client = new SubnetworksClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class SubnetworksClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class SubnetworksClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_grpc_proxies_client.ts b/packages/google-cloud-compute/src/v1/target_grpc_proxies_client.ts index fd932a20b08..b2ae373060d 100644 --- a/packages/google-cloud-compute/src/v1/target_grpc_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/target_grpc_proxies_client.ts @@ -90,8 +90,7 @@ export class TargetGrpcProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetGrpcProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetGrpcProxiesClient({fallback: 'rest'}, gax); + * const client = new TargetGrpcProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetGrpcProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetGrpcProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_http_proxies_client.ts b/packages/google-cloud-compute/src/v1/target_http_proxies_client.ts index 23dd9cd5abd..42268fbb6ee 100644 --- a/packages/google-cloud-compute/src/v1/target_http_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/target_http_proxies_client.ts @@ -90,8 +90,7 @@ export class TargetHttpProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetHttpProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetHttpProxiesClient({fallback: 'rest'}, gax); + * const client = new TargetHttpProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetHttpProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetHttpProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_https_proxies_client.ts b/packages/google-cloud-compute/src/v1/target_https_proxies_client.ts index 8063f1c563a..c848e170a8a 100644 --- a/packages/google-cloud-compute/src/v1/target_https_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/target_https_proxies_client.ts @@ -90,8 +90,7 @@ export class TargetHttpsProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetHttpsProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetHttpsProxiesClient({fallback: 'rest'}, gax); + * const client = new TargetHttpsProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetHttpsProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetHttpsProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_instances_client.ts b/packages/google-cloud-compute/src/v1/target_instances_client.ts index 0ac6fcc8b8c..3602ce09eaf 100644 --- a/packages/google-cloud-compute/src/v1/target_instances_client.ts +++ b/packages/google-cloud-compute/src/v1/target_instances_client.ts @@ -90,8 +90,7 @@ export class TargetInstancesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetInstancesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetInstancesClient({fallback: 'rest'}, gax); + * const client = new TargetInstancesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetInstancesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetInstancesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_pools_client.ts b/packages/google-cloud-compute/src/v1/target_pools_client.ts index 9c8e647c250..c37e0df25c9 100644 --- a/packages/google-cloud-compute/src/v1/target_pools_client.ts +++ b/packages/google-cloud-compute/src/v1/target_pools_client.ts @@ -90,8 +90,7 @@ export class TargetPoolsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetPoolsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetPoolsClient({fallback: 'rest'}, gax); + * const client = new TargetPoolsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetPoolsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetPoolsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_ssl_proxies_client.ts b/packages/google-cloud-compute/src/v1/target_ssl_proxies_client.ts index d500899b2c6..45d268d711b 100644 --- a/packages/google-cloud-compute/src/v1/target_ssl_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/target_ssl_proxies_client.ts @@ -90,8 +90,7 @@ export class TargetSslProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetSslProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetSslProxiesClient({fallback: 'rest'}, gax); + * const client = new TargetSslProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetSslProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetSslProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_tcp_proxies_client.ts b/packages/google-cloud-compute/src/v1/target_tcp_proxies_client.ts index 7371e567e07..ac9c7801aa8 100644 --- a/packages/google-cloud-compute/src/v1/target_tcp_proxies_client.ts +++ b/packages/google-cloud-compute/src/v1/target_tcp_proxies_client.ts @@ -90,8 +90,7 @@ export class TargetTcpProxiesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetTcpProxiesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetTcpProxiesClient({fallback: 'rest'}, gax); + * const client = new TargetTcpProxiesClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetTcpProxiesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetTcpProxiesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/target_vpn_gateways_client.ts b/packages/google-cloud-compute/src/v1/target_vpn_gateways_client.ts index d6104ba3f78..86911b61b14 100644 --- a/packages/google-cloud-compute/src/v1/target_vpn_gateways_client.ts +++ b/packages/google-cloud-compute/src/v1/target_vpn_gateways_client.ts @@ -90,8 +90,7 @@ export class TargetVpnGatewaysClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class TargetVpnGatewaysClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TargetVpnGatewaysClient({fallback: 'rest'}, gax); + * const client = new TargetVpnGatewaysClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class TargetVpnGatewaysClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class TargetVpnGatewaysClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/url_maps_client.ts b/packages/google-cloud-compute/src/v1/url_maps_client.ts index 4196551b457..5fc4584c8a1 100644 --- a/packages/google-cloud-compute/src/v1/url_maps_client.ts +++ b/packages/google-cloud-compute/src/v1/url_maps_client.ts @@ -90,8 +90,7 @@ export class UrlMapsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class UrlMapsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new UrlMapsClient({fallback: 'rest'}, gax); + * const client = new UrlMapsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class UrlMapsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class UrlMapsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/vpn_gateways_client.ts b/packages/google-cloud-compute/src/v1/vpn_gateways_client.ts index 76a6875454c..74217b40696 100644 --- a/packages/google-cloud-compute/src/v1/vpn_gateways_client.ts +++ b/packages/google-cloud-compute/src/v1/vpn_gateways_client.ts @@ -90,8 +90,7 @@ export class VpnGatewaysClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class VpnGatewaysClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new VpnGatewaysClient({fallback: 'rest'}, gax); + * const client = new VpnGatewaysClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class VpnGatewaysClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class VpnGatewaysClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/vpn_tunnels_client.ts b/packages/google-cloud-compute/src/v1/vpn_tunnels_client.ts index 6414b7970e4..82b15464ae4 100644 --- a/packages/google-cloud-compute/src/v1/vpn_tunnels_client.ts +++ b/packages/google-cloud-compute/src/v1/vpn_tunnels_client.ts @@ -90,8 +90,7 @@ export class VpnTunnelsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -99,7 +98,7 @@ export class VpnTunnelsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new VpnTunnelsClient({fallback: 'rest'}, gax); + * const client = new VpnTunnelsClient({fallback: true}, gax); * ``` */ constructor( @@ -115,11 +114,11 @@ export class VpnTunnelsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -165,7 +164,7 @@ export class VpnTunnelsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/zone_operations_client.ts b/packages/google-cloud-compute/src/v1/zone_operations_client.ts index d8a8e043458..b66ac08c330 100644 --- a/packages/google-cloud-compute/src/v1/zone_operations_client.ts +++ b/packages/google-cloud-compute/src/v1/zone_operations_client.ts @@ -89,8 +89,7 @@ export class ZoneOperationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class ZoneOperationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ZoneOperationsClient({fallback: 'rest'}, gax); + * const client = new ZoneOperationsClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class ZoneOperationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class ZoneOperationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1/zones_client.ts b/packages/google-cloud-compute/src/v1/zones_client.ts index 493ca93d352..e60ef5cb0f5 100644 --- a/packages/google-cloud-compute/src/v1/zones_client.ts +++ b/packages/google-cloud-compute/src/v1/zones_client.ts @@ -89,8 +89,7 @@ export class ZonesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -98,7 +97,7 @@ export class ZonesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ZonesClient({fallback: 'rest'}, gax); + * const client = new ZonesClient({fallback: true}, gax); * ``` */ constructor( @@ -114,11 +113,11 @@ export class ZonesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -164,7 +163,7 @@ export class ZonesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1small/addresses_client.ts b/packages/google-cloud-compute/src/v1small/addresses_client.ts index f805f17c582..ed3fca53ced 100644 --- a/packages/google-cloud-compute/src/v1small/addresses_client.ts +++ b/packages/google-cloud-compute/src/v1small/addresses_client.ts @@ -93,8 +93,7 @@ export class AddressesClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -102,7 +101,7 @@ export class AddressesClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AddressesClient({fallback: 'rest'}, gax); + * const client = new AddressesClient({fallback: true}, gax); * ``` */ constructor( @@ -118,11 +117,11 @@ export class AddressesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -168,7 +167,7 @@ export class AddressesClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/src/v1small/region_operations_client.ts b/packages/google-cloud-compute/src/v1small/region_operations_client.ts index 0cf4d044f74..ea1a95bd1b4 100644 --- a/packages/google-cloud-compute/src/v1small/region_operations_client.ts +++ b/packages/google-cloud-compute/src/v1small/region_operations_client.ts @@ -87,8 +87,7 @@ export class RegionOperationsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -96,7 +95,7 @@ export class RegionOperationsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RegionOperationsClient({fallback: 'rest'}, gax); + * const client = new RegionOperationsClient({fallback: true}, gax); * ``` */ constructor( @@ -112,11 +111,11 @@ export class RegionOperationsClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). if (!opts) { - opts = {fallback: 'rest'}; + opts = {fallback: true}; } else { - opts.fallback = opts.fallback ?? 'rest'; + opts.fallback = opts.fallback ?? true; } const fallback = opts?.fallback ?? @@ -162,7 +161,7 @@ export class RegionOperationsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-compute/test/gapic_instances_v1.ts b/packages/google-cloud-compute/test/gapic_instances_v1.ts index 5e1c5617424..549ee6c24d6 100644 --- a/packages/google-cloud-compute/test/gapic_instances_v1.ts +++ b/packages/google-cloud-compute/test/gapic_instances_v1.ts @@ -5340,8 +5340,9 @@ describe('v1.InstancesClient', () => { ); client.innerApiCalls.setShieldedInstanceIntegrityPolicy = stubSimpleCall(expectedResponse); - const [response] = - await client.setShieldedInstanceIntegrityPolicy(request); + const [response] = await client.setShieldedInstanceIntegrityPolicy( + request + ); assert.deepStrictEqual(response.latestResponse, expectedResponse); const actualRequest = ( client.innerApiCalls.setShieldedInstanceIntegrityPolicy as SinonStub diff --git a/packages/google-cloud-confidentialcomputing/src/v1/confidential_computing_client.ts b/packages/google-cloud-confidentialcomputing/src/v1/confidential_computing_client.ts index c31852e8452..5fc7c9f4354 100644 --- a/packages/google-cloud-confidentialcomputing/src/v1/confidential_computing_client.ts +++ b/packages/google-cloud-confidentialcomputing/src/v1/confidential_computing_client.ts @@ -91,8 +91,7 @@ export class ConfidentialComputingClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -100,7 +99,7 @@ export class ConfidentialComputingClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ConfidentialComputingClient({fallback: 'rest'}, gax); + * const client = new ConfidentialComputingClient({fallback: true}, gax); * ``` */ constructor( @@ -171,7 +170,7 @@ export class ConfidentialComputingClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-confidentialcomputing/src/v1alpha1/confidential_computing_client.ts b/packages/google-cloud-confidentialcomputing/src/v1alpha1/confidential_computing_client.ts index 8c4abc0a9bc..296a41e9614 100644 --- a/packages/google-cloud-confidentialcomputing/src/v1alpha1/confidential_computing_client.ts +++ b/packages/google-cloud-confidentialcomputing/src/v1alpha1/confidential_computing_client.ts @@ -91,8 +91,7 @@ export class ConfidentialComputingClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -100,7 +99,7 @@ export class ConfidentialComputingClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ConfidentialComputingClient({fallback: 'rest'}, gax); + * const client = new ConfidentialComputingClient({fallback: true}, gax); * ``` */ constructor( @@ -171,7 +170,7 @@ export class ConfidentialComputingClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { diff --git a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts index 169ce16a03d..aa713af5204 100644 --- a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts +++ b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts @@ -93,8 +93,7 @@ export class ContactCenterInsightsClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you @@ -102,7 +101,7 @@ export class ContactCenterInsightsClient { * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ContactCenterInsightsClient({fallback: 'rest'}, gax); + * const client = new ContactCenterInsightsClient({fallback: true}, gax); * ``` */ constructor( @@ -169,7 +168,7 @@ export class ContactCenterInsightsClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -242,7 +241,7 @@ export class ContactCenterInsightsClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ {