Skip to content

Commit

Permalink
fix: pass fallback to createApiCall for browser (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored Aug 19, 2022
1 parent fb4eab4 commit 7bad386
Show file tree
Hide file tree
Showing 34 changed files with 189 additions and 182 deletions.
5 changes: 3 additions & 2 deletions baselines/asset/src/v1/asset_service_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ export class AssetServiceClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -912,7 +913,7 @@ export class AssetServiceClient {
async checkExportAssetsProgress(name: string): Promise<LROperation<protos.google.cloud.asset.v1.ExportAssetsResponse, protos.google.cloud.asset.v1.ExportAssetsRequest>>{
const request = new operationsProtos.google.longrunning.GetOperationRequest({name});
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportAssets, gax.createDefaultBackoffSettings());
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.exportAssets, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation as LROperation<protos.google.cloud.asset.v1.ExportAssetsResponse, protos.google.cloud.asset.v1.ExportAssetsRequest>;
}
// --------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ export class BigQueryStorageClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down
10 changes: 5 additions & 5 deletions baselines/compute/src/v1/addresses_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax';

import {Transform} from 'stream';
import {RequestType} from 'google-gax/build/src/apitypes';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
Expand Down Expand Up @@ -228,7 +227,8 @@ export class AddressesClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -542,7 +542,7 @@ export class AddressesClient {
this.initialize();
return this.descriptors.page.aggregatedList.asyncIterate(
this.innerApiCalls['aggregatedList'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<[string, protos.google.cloud.compute.v1.IAddressesScopedList]>;
}
Expand Down Expand Up @@ -700,7 +700,7 @@ export class AddressesClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.list.createStream(
this.innerApiCalls.list as gax.GaxCall,
this.innerApiCalls.list as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -766,7 +766,7 @@ export class AddressesClient {
this.initialize();
return this.descriptors.page.list.asyncIterate(
this.innerApiCalls['list'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.cloud.compute.v1.IAddress>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ export class RegionOperationsClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ export class DeprecatedServiceClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, GoogleError} from 'google-gax';

import {Transform} from 'stream';
import {RequestType} from 'google-gax/build/src/apitypes';
import {PassThrough} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
Expand Down Expand Up @@ -302,7 +301,8 @@ export class EchoClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -697,7 +697,7 @@ export class EchoClient {
async checkWaitProgress(name: string): Promise<LROperation<protos.google.showcase.v1beta1.WaitResponse, protos.google.showcase.v1beta1.WaitMetadata>>{
const request = new operationsProtos.google.longrunning.GetOperationRequest({name});
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.wait, gax.createDefaultBackoffSettings());
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.wait, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation as LROperation<protos.google.showcase.v1beta1.WaitResponse, protos.google.showcase.v1beta1.WaitMetadata>;
}
/**
Expand Down Expand Up @@ -811,7 +811,7 @@ export class EchoClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.pagedExpand.createStream(
this.innerApiCalls.pagedExpand as gax.GaxCall,
this.innerApiCalls.pagedExpand as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -855,7 +855,7 @@ export class EchoClient {
this.initialize();
return this.descriptors.page.pagedExpand.asyncIterate(
this.innerApiCalls['pagedExpand'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.showcase.v1beta1.IEchoResponse>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';

import {Transform} from 'stream';
import {RequestType} from 'google-gax/build/src/apitypes';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
Expand Down Expand Up @@ -254,7 +253,8 @@ export class IdentityClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -710,7 +710,7 @@ export class IdentityClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listUsers.createStream(
this.innerApiCalls.listUsers as gax.GaxCall,
this.innerApiCalls.listUsers as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -755,7 +755,7 @@ export class IdentityClient {
this.initialize();
return this.descriptors.page.listUsers.asyncIterate(
this.innerApiCalls['listUsers'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.showcase.v1beta1.IUser>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, GoogleError} from 'google-gax';

import {Transform} from 'stream';
import {RequestType} from 'google-gax/build/src/apitypes';
import {PassThrough} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
Expand Down Expand Up @@ -303,7 +302,8 @@ export class MessagingClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -1150,7 +1150,7 @@ export class MessagingClient {
async checkSearchBlurbsProgress(name: string): Promise<LROperation<protos.google.showcase.v1beta1.SearchBlurbsResponse, protos.google.showcase.v1beta1.SearchBlurbsMetadata>>{
const request = new operationsProtos.google.longrunning.GetOperationRequest({name});
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.searchBlurbs, gax.createDefaultBackoffSettings());
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.searchBlurbs, this._gaxModule.createDefaultBackoffSettings());
return decodeOperation as LROperation<protos.google.showcase.v1beta1.SearchBlurbsResponse, protos.google.showcase.v1beta1.SearchBlurbsMetadata>;
}
/**
Expand Down Expand Up @@ -1265,7 +1265,7 @@ export class MessagingClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listRooms.createStream(
this.innerApiCalls.listRooms as gax.GaxCall,
this.innerApiCalls.listRooms as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -1310,7 +1310,7 @@ export class MessagingClient {
this.initialize();
return this.descriptors.page.listRooms.asyncIterate(
this.innerApiCalls['listRooms'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.showcase.v1beta1.IRoom>;
}
Expand Down Expand Up @@ -1443,7 +1443,7 @@ export class MessagingClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listBlurbs.createStream(
this.innerApiCalls.listBlurbs as gax.GaxCall,
this.innerApiCalls.listBlurbs as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -1496,7 +1496,7 @@ export class MessagingClient {
this.initialize();
return this.descriptors.page.listBlurbs.asyncIterate(
this.innerApiCalls['listBlurbs'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.showcase.v1beta1.IBlurb>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';

import {Transform} from 'stream';
import {RequestType} from 'google-gax/build/src/apitypes';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
Expand Down Expand Up @@ -257,7 +256,8 @@ export class TestingClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -862,7 +862,7 @@ export class TestingClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listSessions.createStream(
this.innerApiCalls.listSessions as gax.GaxCall,
this.innerApiCalls.listSessions as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -904,7 +904,7 @@ export class TestingClient {
this.initialize();
return this.descriptors.page.listSessions.asyncIterate(
this.innerApiCalls['listSessions'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.showcase.v1beta1.ISession>;
}
Expand Down Expand Up @@ -1028,7 +1028,7 @@ export class TestingClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listTests.createStream(
this.innerApiCalls.listTests as gax.GaxCall,
this.innerApiCalls.listTests as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -1077,7 +1077,7 @@ export class TestingClient {
this.initialize();
return this.descriptors.page.listTests.asyncIterate(
this.innerApiCalls['listTests'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.showcase.v1beta1.ITest>;
}
Expand Down
24 changes: 12 additions & 12 deletions baselines/dlp/src/v2/dlp_service_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import * as gax from 'google-gax';
import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax';

import {Transform} from 'stream';
import {RequestType} from 'google-gax/build/src/apitypes';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
Expand Down Expand Up @@ -273,7 +272,8 @@ export class DlpServiceClient {
const apiCall = this._gaxModule.createApiCall(
callPromise,
this._defaults[methodName],
descriptor
descriptor,
this._opts.fallback
);

this.innerApiCalls[methodName] = apiCall;
Expand Down Expand Up @@ -2612,7 +2612,7 @@ export class DlpServiceClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listInspectTemplates.createStream(
this.innerApiCalls.listInspectTemplates as gax.GaxCall,
this.innerApiCalls.listInspectTemplates as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -2682,7 +2682,7 @@ export class DlpServiceClient {
this.initialize();
return this.descriptors.page.listInspectTemplates.asyncIterate(
this.innerApiCalls['listInspectTemplates'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.privacy.dlp.v2.IInspectTemplate>;
}
Expand Down Expand Up @@ -2850,7 +2850,7 @@ export class DlpServiceClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listDeidentifyTemplates.createStream(
this.innerApiCalls.listDeidentifyTemplates as gax.GaxCall,
this.innerApiCalls.listDeidentifyTemplates as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -2920,7 +2920,7 @@ export class DlpServiceClient {
this.initialize();
return this.descriptors.page.listDeidentifyTemplates.asyncIterate(
this.innerApiCalls['listDeidentifyTemplates'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.privacy.dlp.v2.IDeidentifyTemplate>;
}
Expand Down Expand Up @@ -3139,7 +3139,7 @@ export class DlpServiceClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listJobTriggers.createStream(
this.innerApiCalls.listJobTriggers as gax.GaxCall,
this.innerApiCalls.listJobTriggers as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -3235,7 +3235,7 @@ export class DlpServiceClient {
this.initialize();
return this.descriptors.page.listJobTriggers.asyncIterate(
this.innerApiCalls['listJobTriggers'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.privacy.dlp.v2.IJobTrigger>;
}
Expand Down Expand Up @@ -3459,7 +3459,7 @@ export class DlpServiceClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listDlpJobs.createStream(
this.innerApiCalls.listDlpJobs as gax.GaxCall,
this.innerApiCalls.listDlpJobs as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -3557,7 +3557,7 @@ export class DlpServiceClient {
this.initialize();
return this.descriptors.page.listDlpJobs.asyncIterate(
this.innerApiCalls['listDlpJobs'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.privacy.dlp.v2.IDlpJob>;
}
Expand Down Expand Up @@ -3727,7 +3727,7 @@ export class DlpServiceClient {
const callSettings = defaultCallSettings.merge(options);
this.initialize();
return this.descriptors.page.listStoredInfoTypes.createStream(
this.innerApiCalls.listStoredInfoTypes as gax.GaxCall,
this.innerApiCalls.listStoredInfoTypes as GaxCall,
request,
callSettings
);
Expand Down Expand Up @@ -3798,7 +3798,7 @@ export class DlpServiceClient {
this.initialize();
return this.descriptors.page.listStoredInfoTypes.asyncIterate(
this.innerApiCalls['listStoredInfoTypes'] as GaxCall,
request as unknown as RequestType,
request as {},
callSettings
) as AsyncIterable<protos.google.privacy.dlp.v2.IStoredInfoType>;
}
Expand Down
Loading

0 comments on commit 7bad386

Please sign in to comment.