1616// ** https://github.com/googleapis/gapic-generator-typescript **
1717// ** All changes to this file may be overwritten. **
1818
19+ /* global window */
1920import * as gax from 'google-gax' ;
2021import {
2122 Callback ,
@@ -27,6 +28,11 @@ import {
2728import * as path from 'path' ;
2829
2930import * as protos from '../../protos/protos' ;
31+ /**
32+ * Client JSON configuration object, loaded from
33+ * `src/v1beta2/video_intelligence_service_client_config.json`.
34+ * This file defines retry strategy and timeouts for all API methods in this library.
35+ */
3036import * as gapicConfig from './video_intelligence_service_client_config.json' ;
3137import { operationsProtos } from 'google-gax' ;
3238const version = require ( '../../../package.json' ) . version ;
@@ -80,9 +86,9 @@ export class VideoIntelligenceServiceClient {
8086 * your project ID will be detected automatically.
8187 * @param {string } [options.apiEndpoint] - The domain name of the
8288 * API remote host.
83- * @param {gax.ClientConfig } [options.clientConfig] - client configuration override.
84- * TODO(@alexander-fenster): link to gax documentation .
85- * @param {boolean } fallback - Use HTTP fallback mode.
89+ * @param {gax.ClientConfig } [options.clientConfig] - Client configuration override.
90+ * Follows the structure of { @link gapicConfig} .
91+ * @param {boolean } [options. fallback] - Use HTTP fallback mode.
8692 * In fallback mode, a special browser-compatible transport implementation is used
8793 * instead of gRPC transport. In browser context (if the `window` object is defined)
8894 * the fallback mode is enabled automatically; set `options.fallback` to `false`
@@ -96,7 +102,9 @@ export class VideoIntelligenceServiceClient {
96102 opts ?. servicePath || opts ?. apiEndpoint || staticMembers . servicePath ;
97103 const port = opts ?. port || staticMembers . port ;
98104 const clientConfig = opts ?. clientConfig ?? { } ;
99- const fallback = opts ?. fallback ?? typeof window !== 'undefined' ;
105+ const fallback =
106+ opts ?. fallback ??
107+ ( typeof window !== 'undefined' && typeof window ?. fetch === 'function' ) ;
100108 opts = Object . assign ( { servicePath, port, clientConfig, fallback} , opts ) ;
101109
102110 // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
@@ -313,7 +321,7 @@ export class VideoIntelligenceServiceClient {
313321
314322 annotateVideo (
315323 request : protos . google . cloud . videointelligence . v1beta2 . IAnnotateVideoRequest ,
316- options ?: gax . CallOptions
324+ options ?: CallOptions
317325 ) : Promise <
318326 [
319327 LROperation <
@@ -326,7 +334,7 @@ export class VideoIntelligenceServiceClient {
326334 > ;
327335 annotateVideo (
328336 request : protos . google . cloud . videointelligence . v1beta2 . IAnnotateVideoRequest ,
329- options : gax . CallOptions ,
337+ options : CallOptions ,
330338 callback : Callback <
331339 LROperation <
332340 protos . google . cloud . videointelligence . v1beta2 . IAnnotateVideoResponse ,
@@ -401,7 +409,7 @@ export class VideoIntelligenceServiceClient {
401409 annotateVideo (
402410 request : protos . google . cloud . videointelligence . v1beta2 . IAnnotateVideoRequest ,
403411 optionsOrCallback ?:
404- | gax . CallOptions
412+ | CallOptions
405413 | Callback <
406414 LROperation <
407415 protos . google . cloud . videointelligence . v1beta2 . IAnnotateVideoResponse ,
@@ -429,12 +437,12 @@ export class VideoIntelligenceServiceClient {
429437 ]
430438 > | void {
431439 request = request || { } ;
432- let options : gax . CallOptions ;
440+ let options : CallOptions ;
433441 if ( typeof optionsOrCallback === 'function' && callback === undefined ) {
434442 callback = optionsOrCallback ;
435443 options = { } ;
436444 } else {
437- options = optionsOrCallback as gax . CallOptions ;
445+ options = optionsOrCallback as CallOptions ;
438446 }
439447 options = options || { } ;
440448 this . initialize ( ) ;
0 commit comments