Skip to content

Commit e5ad564

Browse files
fix: [Many APIs] simplify logic for HTTP/1.1 REST fallback option (#4588)
* 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: googleapis/googleapis@6a6fd29 Source-Link: googleapis/googleapis-gen@56c1665 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3JldG1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVjYS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXB1YmxpY2NhLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2VkaXJlY3RvcnkvLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNoZWxsLy5Pd2xCb3QueWFt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ates 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 07967ad commit e5ad564

File tree

64 files changed

+244
-297
lines changed

Some content is hidden

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

64 files changed

+244
-297
lines changed

packages/google-cloud-secretmanager/src/v1/secret_manager_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ export class SecretManagerServiceClient {
9696
* API remote host.
9797
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9898
* Follows the structure of {@link gapicConfig}.
99-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
100-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
99+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
101100
* For more information, please check the
102101
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
103102
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
104103
* need to avoid loading the default gRPC version and want to use the fallback
105104
* HTTP implementation. Load only fallback version and pass it to the constructor:
106105
* ```
107106
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
108-
* const client = new SecretManagerServiceClient({fallback: 'rest'}, gax);
107+
* const client = new SecretManagerServiceClient({fallback: true}, gax);
109108
* ```
110109
*/
111110
constructor(
@@ -171,7 +170,7 @@ export class SecretManagerServiceClient {
171170
}
172171
if (!opts.fallback) {
173172
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
174-
} else if (opts.fallback === 'rest') {
173+
} else {
175174
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
176175
}
177176
if (opts.libName && opts.libVersion) {

packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,15 @@ export class CertificateAuthorityServiceClient {
101101
* API remote host.
102102
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
103103
* Follows the structure of {@link gapicConfig}.
104-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
105-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
104+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
106105
* For more information, please check the
107106
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
108107
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
109108
* need to avoid loading the default gRPC version and want to use the fallback
110109
* HTTP implementation. Load only fallback version and pass it to the constructor:
111110
* ```
112111
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
113-
* const client = new CertificateAuthorityServiceClient({fallback: 'rest'}, gax);
112+
* const client = new CertificateAuthorityServiceClient({fallback: true}, gax);
114113
* ```
115114
*/
116115
constructor(
@@ -183,7 +182,7 @@ export class CertificateAuthorityServiceClient {
183182
}
184183
if (!opts.fallback) {
185184
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
186-
} else if (opts.fallback === 'rest') {
185+
} else {
187186
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
188187
}
189188
if (opts.libName && opts.libVersion) {
@@ -255,7 +254,7 @@ export class CertificateAuthorityServiceClient {
255254
auth: this.auth,
256255
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
257256
};
258-
if (opts.fallback === 'rest') {
257+
if (opts.fallback) {
259258
lroOptions.protoJson = protoFilesRoot;
260259
lroOptions.httpRules = [
261260
{

packages/google-cloud-security-privateca/src/v1beta1/certificate_authority_service_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,15 @@ export class CertificateAuthorityServiceClient {
9494
* API remote host.
9595
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9696
* Follows the structure of {@link gapicConfig}.
97-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
98-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
97+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9998
* For more information, please check the
10099
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
101100
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
102101
* need to avoid loading the default gRPC version and want to use the fallback
103102
* HTTP implementation. Load only fallback version and pass it to the constructor:
104103
* ```
105104
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
106-
* const client = new CertificateAuthorityServiceClient({fallback: 'rest'}, gax);
105+
* const client = new CertificateAuthorityServiceClient({fallback: true}, gax);
107106
* ```
108107
*/
109108
constructor(
@@ -170,7 +169,7 @@ export class CertificateAuthorityServiceClient {
170169
}
171170
if (!opts.fallback) {
172171
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
173-
} else if (opts.fallback === 'rest') {
172+
} else {
174173
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
175174
}
176175
if (opts.libName && opts.libVersion) {
@@ -234,7 +233,7 @@ export class CertificateAuthorityServiceClient {
234233
auth: this.auth,
235234
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
236235
};
237-
if (opts.fallback === 'rest') {
236+
if (opts.fallback) {
238237
lroOptions.protoJson = protoFilesRoot;
239238
lroOptions.httpRules = [
240239
{

packages/google-cloud-security-privateca/test/gapic_certificate_authority_service_v1beta1.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,8 +2547,9 @@ describe('v1beta1.CertificateAuthorityServiceClient', () => {
25472547
);
25482548
client.innerApiCalls.scheduleDeleteCertificateAuthority =
25492549
stubLongRunningCall(expectedResponse);
2550-
const [operation] =
2551-
await client.scheduleDeleteCertificateAuthority(request);
2550+
const [operation] = await client.scheduleDeleteCertificateAuthority(
2551+
request
2552+
);
25522553
const [response] = await operation.promise();
25532554
assert.deepStrictEqual(response, expectedResponse);
25542555
const actualRequest = (
@@ -2674,8 +2675,9 @@ describe('v1beta1.CertificateAuthorityServiceClient', () => {
26742675
const expectedError = new Error('expected');
26752676
client.innerApiCalls.scheduleDeleteCertificateAuthority =
26762677
stubLongRunningCall(undefined, undefined, expectedError);
2677-
const [operation] =
2678-
await client.scheduleDeleteCertificateAuthority(request);
2678+
const [operation] = await client.scheduleDeleteCertificateAuthority(
2679+
request
2680+
);
26792681
await assert.rejects(operation.promise(), expectedError);
26802682
const actualRequest = (
26812683
client.innerApiCalls.scheduleDeleteCertificateAuthority as SinonStub

packages/google-cloud-security-publicca/src/v1beta1/public_certificate_authority_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class PublicCertificateAuthorityServiceClient {
9090
* API remote host.
9191
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9292
* Follows the structure of {@link gapicConfig}.
93-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
94-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
93+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9594
* For more information, please check the
9695
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
9796
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
9897
* need to avoid loading the default gRPC version and want to use the fallback
9998
* HTTP implementation. Load only fallback version and pass it to the constructor:
10099
* ```
101100
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
102-
* const client = new PublicCertificateAuthorityServiceClient({fallback: 'rest'}, gax);
101+
* const client = new PublicCertificateAuthorityServiceClient({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -166,7 +165,7 @@ export class PublicCertificateAuthorityServiceClient {
166165
}
167166
if (!opts.fallback) {
168167
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
169-
} else if (opts.fallback === 'rest') {
168+
} else {
170169
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
171170
}
172171
if (opts.libName && opts.libVersion) {

packages/google-cloud-securitycenter/src/v1/security_center_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ export class SecurityCenterClient {
9393
* API remote host.
9494
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9595
* Follows the structure of {@link gapicConfig}.
96-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
97-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
96+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9897
* For more information, please check the
9998
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
10099
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
101100
* need to avoid loading the default gRPC version and want to use the fallback
102101
* HTTP implementation. Load only fallback version and pass it to the constructor:
103102
* ```
104103
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
105-
* const client = new SecurityCenterClient({fallback: 'rest'}, gax);
104+
* const client = new SecurityCenterClient({fallback: true}, gax);
106105
* ```
107106
*/
108107
constructor(
@@ -168,7 +167,7 @@ export class SecurityCenterClient {
168167
}
169168
if (!opts.fallback) {
170169
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
171-
} else if (opts.fallback === 'rest') {
170+
} else {
172171
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
173172
}
174173
if (opts.libName && opts.libVersion) {
@@ -378,7 +377,7 @@ export class SecurityCenterClient {
378377
auth: this.auth,
379378
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
380379
};
381-
if (opts.fallback === 'rest') {
380+
if (opts.fallback) {
382381
lroOptions.protoJson = protoFilesRoot;
383382
lroOptions.httpRules = [
384383
{

packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ export class SecurityCenterClient {
9393
* API remote host.
9494
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9595
* Follows the structure of {@link gapicConfig}.
96-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
97-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
96+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9897
* For more information, please check the
9998
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
10099
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
101100
* need to avoid loading the default gRPC version and want to use the fallback
102101
* HTTP implementation. Load only fallback version and pass it to the constructor:
103102
* ```
104103
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
105-
* const client = new SecurityCenterClient({fallback: 'rest'}, gax);
104+
* const client = new SecurityCenterClient({fallback: true}, gax);
106105
* ```
107106
*/
108107
constructor(
@@ -168,7 +167,7 @@ export class SecurityCenterClient {
168167
}
169168
if (!opts.fallback) {
170169
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
171-
} else if (opts.fallback === 'rest') {
170+
} else {
172171
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
173172
}
174173
if (opts.libName && opts.libVersion) {
@@ -245,7 +244,7 @@ export class SecurityCenterClient {
245244
auth: this.auth,
246245
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
247246
};
248-
if (opts.fallback === 'rest') {
247+
if (opts.fallback) {
249248
lroOptions.protoJson = protoFilesRoot;
250249
lroOptions.httpRules = [
251250
{

packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ export class SecurityCenterClient {
9393
* API remote host.
9494
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9595
* Follows the structure of {@link gapicConfig}.
96-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
97-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
96+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9897
* For more information, please check the
9998
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
10099
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
101100
* need to avoid loading the default gRPC version and want to use the fallback
102101
* HTTP implementation. Load only fallback version and pass it to the constructor:
103102
* ```
104103
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
105-
* const client = new SecurityCenterClient({fallback: 'rest'}, gax);
104+
* const client = new SecurityCenterClient({fallback: true}, gax);
106105
* ```
107106
*/
108107
constructor(
@@ -168,7 +167,7 @@ export class SecurityCenterClient {
168167
}
169168
if (!opts.fallback) {
170169
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
171-
} else if (opts.fallback === 'rest') {
170+
} else {
172171
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
173172
}
174173
if (opts.libName && opts.libVersion) {
@@ -285,7 +284,7 @@ export class SecurityCenterClient {
285284
auth: this.auth,
286285
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
287286
};
288-
if (opts.fallback === 'rest') {
287+
if (opts.fallback) {
289288
lroOptions.protoJson = protoFilesRoot;
290289
lroOptions.httpRules = [
291290
{

packages/google-cloud-securitycenter/test/gapic_security_center_v1.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ describe('v1.SecurityCenterClient', () => {
280280
);
281281
client.innerApiCalls.createSecurityHealthAnalyticsCustomModule =
282282
stubSimpleCall(expectedResponse);
283-
const [response] =
284-
await client.createSecurityHealthAnalyticsCustomModule(request);
283+
const [response] = await client.createSecurityHealthAnalyticsCustomModule(
284+
request
285+
);
285286
assert.deepStrictEqual(response, expectedResponse);
286287
const actualRequest = (
287288
client.innerApiCalls
@@ -1216,8 +1217,9 @@ describe('v1.SecurityCenterClient', () => {
12161217
);
12171218
client.innerApiCalls.deleteSecurityHealthAnalyticsCustomModule =
12181219
stubSimpleCall(expectedResponse);
1219-
const [response] =
1220-
await client.deleteSecurityHealthAnalyticsCustomModule(request);
1220+
const [response] = await client.deleteSecurityHealthAnalyticsCustomModule(
1221+
request
1222+
);
12211223
assert.deepStrictEqual(response, expectedResponse);
12221224
const actualRequest = (
12231225
client.innerApiCalls
@@ -2164,8 +2166,9 @@ describe('v1.SecurityCenterClient', () => {
21642166
);
21652167
client.innerApiCalls.getSecurityHealthAnalyticsCustomModule =
21662168
stubSimpleCall(expectedResponse);
2167-
const [response] =
2168-
await client.getSecurityHealthAnalyticsCustomModule(request);
2169+
const [response] = await client.getSecurityHealthAnalyticsCustomModule(
2170+
request
2171+
);
21692172
assert.deepStrictEqual(response, expectedResponse);
21702173
const actualRequest = (
21712174
client.innerApiCalls.getSecurityHealthAnalyticsCustomModule as SinonStub
@@ -3631,8 +3634,9 @@ describe('v1.SecurityCenterClient', () => {
36313634
);
36323635
client.innerApiCalls.updateSecurityHealthAnalyticsCustomModule =
36333636
stubSimpleCall(expectedResponse);
3634-
const [response] =
3635-
await client.updateSecurityHealthAnalyticsCustomModule(request);
3637+
const [response] = await client.updateSecurityHealthAnalyticsCustomModule(
3638+
request
3639+
);
36363640
assert.deepStrictEqual(response, expectedResponse);
36373641
const actualRequest = (
36383642
client.innerApiCalls
@@ -7677,8 +7681,9 @@ describe('v1.SecurityCenterClient', () => {
76777681
];
76787682
client.innerApiCalls.listSecurityHealthAnalyticsCustomModules =
76797683
stubSimpleCall(expectedResponse);
7680-
const [response] =
7681-
await client.listSecurityHealthAnalyticsCustomModules(request);
7684+
const [response] = await client.listSecurityHealthAnalyticsCustomModules(
7685+
request
7686+
);
76827687
assert.deepStrictEqual(response, expectedResponse);
76837688
const actualRequest = (
76847689
client.innerApiCalls

packages/google-cloud-servicedirectory/src/v1/lookup_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ export class LookupServiceClient {
9191
* API remote host.
9292
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9393
* Follows the structure of {@link gapicConfig}.
94-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
95-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
94+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9695
* For more information, please check the
9796
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
9897
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
9998
* need to avoid loading the default gRPC version and want to use the fallback
10099
* HTTP implementation. Load only fallback version and pass it to the constructor:
101100
* ```
102101
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
103-
* const client = new LookupServiceClient({fallback: 'rest'}, gax);
102+
* const client = new LookupServiceClient({fallback: true}, gax);
104103
* ```
105104
*/
106105
constructor(
@@ -170,7 +169,7 @@ export class LookupServiceClient {
170169
}
171170
if (!opts.fallback) {
172171
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
173-
} else if (opts.fallback === 'rest') {
172+
} else {
174173
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
175174
}
176175
if (opts.libName && opts.libVersion) {

packages/google-cloud-servicedirectory/src/v1/registration_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,15 @@ export class RegistrationServiceClient {
107107
* API remote host.
108108
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
109109
* Follows the structure of {@link gapicConfig}.
110-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
111-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
110+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
112111
* For more information, please check the
113112
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
114113
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
115114
* need to avoid loading the default gRPC version and want to use the fallback
116115
* HTTP implementation. Load only fallback version and pass it to the constructor:
117116
* ```
118117
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
119-
* const client = new RegistrationServiceClient({fallback: 'rest'}, gax);
118+
* const client = new RegistrationServiceClient({fallback: true}, gax);
120119
* ```
121120
*/
122121
constructor(
@@ -186,7 +185,7 @@ export class RegistrationServiceClient {
186185
}
187186
if (!opts.fallback) {
188187
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
189-
} else if (opts.fallback === 'rest') {
188+
} else {
190189
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
191190
}
192191
if (opts.libName && opts.libVersion) {

0 commit comments

Comments
 (0)