Skip to content

Commit 07967ad

Browse files
fix: [Many APIs] simplify logic for HTTP/1.1 REST fallback option (#4589)
* 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZtd2FyZWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZwY2FjY2Vzcy8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdlYnJpc2svLk93bEJvdC55YW1sIiwiaCI6IjU2YzE2NjU3ZTdhNTkxMjJiMWRhOTQ3NzFhOWVmNDA5ODljMjgyYzAifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdlYnNlY3VyaXR5c2Nhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdvcmtmbG93cy1leGVjdXRpb25zLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdvcmtzdGF0aW9ucy8uT3dsQm90LnlhbWwiLCJo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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 14fffdf commit 07967ad

44 files changed

Lines changed: 146 additions & 178 deletions

File tree

Some content is hidden

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

packages/google-cloud-vmwareengine/samples/quickstart.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ function main(parent) {
9494
};
9595

9696
// Run request
97-
const iterable =
98-
await vmwareengineClient.listVmwareEngineNetworksAsync(request);
97+
const iterable = await vmwareengineClient.listVmwareEngineNetworksAsync(
98+
request
99+
);
99100
for await (const response of iterable) {
100101
console.log(response);
101102
}

packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@ export class VmwareEngineClient {
9999
* API remote host.
100100
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
101101
* Follows the structure of {@link gapicConfig}.
102-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
103-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
102+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
104103
* For more information, please check the
105104
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
106105
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
107106
* need to avoid loading the default gRPC version and want to use the fallback
108107
* HTTP implementation. Load only fallback version and pass it to the constructor:
109108
* ```
110109
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
111-
* const client = new VmwareEngineClient({fallback: 'rest'}, gax);
110+
* const client = new VmwareEngineClient({fallback: true}, gax);
112111
* ```
113112
*/
114113
constructor(
@@ -180,7 +179,7 @@ export class VmwareEngineClient {
180179
}
181180
if (!opts.fallback) {
182181
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
183-
} else if (opts.fallback === 'rest') {
182+
} else {
184183
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
185184
}
186185
if (opts.libName && opts.libVersion) {
@@ -284,7 +283,7 @@ export class VmwareEngineClient {
284283
auth: this.auth,
285284
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
286285
};
287-
if (opts.fallback === 'rest') {
286+
if (opts.fallback) {
288287
lroOptions.protoJson = protoFilesRoot;
289288
lroOptions.httpRules = [
290289
{

packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8221,8 +8221,9 @@ describe('v1.VmwareEngineClient', () => {
82218221
];
82228222
client.innerApiCalls.listPrivateConnectionPeeringRoutes =
82238223
stubSimpleCall(expectedResponse);
8224-
const [response] =
8225-
await client.listPrivateConnectionPeeringRoutes(request);
8224+
const [response] = await client.listPrivateConnectionPeeringRoutes(
8225+
request
8226+
);
82268227
assert.deepStrictEqual(response, expectedResponse);
82278228
const actualRequest = (
82288229
client.innerApiCalls.listPrivateConnectionPeeringRoutes as SinonStub

packages/google-cloud-vpcaccess/src/v1/vpc_access_service_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,15 @@ export class VpcAccessServiceClient {
9898
* API remote host.
9999
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
100100
* Follows the structure of {@link gapicConfig}.
101-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
102-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
101+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
103102
* For more information, please check the
104103
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
105104
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
106105
* need to avoid loading the default gRPC version and want to use the fallback
107106
* HTTP implementation. Load only fallback version and pass it to the constructor:
108107
* ```
109108
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
110-
* const client = new VpcAccessServiceClient({fallback: 'rest'}, gax);
109+
* const client = new VpcAccessServiceClient({fallback: true}, gax);
111110
* ```
112111
*/
113112
constructor(
@@ -177,7 +176,7 @@ export class VpcAccessServiceClient {
177176
}
178177
if (!opts.fallback) {
179178
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
180-
} else if (opts.fallback === 'rest') {
179+
} else {
181180
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
182181
}
183182
if (opts.libName && opts.libVersion) {
@@ -217,7 +216,7 @@ export class VpcAccessServiceClient {
217216
auth: this.auth,
218217
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
219218
};
220-
if (opts.fallback === 'rest') {
219+
if (opts.fallback) {
221220
lroOptions.protoJson = protoFilesRoot;
222221
lroOptions.httpRules = [
223222
{

packages/google-cloud-webrisk/src/v1/web_risk_service_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,15 @@ export class WebRiskServiceClient {
9292
* API remote host.
9393
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
9494
* Follows the structure of {@link gapicConfig}.
95-
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
96-
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
95+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
9796
* For more information, please check the
9897
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
9998
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
10099
* need to avoid loading the default gRPC version and want to use the fallback
101100
* HTTP implementation. Load only fallback version and pass it to the constructor:
102101
* ```
103102
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
104-
* const client = new WebRiskServiceClient({fallback: 'rest'}, gax);
103+
* const client = new WebRiskServiceClient({fallback: true}, gax);
105104
* ```
106105
*/
107106
constructor(
@@ -167,7 +166,7 @@ export class WebRiskServiceClient {
167166
}
168167
if (!opts.fallback) {
169168
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
170-
} else if (opts.fallback === 'rest') {
169+
} else {
171170
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
172171
}
173172
if (opts.libName && opts.libVersion) {
@@ -193,7 +192,7 @@ export class WebRiskServiceClient {
193192
auth: this.auth,
194193
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
195194
};
196-
if (opts.fallback === 'rest') {
195+
if (opts.fallback) {
197196
lroOptions.protoJson = protoFilesRoot;
198197
lroOptions.httpRules = [
199198
{

packages/google-cloud-webrisk/src/v1beta1/web_risk_service_v1_beta1_client.ts

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

packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client.ts

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

packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client.ts

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

packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client.ts

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

packages/google-cloud-workflows-executions/src/v1/executions_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ export class ExecutionsClient {
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 ExecutionsClient({fallback: 'rest'}, gax);
102+
* const client = new ExecutionsClient({fallback: true}, gax);
104103
* ```
105104
*/
106105
constructor(
@@ -163,7 +162,7 @@ export class ExecutionsClient {
163162
}
164163
if (!opts.fallback) {
165164
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
166-
} else if (opts.fallback === 'rest') {
165+
} else {
167166
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
168167
}
169168
if (opts.libName && opts.libVersion) {

0 commit comments

Comments
 (0)