From e5ad564f74dc7a36c0e8cd8de173428a99f1deae 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:49:45 -0700 Subject: [PATCH] fix: [Many APIs] simplify logic for HTTP/1.1 REST fallback option (#4588) 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3JldG1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVjYS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXB1YmxpY2NhLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2VkaXJlY3RvcnkvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNoZWxsLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN0b3JhZ2VpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXN1cHBvcnQvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhbGVudC8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRleHR0b3NwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRwdS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRyYW5zbGF0ZS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLWxpdmVzdHJlYW0vLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXN0aXRjaGVyLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXRyYW5zY29kZXIvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvaW50ZWxsaWdlbmNlLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpc2lvbi8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZtbWlncmF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= * 🦉 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/secret_manager_service_client.ts | 7 +++--- .../certificate_authority_service_client.ts | 9 +++---- .../certificate_authority_service_client.ts | 9 +++---- ...c_certificate_authority_service_v1beta1.ts | 10 +++++--- ...ic_certificate_authority_service_client.ts | 7 +++--- .../src/v1/security_center_client.ts | 9 +++---- .../src/v1beta1/security_center_client.ts | 9 +++---- .../src/v1p1beta1/security_center_client.ts | 9 +++---- .../test/gapic_security_center_v1.ts | 25 +++++++++++-------- .../src/v1/lookup_service_client.ts | 7 +++--- .../src/v1/registration_service_client.ts | 7 +++--- .../src/v1beta1/lookup_service_client.ts | 7 +++--- .../v1beta1/registration_service_client.ts | 7 +++--- .../src/v1/cloud_shell_service_client.ts | 9 +++---- .../src/v1/adaptation_client.ts | 7 +++--- .../src/v1/speech_client.ts | 11 ++++---- .../src/v1p1beta1/adaptation_client.ts | 7 +++--- .../src/v1p1beta1/speech_client.ts | 11 ++++---- .../src/v2/speech_client.ts | 11 ++++---- .../samples/quickstart.js | 5 ++-- .../src/v1/storage_insights_client.ts | 7 +++--- .../src/v2/case_attachment_service_client.ts | 7 +++--- .../src/v2/case_service_client.ts | 7 +++--- .../src/v2/comment_service_client.ts | 7 +++--- .../src/v4/company_service_client.ts | 7 +++--- .../src/v4/completion_client.ts | 7 +++--- .../src/v4/event_service_client.ts | 7 +++--- .../src/v4/job_service_client.ts | 9 +++---- .../src/v4/tenant_service_client.ts | 7 +++--- .../src/v4beta1/company_service_client.ts | 7 +++--- .../src/v4beta1/completion_client.ts | 7 +++--- .../src/v4beta1/event_service_client.ts | 7 +++--- .../src/v4beta1/job_service_client.ts | 9 +++---- .../src/v4beta1/tenant_service_client.ts | 7 +++--- .../src/v2/cloud_tasks_client.ts | 7 +++--- .../src/v2beta2/cloud_tasks_client.ts | 7 +++--- .../src/v2beta3/cloud_tasks_client.ts | 7 +++--- .../src/v1/text_to_speech_client.ts | 7 +++--- ..._to_speech_long_audio_synthesize_client.ts | 9 +++---- .../src/v1beta1/text_to_speech_client.ts | 7 +++--- ..._to_speech_long_audio_synthesize_client.ts | 9 +++---- .../google-cloud-tpu/src/v1/tpu_client.ts | 9 +++---- .../google-cloud-tpu/src/v2/tpu_client.ts | 9 +++---- .../src/v2alpha1/tpu_client.ts | 9 +++---- .../src/v3/translation_service_client.ts | 9 +++---- .../src/v3beta1/translation_service_client.ts | 9 +++---- .../src/v1/livestream_service_client.ts | 9 +++---- .../src/v1/video_stitcher_service_client.ts | 9 +++---- .../src/v1/transcoder_service_client.ts | 7 +++--- .../v1/video_intelligence_service_client.ts | 9 +++---- .../video_intelligence_service_client.ts | 9 +++---- .../video_intelligence_service_client.ts | 9 +++---- .../video_intelligence_service_client.ts | 9 +++---- ...aming_video_intelligence_service_client.ts | 9 +++---- .../video_intelligence_service_client.ts | 9 +++---- .../src/v1/image_annotator_client.ts | 9 +++---- .../src/v1/product_search_client.ts | 9 +++---- .../src/v1p1beta1/image_annotator_client.ts | 7 +++--- .../src/v1p2beta1/image_annotator_client.ts | 9 +++---- .../src/v1p3beta1/image_annotator_client.ts | 9 +++---- .../src/v1p3beta1/product_search_client.ts | 9 +++---- .../src/v1p4beta1/image_annotator_client.ts | 9 +++---- .../src/v1p4beta1/product_search_client.ts | 9 +++---- .../src/v1/vm_migration_client.ts | 9 +++---- 64 files changed, 244 insertions(+), 297 deletions(-) diff --git a/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts b/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts index e094af0f8ef..55ffd6c8a55 100644 --- a/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts +++ b/packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts @@ -96,8 +96,7 @@ export class SecretManagerServiceClient { * 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 SecretManagerServiceClient { * 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 SecretManagerServiceClient({fallback: 'rest'}, gax); + * const client = new SecretManagerServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -171,7 +170,7 @@ export class SecretManagerServiceClient { } 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-security-privateca/src/v1/certificate_authority_service_client.ts b/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts index 192c6056970..87d60d9be82 100644 --- a/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts +++ b/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts @@ -101,8 +101,7 @@ export class CertificateAuthorityServiceClient { * 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 @@ -110,7 +109,7 @@ export class CertificateAuthorityServiceClient { * 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 CertificateAuthorityServiceClient({fallback: 'rest'}, gax); + * const client = new CertificateAuthorityServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -183,7 +182,7 @@ export class CertificateAuthorityServiceClient { } 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) { @@ -255,7 +254,7 @@ export class CertificateAuthorityServiceClient { 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-security-privateca/src/v1beta1/certificate_authority_service_client.ts b/packages/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts index 940493b8ed5..5edb27b4016 100644 --- a/packages/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts +++ b/packages/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts @@ -94,8 +94,7 @@ export class CertificateAuthorityServiceClient { * 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 @@ -103,7 +102,7 @@ export class CertificateAuthorityServiceClient { * 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 CertificateAuthorityServiceClient({fallback: 'rest'}, gax); + * const client = new CertificateAuthorityServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -170,7 +169,7 @@ export class CertificateAuthorityServiceClient { } 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 CertificateAuthorityServiceClient { 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-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts b/packages/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts index 7ab6d851feb..382b4ee0061 100644 --- a/packages/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts +++ b/packages/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts @@ -2547,8 +2547,9 @@ describe('v1beta1.CertificateAuthorityServiceClient', () => { ); client.innerApiCalls.scheduleDeleteCertificateAuthority = stubLongRunningCall(expectedResponse); - const [operation] = - await client.scheduleDeleteCertificateAuthority(request); + const [operation] = await client.scheduleDeleteCertificateAuthority( + request + ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( @@ -2674,8 +2675,9 @@ describe('v1beta1.CertificateAuthorityServiceClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.scheduleDeleteCertificateAuthority = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = - await client.scheduleDeleteCertificateAuthority(request); + const [operation] = await client.scheduleDeleteCertificateAuthority( + request + ); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub diff --git a/packages/google-cloud-security-publicca/src/v1beta1/public_certificate_authority_service_client.ts b/packages/google-cloud-security-publicca/src/v1beta1/public_certificate_authority_service_client.ts index e451f050fd7..1be6988a422 100644 --- a/packages/google-cloud-security-publicca/src/v1beta1/public_certificate_authority_service_client.ts +++ b/packages/google-cloud-security-publicca/src/v1beta1/public_certificate_authority_service_client.ts @@ -90,8 +90,7 @@ export class PublicCertificateAuthorityServiceClient { * 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 PublicCertificateAuthorityServiceClient { * 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 PublicCertificateAuthorityServiceClient({fallback: 'rest'}, gax); + * const client = new PublicCertificateAuthorityServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class PublicCertificateAuthorityServiceClient { } 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-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index 53181205d97..e2889aa3aa9 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -93,8 +93,7 @@ export class SecurityCenterClient { * 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 SecurityCenterClient { * 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 SecurityCenterClient({fallback: 'rest'}, gax); + * const client = new SecurityCenterClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class SecurityCenterClient { } 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) { @@ -378,7 +377,7 @@ export class SecurityCenterClient { 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-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 6c4910d9514..44942a3a7f4 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -93,8 +93,7 @@ export class SecurityCenterClient { * 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 SecurityCenterClient { * 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 SecurityCenterClient({fallback: 'rest'}, gax); + * const client = new SecurityCenterClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class SecurityCenterClient { } 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) { @@ -245,7 +244,7 @@ export class SecurityCenterClient { 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-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index 2334e4790c2..47f5f9c9d39 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -93,8 +93,7 @@ export class SecurityCenterClient { * 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 SecurityCenterClient { * 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 SecurityCenterClient({fallback: 'rest'}, gax); + * const client = new SecurityCenterClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class SecurityCenterClient { } 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) { @@ -285,7 +284,7 @@ export class SecurityCenterClient { 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-securitycenter/test/gapic_security_center_v1.ts b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts index 405a099afe9..b856fe47c73 100644 --- a/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts +++ b/packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts @@ -280,8 +280,9 @@ describe('v1.SecurityCenterClient', () => { ); client.innerApiCalls.createSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = - await client.createSecurityHealthAnalyticsCustomModule(request); + const [response] = await client.createSecurityHealthAnalyticsCustomModule( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls @@ -1216,8 +1217,9 @@ describe('v1.SecurityCenterClient', () => { ); client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = - await client.deleteSecurityHealthAnalyticsCustomModule(request); + const [response] = await client.deleteSecurityHealthAnalyticsCustomModule( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls @@ -2164,8 +2166,9 @@ describe('v1.SecurityCenterClient', () => { ); client.innerApiCalls.getSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = - await client.getSecurityHealthAnalyticsCustomModule(request); + const [response] = await client.getSecurityHealthAnalyticsCustomModule( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub @@ -3631,8 +3634,9 @@ describe('v1.SecurityCenterClient', () => { ); client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule = stubSimpleCall(expectedResponse); - const [response] = - await client.updateSecurityHealthAnalyticsCustomModule(request); + const [response] = await client.updateSecurityHealthAnalyticsCustomModule( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls @@ -7677,8 +7681,9 @@ describe('v1.SecurityCenterClient', () => { ]; client.innerApiCalls.listSecurityHealthAnalyticsCustomModules = stubSimpleCall(expectedResponse); - const [response] = - await client.listSecurityHealthAnalyticsCustomModules(request); + const [response] = await client.listSecurityHealthAnalyticsCustomModules( + request + ); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls diff --git a/packages/google-cloud-servicedirectory/src/v1/lookup_service_client.ts b/packages/google-cloud-servicedirectory/src/v1/lookup_service_client.ts index 4164452cb46..6731aed5233 100644 --- a/packages/google-cloud-servicedirectory/src/v1/lookup_service_client.ts +++ b/packages/google-cloud-servicedirectory/src/v1/lookup_service_client.ts @@ -91,8 +91,7 @@ export class LookupServiceClient { * 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 LookupServiceClient { * 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 LookupServiceClient({fallback: 'rest'}, gax); + * const client = new LookupServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -170,7 +169,7 @@ export class LookupServiceClient { } 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-servicedirectory/src/v1/registration_service_client.ts b/packages/google-cloud-servicedirectory/src/v1/registration_service_client.ts index e8d46ec3148..a2908d6c350 100644 --- a/packages/google-cloud-servicedirectory/src/v1/registration_service_client.ts +++ b/packages/google-cloud-servicedirectory/src/v1/registration_service_client.ts @@ -107,8 +107,7 @@ export class RegistrationServiceClient { * 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 @@ -116,7 +115,7 @@ export class RegistrationServiceClient { * 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 RegistrationServiceClient({fallback: 'rest'}, gax); + * const client = new RegistrationServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -186,7 +185,7 @@ export class RegistrationServiceClient { } 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-servicedirectory/src/v1beta1/lookup_service_client.ts b/packages/google-cloud-servicedirectory/src/v1beta1/lookup_service_client.ts index 80c4d040885..546693bebf7 100644 --- a/packages/google-cloud-servicedirectory/src/v1beta1/lookup_service_client.ts +++ b/packages/google-cloud-servicedirectory/src/v1beta1/lookup_service_client.ts @@ -91,8 +91,7 @@ export class LookupServiceClient { * 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 LookupServiceClient { * 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 LookupServiceClient({fallback: 'rest'}, gax); + * const client = new LookupServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -170,7 +169,7 @@ export class LookupServiceClient { } 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-servicedirectory/src/v1beta1/registration_service_client.ts b/packages/google-cloud-servicedirectory/src/v1beta1/registration_service_client.ts index 8918d80c077..e7e5556dc81 100644 --- a/packages/google-cloud-servicedirectory/src/v1beta1/registration_service_client.ts +++ b/packages/google-cloud-servicedirectory/src/v1beta1/registration_service_client.ts @@ -107,8 +107,7 @@ export class RegistrationServiceClient { * 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 @@ -116,7 +115,7 @@ export class RegistrationServiceClient { * 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 RegistrationServiceClient({fallback: 'rest'}, gax); + * const client = new RegistrationServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -186,7 +185,7 @@ export class RegistrationServiceClient { } 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-shell/src/v1/cloud_shell_service_client.ts b/packages/google-cloud-shell/src/v1/cloud_shell_service_client.ts index 3503ec08a40..280a6835996 100644 --- a/packages/google-cloud-shell/src/v1/cloud_shell_service_client.ts +++ b/packages/google-cloud-shell/src/v1/cloud_shell_service_client.ts @@ -97,8 +97,7 @@ export class CloudShellServiceClient { * 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 @@ -106,7 +105,7 @@ export class CloudShellServiceClient { * 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 CloudShellServiceClient({fallback: 'rest'}, gax); + * const client = new CloudShellServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -172,7 +171,7 @@ export class CloudShellServiceClient { } 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) { @@ -198,7 +197,7 @@ export class CloudShellServiceClient { 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-speech/src/v1/adaptation_client.ts b/packages/google-cloud-speech/src/v1/adaptation_client.ts index f305369dd46..117a88ca748 100644 --- a/packages/google-cloud-speech/src/v1/adaptation_client.ts +++ b/packages/google-cloud-speech/src/v1/adaptation_client.ts @@ -90,8 +90,7 @@ export class AdaptationClient { * 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 AdaptationClient { * 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 AdaptationClient({fallback: 'rest'}, gax); + * const client = new AdaptationClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class AdaptationClient { } 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-speech/src/v1/speech_client.ts b/packages/google-cloud-speech/src/v1/speech_client.ts index 6721108a843..39a2de42e62 100644 --- a/packages/google-cloud-speech/src/v1/speech_client.ts +++ b/packages/google-cloud-speech/src/v1/speech_client.ts @@ -91,8 +91,7 @@ export class SpeechClient { * 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 SpeechClient { * 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 SpeechClient({fallback: 'rest'}, gax); + * const client = new SpeechClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class SpeechClient { } 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) { @@ -192,7 +191,7 @@ export class SpeechClient { this.descriptors.stream = { streamingRecognize: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, - opts.fallback === 'rest' + !!opts.fallback ), }; @@ -204,7 +203,7 @@ export class SpeechClient { 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-speech/src/v1p1beta1/adaptation_client.ts b/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts index c5bfc82528c..6075e6b0b61 100644 --- a/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts +++ b/packages/google-cloud-speech/src/v1p1beta1/adaptation_client.ts @@ -90,8 +90,7 @@ export class AdaptationClient { * 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 AdaptationClient { * 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 AdaptationClient({fallback: 'rest'}, gax); + * const client = new AdaptationClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class AdaptationClient { } 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-speech/src/v1p1beta1/speech_client.ts b/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts index b51ac83de90..61cff839a4e 100644 --- a/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts +++ b/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts @@ -91,8 +91,7 @@ export class SpeechClient { * 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 SpeechClient { * 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 SpeechClient({fallback: 'rest'}, gax); + * const client = new SpeechClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class SpeechClient { } 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) { @@ -192,7 +191,7 @@ export class SpeechClient { this.descriptors.stream = { streamingRecognize: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, - opts.fallback === 'rest' + !!opts.fallback ), }; @@ -204,7 +203,7 @@ export class SpeechClient { 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-speech/src/v2/speech_client.ts b/packages/google-cloud-speech/src/v2/speech_client.ts index 74d73adee99..65af81326ba 100644 --- a/packages/google-cloud-speech/src/v2/speech_client.ts +++ b/packages/google-cloud-speech/src/v2/speech_client.ts @@ -96,8 +96,7 @@ export class SpeechClient { * 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 SpeechClient { * 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 SpeechClient({fallback: 'rest'}, gax); + * const client = new SpeechClient({fallback: true}, gax); * ``` */ constructor( @@ -175,7 +174,7 @@ export class SpeechClient { } 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) { @@ -240,7 +239,7 @@ export class SpeechClient { this.descriptors.stream = { streamingRecognize: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, - opts.fallback === 'rest' + !!opts.fallback ), }; @@ -252,7 +251,7 @@ export class SpeechClient { 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-storageinsights/samples/quickstart.js b/packages/google-cloud-storageinsights/samples/quickstart.js index 1489f4051be..9e8745bcff0 100644 --- a/packages/google-cloud-storageinsights/samples/quickstart.js +++ b/packages/google-cloud-storageinsights/samples/quickstart.js @@ -61,8 +61,9 @@ function main(parent) { }; // Run request - const iterable = - await storageinsightsClient.listReportConfigsAsync(request); + const iterable = await storageinsightsClient.listReportConfigsAsync( + request + ); for await (const response of iterable) { console.log(response); } diff --git a/packages/google-cloud-storageinsights/src/v1/storage_insights_client.ts b/packages/google-cloud-storageinsights/src/v1/storage_insights_client.ts index f0bec19be45..734e1699718 100644 --- a/packages/google-cloud-storageinsights/src/v1/storage_insights_client.ts +++ b/packages/google-cloud-storageinsights/src/v1/storage_insights_client.ts @@ -93,8 +93,7 @@ export class StorageInsightsClient { * 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 StorageInsightsClient { * 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 StorageInsightsClient({fallback: 'rest'}, gax); + * const client = new StorageInsightsClient({fallback: true}, gax); * ``` */ constructor( @@ -172,7 +171,7 @@ export class StorageInsightsClient { } 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-support/src/v2/case_attachment_service_client.ts b/packages/google-cloud-support/src/v2/case_attachment_service_client.ts index 5b4a689afe2..f7d0867a5f3 100644 --- a/packages/google-cloud-support/src/v2/case_attachment_service_client.ts +++ b/packages/google-cloud-support/src/v2/case_attachment_service_client.ts @@ -90,8 +90,7 @@ export class CaseAttachmentServiceClient { * 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 CaseAttachmentServiceClient { * 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 CaseAttachmentServiceClient({fallback: 'rest'}, gax); + * const client = new CaseAttachmentServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class CaseAttachmentServiceClient { } 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-support/src/v2/case_service_client.ts b/packages/google-cloud-support/src/v2/case_service_client.ts index 91f39a03bd9..26cba98904f 100644 --- a/packages/google-cloud-support/src/v2/case_service_client.ts +++ b/packages/google-cloud-support/src/v2/case_service_client.ts @@ -90,8 +90,7 @@ export class CaseServiceClient { * 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 CaseServiceClient { * 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 CaseServiceClient({fallback: 'rest'}, gax); + * const client = new CaseServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class CaseServiceClient { } 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-support/src/v2/comment_service_client.ts b/packages/google-cloud-support/src/v2/comment_service_client.ts index 0724acae14d..7ba90069dde 100644 --- a/packages/google-cloud-support/src/v2/comment_service_client.ts +++ b/packages/google-cloud-support/src/v2/comment_service_client.ts @@ -90,8 +90,7 @@ export class CommentServiceClient { * 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 CommentServiceClient { * 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 CommentServiceClient({fallback: 'rest'}, gax); + * const client = new CommentServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class CommentServiceClient { } 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-talent/src/v4/company_service_client.ts b/packages/google-cloud-talent/src/v4/company_service_client.ts index c8138428443..4c56e4de709 100644 --- a/packages/google-cloud-talent/src/v4/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4/company_service_client.ts @@ -90,8 +90,7 @@ export class CompanyServiceClient { * 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 CompanyServiceClient { * 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 CompanyServiceClient({fallback: 'rest'}, gax); + * const client = new CompanyServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class CompanyServiceClient { } 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-talent/src/v4/completion_client.ts b/packages/google-cloud-talent/src/v4/completion_client.ts index 15472bec15d..cd973b7d20b 100644 --- a/packages/google-cloud-talent/src/v4/completion_client.ts +++ b/packages/google-cloud-talent/src/v4/completion_client.ts @@ -88,8 +88,7 @@ export class CompletionClient { * 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 CompletionClient { * 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 CompletionClient({fallback: 'rest'}, gax); + * const client = new CompletionClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class CompletionClient { } 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-talent/src/v4/event_service_client.ts b/packages/google-cloud-talent/src/v4/event_service_client.ts index d6e32f79009..f4f0e24b22e 100644 --- a/packages/google-cloud-talent/src/v4/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4/event_service_client.ts @@ -88,8 +88,7 @@ export class EventServiceClient { * 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 EventServiceClient { * 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 EventServiceClient({fallback: 'rest'}, gax); + * const client = new EventServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class EventServiceClient { } 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-talent/src/v4/job_service_client.ts b/packages/google-cloud-talent/src/v4/job_service_client.ts index fa446466be1..24a30dbf6a4 100644 --- a/packages/google-cloud-talent/src/v4/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4/job_service_client.ts @@ -93,8 +93,7 @@ export class JobServiceClient { * 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 JobServiceClient { * 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 JobServiceClient({fallback: 'rest'}, gax); + * const client = new JobServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class JobServiceClient { } 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) { @@ -214,7 +213,7 @@ export class JobServiceClient { 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-talent/src/v4/tenant_service_client.ts b/packages/google-cloud-talent/src/v4/tenant_service_client.ts index 3115b57f9ff..c09a24b5bef 100644 --- a/packages/google-cloud-talent/src/v4/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4/tenant_service_client.ts @@ -90,8 +90,7 @@ export class TenantServiceClient { * 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 TenantServiceClient { * 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 TenantServiceClient({fallback: 'rest'}, gax); + * const client = new TenantServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class TenantServiceClient { } 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-talent/src/v4beta1/company_service_client.ts b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts index 4ac31fcd9eb..8a000c493ae 100644 --- a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts @@ -90,8 +90,7 @@ export class CompanyServiceClient { * 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 CompanyServiceClient { * 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 CompanyServiceClient({fallback: 'rest'}, gax); + * const client = new CompanyServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class CompanyServiceClient { } 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-talent/src/v4beta1/completion_client.ts b/packages/google-cloud-talent/src/v4beta1/completion_client.ts index 0469039a6a6..f66015219f0 100644 --- a/packages/google-cloud-talent/src/v4beta1/completion_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/completion_client.ts @@ -88,8 +88,7 @@ export class CompletionClient { * 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 CompletionClient { * 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 CompletionClient({fallback: 'rest'}, gax); + * const client = new CompletionClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class CompletionClient { } 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-talent/src/v4beta1/event_service_client.ts b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts index 0988c2d7705..5a896513066 100644 --- a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts @@ -88,8 +88,7 @@ export class EventServiceClient { * 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 EventServiceClient { * 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 EventServiceClient({fallback: 'rest'}, gax); + * const client = new EventServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class EventServiceClient { } 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-talent/src/v4beta1/job_service_client.ts b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts index 6d564619f4f..1d3adc099cf 100644 --- a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts @@ -93,8 +93,7 @@ export class JobServiceClient { * 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 JobServiceClient { * 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 JobServiceClient({fallback: 'rest'}, gax); + * const client = new JobServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class JobServiceClient { } 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) { @@ -220,7 +219,7 @@ export class JobServiceClient { 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-talent/src/v4beta1/tenant_service_client.ts b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts index a2a5be7a0f2..94765e31a66 100644 --- a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts @@ -90,8 +90,7 @@ export class TenantServiceClient { * 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 TenantServiceClient { * 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 TenantServiceClient({fallback: 'rest'}, gax); + * const client = new TenantServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -165,7 +164,7 @@ export class TenantServiceClient { } 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-tasks/src/v2/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts index 7ddd36d61b0..47eb902428a 100644 --- a/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts @@ -94,8 +94,7 @@ export class CloudTasksClient { * 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 @@ -103,7 +102,7 @@ export class CloudTasksClient { * 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 CloudTasksClient({fallback: 'rest'}, gax); + * const client = new CloudTasksClient({fallback: true}, gax); * ``` */ constructor( @@ -173,7 +172,7 @@ export class CloudTasksClient { } 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-tasks/src/v2beta2/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts index 6f9aa3c0851..fb7621661e0 100644 --- a/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts @@ -94,8 +94,7 @@ export class CloudTasksClient { * 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 @@ -103,7 +102,7 @@ export class CloudTasksClient { * 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 CloudTasksClient({fallback: 'rest'}, gax); + * const client = new CloudTasksClient({fallback: true}, gax); * ``` */ constructor( @@ -173,7 +172,7 @@ export class CloudTasksClient { } 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-tasks/src/v2beta3/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts index a3f48104f06..a88ea7d683e 100644 --- a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts @@ -94,8 +94,7 @@ export class CloudTasksClient { * 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 @@ -103,7 +102,7 @@ export class CloudTasksClient { * 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 CloudTasksClient({fallback: 'rest'}, gax); + * const client = new CloudTasksClient({fallback: true}, gax); * ``` */ constructor( @@ -173,7 +172,7 @@ export class CloudTasksClient { } 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-texttospeech/src/v1/text_to_speech_client.ts b/packages/google-cloud-texttospeech/src/v1/text_to_speech_client.ts index 1cca6c8dc01..cc3a1682d0f 100644 --- a/packages/google-cloud-texttospeech/src/v1/text_to_speech_client.ts +++ b/packages/google-cloud-texttospeech/src/v1/text_to_speech_client.ts @@ -88,8 +88,7 @@ export class TextToSpeechClient { * 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 TextToSpeechClient { * 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 TextToSpeechClient({fallback: 'rest'}, gax); + * const client = new TextToSpeechClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class TextToSpeechClient { } 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-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts b/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts index 2e046e85f2a..def49d81fba 100644 --- a/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts +++ b/packages/google-cloud-texttospeech/src/v1/text_to_speech_long_audio_synthesize_client.ts @@ -90,8 +90,7 @@ export class TextToSpeechLongAudioSynthesizeClient { * 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 TextToSpeechLongAudioSynthesizeClient { * 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 TextToSpeechLongAudioSynthesizeClient({fallback: 'rest'}, gax); + * const client = new TextToSpeechLongAudioSynthesizeClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class TextToSpeechLongAudioSynthesizeClient { } 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) { @@ -183,7 +182,7 @@ export class TextToSpeechLongAudioSynthesizeClient { 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-texttospeech/src/v1beta1/text_to_speech_client.ts b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts index 7b85dfef648..4117d3f7ca1 100644 --- a/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts +++ b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_client.ts @@ -88,8 +88,7 @@ export class TextToSpeechClient { * 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 TextToSpeechClient { * 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 TextToSpeechClient({fallback: 'rest'}, gax); + * const client = new TextToSpeechClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class TextToSpeechClient { } 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-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts index e75081dae51..ebe826d4026 100644 --- a/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts +++ b/packages/google-cloud-texttospeech/src/v1beta1/text_to_speech_long_audio_synthesize_client.ts @@ -90,8 +90,7 @@ export class TextToSpeechLongAudioSynthesizeClient { * 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 TextToSpeechLongAudioSynthesizeClient { * 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 TextToSpeechLongAudioSynthesizeClient({fallback: 'rest'}, gax); + * const client = new TextToSpeechLongAudioSynthesizeClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class TextToSpeechLongAudioSynthesizeClient { } 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) { @@ -183,7 +182,7 @@ export class TextToSpeechLongAudioSynthesizeClient { 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-tpu/src/v1/tpu_client.ts b/packages/google-cloud-tpu/src/v1/tpu_client.ts index bfd13a1f7e2..a1092f9b79a 100644 --- a/packages/google-cloud-tpu/src/v1/tpu_client.ts +++ b/packages/google-cloud-tpu/src/v1/tpu_client.ts @@ -98,8 +98,7 @@ export class TpuClient { * 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 TpuClient { * 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 TpuClient({fallback: 'rest'}, gax); + * const client = new TpuClient({fallback: true}, gax); * ``` */ constructor( @@ -177,7 +176,7 @@ export class TpuClient { } 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 TpuClient { 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-tpu/src/v2/tpu_client.ts b/packages/google-cloud-tpu/src/v2/tpu_client.ts index 0b34cb371d6..3b00845f391 100644 --- a/packages/google-cloud-tpu/src/v2/tpu_client.ts +++ b/packages/google-cloud-tpu/src/v2/tpu_client.ts @@ -98,8 +98,7 @@ export class TpuClient { * 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 TpuClient { * 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 TpuClient({fallback: 'rest'}, gax); + * const client = new TpuClient({fallback: true}, gax); * ``` */ constructor( @@ -177,7 +176,7 @@ export class TpuClient { } 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 TpuClient { 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-tpu/src/v2alpha1/tpu_client.ts b/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts index daec7573a28..2b08f1d8547 100644 --- a/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts +++ b/packages/google-cloud-tpu/src/v2alpha1/tpu_client.ts @@ -98,8 +98,7 @@ export class TpuClient { * 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 TpuClient { * 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 TpuClient({fallback: 'rest'}, gax); + * const client = new TpuClient({fallback: true}, gax); * ``` */ constructor( @@ -177,7 +176,7 @@ export class TpuClient { } 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 TpuClient { 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-translate/src/v3/translation_service_client.ts b/packages/google-cloud-translate/src/v3/translation_service_client.ts index fdf67909f6c..70bf73448a4 100644 --- a/packages/google-cloud-translate/src/v3/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3/translation_service_client.ts @@ -93,8 +93,7 @@ export class TranslationServiceClient { * 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 TranslationServiceClient { * 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 TranslationServiceClient({fallback: 'rest'}, gax); + * const client = new TranslationServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class TranslationServiceClient { } 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) { @@ -208,7 +207,7 @@ export class TranslationServiceClient { 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-translate/src/v3beta1/translation_service_client.ts b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts index 18b93d9fd0b..7b4eb4ef614 100644 --- a/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts +++ b/packages/google-cloud-translate/src/v3beta1/translation_service_client.ts @@ -93,8 +93,7 @@ export class TranslationServiceClient { * 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 TranslationServiceClient { * 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 TranslationServiceClient({fallback: 'rest'}, gax); + * const client = new TranslationServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class TranslationServiceClient { } 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) { @@ -208,7 +207,7 @@ export class TranslationServiceClient { 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-video-livestream/src/v1/livestream_service_client.ts b/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts index 20cc3ff8e40..d653d050e47 100644 --- a/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts +++ b/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts @@ -100,8 +100,7 @@ export class LivestreamServiceClient { * 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 @@ -109,7 +108,7 @@ export class LivestreamServiceClient { * 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 LivestreamServiceClient({fallback: 'rest'}, gax); + * const client = new LivestreamServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -179,7 +178,7 @@ export class LivestreamServiceClient { } 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) { @@ -249,7 +248,7 @@ export class LivestreamServiceClient { 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-video-stitcher/src/v1/video_stitcher_service_client.ts b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts index 957b7aa91e2..85bef984e74 100644 --- a/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts +++ b/packages/google-cloud-video-stitcher/src/v1/video_stitcher_service_client.ts @@ -97,8 +97,7 @@ export class VideoStitcherServiceClient { * 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 @@ -106,7 +105,7 @@ export class VideoStitcherServiceClient { * 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 VideoStitcherServiceClient({fallback: 'rest'}, gax); + * const client = new VideoStitcherServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -172,7 +171,7 @@ export class VideoStitcherServiceClient { } 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) { @@ -261,7 +260,7 @@ export class VideoStitcherServiceClient { 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-video-transcoder/src/v1/transcoder_service_client.ts b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client.ts index 5f61c080af0..3abc99e7239 100644 --- a/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client.ts +++ b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client.ts @@ -95,8 +95,7 @@ export class TranscoderServiceClient { * 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 TranscoderServiceClient { * 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 TranscoderServiceClient({fallback: 'rest'}, gax); + * const client = new TranscoderServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -170,7 +169,7 @@ export class TranscoderServiceClient { } 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-videointelligence/src/v1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.ts index 815a392ee40..643ac46ecf3 100644 --- a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.ts +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.ts @@ -90,8 +90,7 @@ export class VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient({fallback: 'rest'}, gax); + * const client = new VideoIntelligenceServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class VideoIntelligenceServiceClient { } 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) { @@ -183,7 +182,7 @@ export class VideoIntelligenceServiceClient { 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-videointelligence/src/v1beta2/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.ts index e1bdc6f8010..7ade7519883 100644 --- a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.ts +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.ts @@ -90,8 +90,7 @@ export class VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient({fallback: 'rest'}, gax); + * const client = new VideoIntelligenceServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class VideoIntelligenceServiceClient { } 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) { @@ -183,7 +182,7 @@ export class VideoIntelligenceServiceClient { 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-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts index 97b6ddc95b8..952f5e1a92b 100644 --- a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts @@ -90,8 +90,7 @@ export class VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient({fallback: 'rest'}, gax); + * const client = new VideoIntelligenceServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class VideoIntelligenceServiceClient { } 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) { @@ -183,7 +182,7 @@ export class VideoIntelligenceServiceClient { 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-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts index da3ac58ae14..098c7553acb 100644 --- a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts @@ -90,8 +90,7 @@ export class VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient({fallback: 'rest'}, gax); + * const client = new VideoIntelligenceServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class VideoIntelligenceServiceClient { } 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) { @@ -183,7 +182,7 @@ export class VideoIntelligenceServiceClient { 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-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts index 090c93bee4b..b247dbb1c46 100644 --- a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts @@ -87,8 +87,7 @@ export class StreamingVideoIntelligenceServiceClient { * 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 StreamingVideoIntelligenceServiceClient { * 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 StreamingVideoIntelligenceServiceClient({fallback: 'rest'}, gax); + * const client = new StreamingVideoIntelligenceServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -163,7 +162,7 @@ export class StreamingVideoIntelligenceServiceClient { } 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) { @@ -177,7 +176,7 @@ export class StreamingVideoIntelligenceServiceClient { this.descriptors.stream = { streamingAnnotateVideo: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, - opts.fallback === 'rest' + !!opts.fallback ), }; diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts index 3a5bbc89d61..5f3f5b43754 100644 --- a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts @@ -90,8 +90,7 @@ export class VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient { * 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 VideoIntelligenceServiceClient({fallback: 'rest'}, gax); + * const client = new VideoIntelligenceServiceClient({fallback: true}, gax); * ``` */ constructor( @@ -166,7 +165,7 @@ export class VideoIntelligenceServiceClient { } 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) { @@ -183,7 +182,7 @@ export class VideoIntelligenceServiceClient { 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-vision/src/v1/image_annotator_client.ts b/packages/google-cloud-vision/src/v1/image_annotator_client.ts index f66056a0185..5ea6e6a2506 100644 --- a/packages/google-cloud-vision/src/v1/image_annotator_client.ts +++ b/packages/google-cloud-vision/src/v1/image_annotator_client.ts @@ -93,8 +93,7 @@ export class ImageAnnotatorClient { * 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 ImageAnnotatorClient { * 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 ImageAnnotatorClient({fallback: 'rest'}, gax); + * const client = new ImageAnnotatorClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class ImageAnnotatorClient { } 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) { @@ -200,7 +199,7 @@ export class ImageAnnotatorClient { 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-vision/src/v1/product_search_client.ts b/packages/google-cloud-vision/src/v1/product_search_client.ts index 4699bcc5333..2b2c3a594f7 100644 --- a/packages/google-cloud-vision/src/v1/product_search_client.ts +++ b/packages/google-cloud-vision/src/v1/product_search_client.ts @@ -106,8 +106,7 @@ export class ProductSearchClient { * 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 @@ -115,7 +114,7 @@ export class ProductSearchClient { * 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 ProductSearchClient({fallback: 'rest'}, gax); + * const client = new ProductSearchClient({fallback: true}, gax); * ``` */ constructor( @@ -181,7 +180,7 @@ export class ProductSearchClient { } 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 ProductSearchClient { 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-vision/src/v1p1beta1/image_annotator_client.ts b/packages/google-cloud-vision/src/v1p1beta1/image_annotator_client.ts index 5a8aab291db..473a9f039b1 100644 --- a/packages/google-cloud-vision/src/v1p1beta1/image_annotator_client.ts +++ b/packages/google-cloud-vision/src/v1p1beta1/image_annotator_client.ts @@ -89,8 +89,7 @@ export class ImageAnnotatorClient { * 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 ImageAnnotatorClient { * 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 ImageAnnotatorClient({fallback: 'rest'}, gax); + * const client = new ImageAnnotatorClient({fallback: true}, gax); * ``` */ constructor( @@ -164,7 +163,7 @@ export class ImageAnnotatorClient { } 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-vision/src/v1p2beta1/image_annotator_client.ts b/packages/google-cloud-vision/src/v1p2beta1/image_annotator_client.ts index 2b079f17b57..fcb1a7be982 100644 --- a/packages/google-cloud-vision/src/v1p2beta1/image_annotator_client.ts +++ b/packages/google-cloud-vision/src/v1p2beta1/image_annotator_client.ts @@ -92,8 +92,7 @@ export class ImageAnnotatorClient { * 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 ImageAnnotatorClient { * 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 ImageAnnotatorClient({fallback: 'rest'}, gax); + * const client = new ImageAnnotatorClient({fallback: true}, gax); * ``` */ constructor( @@ -167,7 +166,7 @@ export class ImageAnnotatorClient { } 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) { @@ -184,7 +183,7 @@ export class ImageAnnotatorClient { 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-vision/src/v1p3beta1/image_annotator_client.ts b/packages/google-cloud-vision/src/v1p3beta1/image_annotator_client.ts index 6b2a369fa1a..e84e777aaf4 100644 --- a/packages/google-cloud-vision/src/v1p3beta1/image_annotator_client.ts +++ b/packages/google-cloud-vision/src/v1p3beta1/image_annotator_client.ts @@ -93,8 +93,7 @@ export class ImageAnnotatorClient { * 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 ImageAnnotatorClient { * 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 ImageAnnotatorClient({fallback: 'rest'}, gax); + * const client = new ImageAnnotatorClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class ImageAnnotatorClient { } 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) { @@ -200,7 +199,7 @@ export class ImageAnnotatorClient { 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-vision/src/v1p3beta1/product_search_client.ts b/packages/google-cloud-vision/src/v1p3beta1/product_search_client.ts index e505e9e3f43..1d1f0ecca9a 100644 --- a/packages/google-cloud-vision/src/v1p3beta1/product_search_client.ts +++ b/packages/google-cloud-vision/src/v1p3beta1/product_search_client.ts @@ -106,8 +106,7 @@ export class ProductSearchClient { * 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 @@ -115,7 +114,7 @@ export class ProductSearchClient { * 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 ProductSearchClient({fallback: 'rest'}, gax); + * const client = new ProductSearchClient({fallback: true}, gax); * ``` */ constructor( @@ -181,7 +180,7 @@ export class ProductSearchClient { } 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 ProductSearchClient { 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-vision/src/v1p4beta1/image_annotator_client.ts b/packages/google-cloud-vision/src/v1p4beta1/image_annotator_client.ts index efd0fdab521..db7614ccb5d 100644 --- a/packages/google-cloud-vision/src/v1p4beta1/image_annotator_client.ts +++ b/packages/google-cloud-vision/src/v1p4beta1/image_annotator_client.ts @@ -93,8 +93,7 @@ export class ImageAnnotatorClient { * 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 ImageAnnotatorClient { * 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 ImageAnnotatorClient({fallback: 'rest'}, gax); + * const client = new ImageAnnotatorClient({fallback: true}, gax); * ``` */ constructor( @@ -168,7 +167,7 @@ export class ImageAnnotatorClient { } 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) { @@ -200,7 +199,7 @@ export class ImageAnnotatorClient { 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-vision/src/v1p4beta1/product_search_client.ts b/packages/google-cloud-vision/src/v1p4beta1/product_search_client.ts index b4d556f0d7d..da2aab302ab 100644 --- a/packages/google-cloud-vision/src/v1p4beta1/product_search_client.ts +++ b/packages/google-cloud-vision/src/v1p4beta1/product_search_client.ts @@ -110,8 +110,7 @@ export class ProductSearchClient { * 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 @@ -119,7 +118,7 @@ export class ProductSearchClient { * 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 ProductSearchClient({fallback: 'rest'}, gax); + * const client = new ProductSearchClient({fallback: true}, gax); * ``` */ constructor( @@ -185,7 +184,7 @@ export class ProductSearchClient { } 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) { @@ -246,7 +245,7 @@ export class ProductSearchClient { 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-vmmigration/src/v1/vm_migration_client.ts b/packages/google-cloud-vmmigration/src/v1/vm_migration_client.ts index 5db2113d4a5..acd71fb3afe 100644 --- a/packages/google-cloud-vmmigration/src/v1/vm_migration_client.ts +++ b/packages/google-cloud-vmmigration/src/v1/vm_migration_client.ts @@ -99,8 +99,7 @@ export class VmMigrationClient { * 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 VmMigrationClient { * 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 VmMigrationClient({fallback: 'rest'}, gax); + * const client = new VmMigrationClient({fallback: true}, gax); * ``` */ constructor( @@ -180,7 +179,7 @@ export class VmMigrationClient { } 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) { @@ -287,7 +286,7 @@ export class VmMigrationClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ {