Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate showcase #12

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/showcase-echo-client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "showcase-echo-client",
"name": "showcase-echo-client",
"version": "0.1.0",
"description": "Showcase client for Node.js",
"repository": "googleapis/nodejs-showcase",
Expand Down
22 changes: 10 additions & 12 deletions test/showcase-echo-client/src/v1beta1/echo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ export class EchoClient {
* 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
* need to avoid loading the default gRPC version and want to use the fallback
* 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 EchoClient({fallback: 'rest'}, gax);
* const client = new EchoClient({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -181,10 +180,10 @@ export class EchoClient {
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
if (opts.fallback) {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
} else {
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
} else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
Expand Down Expand Up @@ -226,18 +225,17 @@ export class EchoClient {
this.descriptors.stream = {
expand: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
// legacy: opts.fallback can be a string or a boolean
opts.fallback ? true : false
!!opts.fallback,
this._opts.newRetry

),
collect: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.CLIENT_STREAMING,
// legacy: opts.fallback can be a string or a boolean
opts.fallback ? true : false
!!opts.fallback
),
chat: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.BIDI_STREAMING,
// legacy: opts.fallback can be a string or a boolean
opts.fallback ? true : false
!!opts.fallback
),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,15 @@ export class SequenceServiceClient {
* 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
* need to avoid loading the default gRPC version and want to use the fallback
* 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 SequenceServiceClient({fallback: 'rest'}, gax);
* const client = new SequenceServiceClient({fallback: true}, gax);
* ```
*/
constructor(
Expand Down Expand Up @@ -171,7 +170,7 @@ export class SequenceServiceClient {
}
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) {
Expand Down Expand Up @@ -203,7 +202,7 @@ export class SequenceServiceClient {
this.descriptors.stream = {
attemptStreamingSequence: new this._gaxModule.StreamDescriptor(
this._gaxModule.StreamType.SERVER_STREAMING,
opts.fallback === 'rest',
!!opts.fallback,
this._opts.newRetry
),
};
Expand Down