Skip to content

Commit 64d004d

Browse files
gcf-owl-bot[bot]danieljbrucemeredithslota
authored
build: update typescript generator version to publish in dual format (ESM) (#1448)
* 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: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTZjMTY2NTdlN2E1OTEyMmIxZGE5NDc3MWE5ZWY0MDk4OWMyODJjMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: update typescript generator version to publish in dual format (ESM) PiperOrigin-RevId: 568643156 Source-Link: googleapis/googleapis@f95afc0 Source-Link: googleapis/googleapis-gen@bbd2c49 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmJkMmM0OWQyZTQyM2E4Y2U1Y2M4NTYyNzQwMmQ1MTJhZWVmYzU4YiJ9 * 🦉 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> Co-authored-by: danieljbruce <[email protected]> Co-authored-by: meredithslota <[email protected]>
1 parent 76871aa commit 64d004d

3 files changed

+11
-14
lines changed

src/v2/config_service_v2_client.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ export class ConfigServiceV2Client {
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 ConfigServiceV2Client({fallback: 'rest'}, gax);
104+
* const client = new ConfigServiceV2Client({fallback: true}, gax);
106105
* ```
107106
*/
108107
constructor(
@@ -168,7 +167,7 @@ export class ConfigServiceV2Client {
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) {
@@ -332,7 +331,7 @@ export class ConfigServiceV2Client {
332331
auth: this.auth,
333332
grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
334333
};
335-
if (opts.fallback === 'rest') {
334+
if (opts.fallback) {
336335
lroOptions.protoJson = protoFilesRoot;
337336
lroOptions.httpRules = [
338337
{

src/v2/logging_service_v2_client.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class LoggingServiceV2Client {
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 LoggingServiceV2Client({fallback: 'rest'}, gax);
101+
* const client = new LoggingServiceV2Client({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -165,7 +164,7 @@ export class LoggingServiceV2Client {
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) {
@@ -313,7 +312,7 @@ export class LoggingServiceV2Client {
313312
this.descriptors.stream = {
314313
tailLogEntries: new this._gaxModule.StreamDescriptor(
315314
this._gaxModule.StreamType.BIDI_STREAMING,
316-
opts.fallback === 'rest'
315+
!!opts.fallback
317316
),
318317
};
319318

src/v2/metrics_service_v2_client.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,15 @@ export class MetricsServiceV2Client {
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 MetricsServiceV2Client({fallback: 'rest'}, gax);
101+
* const client = new MetricsServiceV2Client({fallback: true}, gax);
103102
* ```
104103
*/
105104
constructor(
@@ -165,7 +164,7 @@ export class MetricsServiceV2Client {
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)