Skip to content

Commit

Permalink
tests: update baselines for esm changes
Browse files Browse the repository at this point in the history
  • Loading branch information
feywind committed Dec 19, 2024
1 parent 33dfa6b commit e8abb7b
Show file tree
Hide file tree
Showing 43 changed files with 6,285 additions and 340 deletions.
137 changes: 130 additions & 7 deletions baselines/asset-esm/esm/src/v1/asset_service_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {fileURLToPath} from 'url';
import {getJSON} from '../json-helper.cjs';
// @ts-ignore
const dirname = path.dirname(fileURLToPath(import.meta.url));
import * as logging from 'google-logging-utils';

/**
* Client JSON configuration object, loaded from
Expand Down Expand Up @@ -62,6 +63,7 @@ export class AssetServiceClient {
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
private _log = logging.log('asset');
auth: gax.GoogleAuth;
descriptors: Descriptors = {
page: {},
Expand Down Expand Up @@ -472,7 +474,24 @@ export class AssetServiceClient {
'parent': request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.batchGetAssetsHistory(request, options, callback);
this._log.info('batchGetAssetsHistory request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse,
protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('batchGetAssetsHistory response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.batchGetAssetsHistory(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse,
protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|undefined, {}|undefined
]) => {
this._log.info('batchGetAssetsHistory response %j', response);
return [response, options, rawResponse];
});
}
/**
* Creates a feed in a parent project/folder/organization to listen to its
Expand Down Expand Up @@ -556,7 +575,24 @@ export class AssetServiceClient {
'parent': request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.createFeed(request, options, callback);
this._log.info('createFeed request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.asset.v1.IFeed,
protos.google.cloud.asset.v1.ICreateFeedRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('createFeed response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.createFeed(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.asset.v1.IFeed,
protos.google.cloud.asset.v1.ICreateFeedRequest|undefined, {}|undefined
]) => {
this._log.info('createFeed response %j', response);
return [response, options, rawResponse];
});
}
/**
* Gets details about an asset feed.
Expand Down Expand Up @@ -629,7 +665,24 @@ export class AssetServiceClient {
'name': request.name ?? '',
});
this.initialize();
return this.innerApiCalls.getFeed(request, options, callback);
this._log.info('getFeed request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.asset.v1.IFeed,
protos.google.cloud.asset.v1.IGetFeedRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('getFeed response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.getFeed(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.asset.v1.IFeed,
protos.google.cloud.asset.v1.IGetFeedRequest|undefined, {}|undefined
]) => {
this._log.info('getFeed response %j', response);
return [response, options, rawResponse];
});
}
/**
* Lists all asset feeds in a parent project/folder/organization.
Expand Down Expand Up @@ -701,7 +754,24 @@ export class AssetServiceClient {
'parent': request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.listFeeds(request, options, callback);
this._log.info('listFeeds request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.asset.v1.IListFeedsResponse,
protos.google.cloud.asset.v1.IListFeedsRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('listFeeds response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.listFeeds(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.asset.v1.IListFeedsResponse,
protos.google.cloud.asset.v1.IListFeedsRequest|undefined, {}|undefined
]) => {
this._log.info('listFeeds response %j', response);
return [response, options, rawResponse];
});
}
/**
* Updates an asset feed configuration.
Expand Down Expand Up @@ -779,7 +849,24 @@ export class AssetServiceClient {
'feed.name': request.feed!.name ?? '',
});
this.initialize();
return this.innerApiCalls.updateFeed(request, options, callback);
this._log.info('updateFeed request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.asset.v1.IFeed,
protos.google.cloud.asset.v1.IUpdateFeedRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('updateFeed response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.updateFeed(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.asset.v1.IFeed,
protos.google.cloud.asset.v1.IUpdateFeedRequest|undefined, {}|undefined
]) => {
this._log.info('updateFeed response %j', response);
return [response, options, rawResponse];
});
}
/**
* Deletes an asset feed.
Expand Down Expand Up @@ -852,7 +939,24 @@ export class AssetServiceClient {
'name': request.name ?? '',
});
this.initialize();
return this.innerApiCalls.deleteFeed(request, options, callback);
this._log.info('deleteFeed request %j', request);
const wrappedCallback: Callback<
protos.google.protobuf.IEmpty,
protos.google.cloud.asset.v1.IDeleteFeedRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('deleteFeed response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.deleteFeed(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.protobuf.IEmpty,
protos.google.cloud.asset.v1.IDeleteFeedRequest|undefined, {}|undefined
]) => {
this._log.info('deleteFeed response %j', response);
return [response, options, rawResponse];
});
}

/**
Expand Down Expand Up @@ -949,7 +1053,24 @@ export class AssetServiceClient {
'parent': request.parent ?? '',
});
this.initialize();
return this.innerApiCalls.exportAssets(request, options, callback);
const wrappedCallback: Callback<
protos.google.longrunning.IOperation,
protos.google.cloud.asset.v1.IExportAssetsRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('exportAssets response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
this._log.info('exportAssets request %j', request);
return this.innerApiCalls.exportAssets(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.longrunning.IOperation,
protos.google.cloud.asset.v1.IExportAssetsRequest|undefined, {}|undefined
]) => {
this._log.info('exportAssets response %j', response);
return [response, options, rawResponse];
});
}
/**
* Check the status of the long running operation returned by `exportAssets()`.
Expand All @@ -963,6 +1084,7 @@ export class AssetServiceClient {
* region_tag:cloudasset_v1_generated_AssetService_ExportAssets_async
*/
async checkExportAssetsProgress(name: string): Promise<LROperation<protos.google.cloud.asset.v1.ExportAssetsResponse, protos.google.cloud.asset.v1.ExportAssetsRequest>>{
this._log.info('exportAssets long-running');
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name});
const [operation] = await this.operationsClient.getOperation(request);
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportAssets, this._gaxModule.createDefaultBackoffSettings());
Expand Down Expand Up @@ -1089,6 +1211,7 @@ export class AssetServiceClient {
close(): Promise<void> {
if (this.assetServiceStub && !this._terminated) {
return this.assetServiceStub.then(stub => {
this._log.info('ending gRPC channel');
this._terminated = true;
stub.close();
this.operationsClient.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {fileURLToPath} from 'url';
import {getJSON} from '../json-helper.cjs';
// @ts-ignore
const dirname = path.dirname(fileURLToPath(import.meta.url));
import * as logging from 'google-logging-utils';

/**
* Client JSON configuration object, loaded from
Expand Down Expand Up @@ -64,6 +65,7 @@ export class BigQueryStorageClient {
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
private _log = logging.log('storage');
auth: gax.GoogleAuth;
descriptors: Descriptors = {
page: {},
Expand Down Expand Up @@ -465,7 +467,24 @@ export class BigQueryStorageClient {
'table_reference.dataset_id': request.tableReference!.datasetId ?? '',
});
this.initialize();
return this.innerApiCalls.createReadSession(request, options, callback);
this._log.info('createReadSession request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.bigquery.storage.v1beta1.IReadSession,
protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('createReadSession response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.createReadSession(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.bigquery.storage.v1beta1.IReadSession,
protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest|undefined, {}|undefined
]) => {
this._log.info('createReadSession response %j', response);
return [response, options, rawResponse];
});
}
/**
* Creates additional streams for a ReadSession. This API can be used to
Expand Down Expand Up @@ -542,7 +561,24 @@ export class BigQueryStorageClient {
'session.name': request.session!.name ?? '',
});
this.initialize();
return this.innerApiCalls.batchCreateReadSessionStreams(request, options, callback);
this._log.info('batchCreateReadSessionStreams request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse,
protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('batchCreateReadSessionStreams response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.batchCreateReadSessionStreams(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse,
protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest|undefined, {}|undefined
]) => {
this._log.info('batchCreateReadSessionStreams response %j', response);
return [response, options, rawResponse];
});
}
/**
* Triggers the graceful termination of a single stream in a ReadSession. This
Expand Down Expand Up @@ -625,7 +661,24 @@ export class BigQueryStorageClient {
'stream.name': request.stream!.name ?? '',
});
this.initialize();
return this.innerApiCalls.finalizeStream(request, options, callback);
this._log.info('finalizeStream request %j', request);
const wrappedCallback: Callback<
protos.google.protobuf.IEmpty,
protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('finalizeStream response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.finalizeStream(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.protobuf.IEmpty,
protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest|undefined, {}|undefined
]) => {
this._log.info('finalizeStream response %j', response);
return [response, options, rawResponse];
});
}
/**
* Splits a given read stream into two Streams. These streams are referred to
Expand Down Expand Up @@ -715,7 +768,24 @@ export class BigQueryStorageClient {
'original_stream.name': request.originalStream!.name ?? '',
});
this.initialize();
return this.innerApiCalls.splitReadStream(request, options, callback);
this._log.info('splitReadStream request %j', request);
const wrappedCallback: Callback<
protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse,
protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest|null|undefined,
{}|null|undefined>|undefined = callback
? (error, response, options, rawResponse) => {
this._log.info('splitReadStream response %j', response);
callback(error, response, options, rawResponse);
}
: undefined;
return this.innerApiCalls.splitReadStream(request, options, wrappedCallback)
?.then(([response, options, rawResponse]: [
protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse,
protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest|undefined, {}|undefined
]) => {
this._log.info('splitReadStream response %j', response);
return [response, options, rawResponse];
});
}

/**
Expand Down Expand Up @@ -758,6 +828,7 @@ export class BigQueryStorageClient {
'read_position.stream.name': request.readPosition!.stream!.name ?? '',
});
this.initialize();
this._log.info('readRows stream %j', options);
return this.innerApiCalls.readRows(request, options);
}

Expand Down Expand Up @@ -872,6 +943,7 @@ export class BigQueryStorageClient {
close(): Promise<void> {
if (this.bigQueryStorageStub && !this._terminated) {
return this.bigQueryStorageStub.then(stub => {
this._log.info('ending gRPC channel');
this._terminated = true;
stub.close();
});
Expand Down
Loading

0 comments on commit e8abb7b

Please sign in to comment.