Skip to content

Commit c3ddba8

Browse files
fix: [Many APIs] simplify logic for HTTP/1.1 REST fallback option (#4583)
* 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFpLWdlbmVyYXRpdmVsYW5ndWFnZS8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1hZG1pbi8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1kYXRhLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwaS1hcGlrZXlzLy5Pd2xCb3QueWFtbCIsImgiOiI1NmMxNjY1N2U3YTU5MTIyYjFkYTk0NzcxYTllZjQwOTg5YzI4MmMwIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwaS1zZXJ2aWNlY29udHJvbC8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwaS1zZXJ2aWNlbWFuYWdlbWVudC8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E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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 * 🦉 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 13537fc commit c3ddba8

84 files changed

Lines changed: 311 additions & 387 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-ai-generativelanguage/src/v1beta2/discuss_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ export class DiscussServiceClient {
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 DiscussServiceClient({fallback: 'rest'}, gax);
102+
* const client = new DiscussServiceClient({fallback: true}, gax);
104103
* ```
105104
*/
106105
constructor(
@@ -166,7 +165,7 @@ export class DiscussServiceClient {
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-ai-generativelanguage/src/v1beta2/model_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class ModelServiceClient {
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 ModelServiceClient({fallback: 'rest'}, gax);
101+
* const client = new ModelServiceClient({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -165,7 +164,7 @@ export class ModelServiceClient {
165164
}
166165
if (!opts.fallback) {
167166
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
168-
} else if (opts.fallback === 'rest') {
167+
} else {
169168
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
170169
}
171170
if (opts.libName && opts.libVersion) {

packages/google-ai-generativelanguage/src/v1beta2/text_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ export class TextServiceClient {
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 TextServiceClient({fallback: 'rest'}, gax);
102+
* const client = new TextServiceClient({fallback: true}, gax);
104103
* ```
105104
*/
106105
constructor(
@@ -166,7 +165,7 @@ export class TextServiceClient {
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-analytics-admin/src/v1alpha/analytics_admin_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class AnalyticsAdminServiceClient {
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 AnalyticsAdminServiceClient({fallback: 'rest'}, gax);
101+
* const client = new AnalyticsAdminServiceClient({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -166,7 +165,7 @@ export class AnalyticsAdminServiceClient {
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-analytics-admin/src/v1beta/analytics_admin_service_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class AnalyticsAdminServiceClient {
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 AnalyticsAdminServiceClient({fallback: 'rest'}, gax);
101+
* const client = new AnalyticsAdminServiceClient({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -166,7 +165,7 @@ export class AnalyticsAdminServiceClient {
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-analytics-data/src/v1alpha/alpha_analytics_data_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ export class AlphaAnalyticsDataClient {
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 AlphaAnalyticsDataClient({fallback: 'rest'}, gax);
104+
* const client = new AlphaAnalyticsDataClient({fallback: true}, gax);
106105
* ```
107106
*/
108107
constructor(
@@ -168,7 +167,7 @@ export class AlphaAnalyticsDataClient {
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) {
@@ -208,7 +207,7 @@ export class AlphaAnalyticsDataClient {
208207
auth: this.auth,
209208
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
210209
};
211-
if (opts.fallback === 'rest') {
210+
if (opts.fallback) {
212211
lroOptions.protoJson = protoFilesRoot;
213212
lroOptions.httpRules = [];
214213
}

packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ export class BetaAnalyticsDataClient {
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 BetaAnalyticsDataClient({fallback: 'rest'}, gax);
99+
* const client = new BetaAnalyticsDataClient({fallback: true}, gax);
101100
* ```
102101
*/
103102
constructor(
@@ -163,7 +162,7 @@ export class BetaAnalyticsDataClient {
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) {

packages/google-api-apikeys/src/v2/api_keys_client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ export class ApiKeysClient {
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 ApiKeysClient({fallback: 'rest'}, gax);
104+
* const client = new ApiKeysClient({fallback: true}, gax);
106105
* ```
107106
*/
108107
constructor(
@@ -168,7 +167,7 @@ export class ApiKeysClient {
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) {
@@ -211,7 +210,7 @@ export class ApiKeysClient {
211210
auth: this.auth,
212211
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
213212
};
214-
if (opts.fallback === 'rest') {
213+
if (opts.fallback) {
215214
lroOptions.protoJson = protoFilesRoot;
216215
lroOptions.httpRules = [
217216
{

packages/google-api-servicecontrol/src/v1/quota_controller_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class QuotaControllerClient {
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 QuotaControllerClient({fallback: 'rest'}, gax);
101+
* const client = new QuotaControllerClient({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -165,7 +164,7 @@ export class QuotaControllerClient {
165164
}
166165
if (!opts.fallback) {
167166
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
168-
} else if (opts.fallback === 'rest') {
167+
} else {
169168
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
170169
}
171170
if (opts.libName && opts.libVersion) {

packages/google-api-servicecontrol/src/v1/service_controller_client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class ServiceControllerClient {
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 ServiceControllerClient({fallback: 'rest'}, gax);
101+
* const client = new ServiceControllerClient({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -165,7 +164,7 @@ export class ServiceControllerClient {
165164
}
166165
if (!opts.fallback) {
167166
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
168-
} else if (opts.fallback === 'rest') {
167+
} else {
169168
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
170169
}
171170
if (opts.libName && opts.libVersion) {

0 commit comments

Comments
 (0)