Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: handle fallback option properly (#447)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* chore(nodejs_templates): add script logging to node_library populate-secrets.sh

Co-authored-by: Benjamin E. Coe <[email protected]>

Source-Author: BenWhitehead <[email protected]>
Source-Date: Wed Jun 10 22:24:28 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: e7034945fbdc0e79d3c57f6e299e5c90b0f11469
Source-Link: googleapis/synthtool@e703494
  • Loading branch information
yoshi-automation authored Jun 12, 2020
1 parent eaee22c commit f539818
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 50 deletions.
12 changes: 12 additions & 0 deletions .kokoro/populate-secrets.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions src/v1/video_intelligence_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
13 changes: 5 additions & 8 deletions src/v1beta2/video_intelligence_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
13 changes: 5 additions & 8 deletions src/v1p1beta1/video_intelligence_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
13 changes: 5 additions & 8 deletions src/v1p2beta1/video_intelligence_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
13 changes: 5 additions & 8 deletions src/v1p3beta1/streaming_video_intelligence_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,11 @@ export class StreamingVideoIntelligenceServiceClient {
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the StreamingVideoIntelligenceServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
13 changes: 5 additions & 8 deletions src/v1p3beta1/video_intelligence_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,11 @@ export class VideoIntelligenceServiceClient {
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};

const isBrowser = typeof window !== 'undefined';
if (isBrowser) {
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the VideoIntelligenceServiceClient constructor.
this._gaxModule = opts.fallback ? gax.fallback : gax;

// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-video-intelligence.git",
"sha": "79f411801358ee081969f18db4c96308bd4b1eea"
"sha": "eaee22cabed4bb31842196e0bcb2610daafc6f1c"
}
},
{
Expand All @@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "1c92077459db3dc50741e878f98b08c6261181e0"
"sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469"
}
}
],
Expand Down

0 comments on commit f539818

Please sign in to comment.