Skip to content
Draft
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
30 changes: 15 additions & 15 deletions handwritten/bigquery-storage/src/v1/big_query_read_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import type {
Descriptors,
ClientOptions,
} from 'google-gax';
import { PassThrough } from 'stream';
import {PassThrough} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax';
import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax';

/**
* Client JSON configuration object, loaded from
Expand All @@ -51,7 +51,7 @@ export class BigQueryReadClient {
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
private _defaults: { [method: string]: gax.CallSettings };
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
private _log = logging.log('bigquery-storage');
Expand All @@ -64,9 +64,9 @@ export class BigQueryReadClient {
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: { [name: string]: Function };
pathTemplates: { [name: string]: gax.PathTemplate };
bigQueryReadStub?: Promise<{ [name: string]: Function }>;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
bigQueryReadStub?: Promise<{[name: string]: Function}>;

/**
* Construct an instance of BigQueryReadClient.
Expand Down Expand Up @@ -142,7 +142,7 @@ export class BigQueryReadClient {
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== this._servicePath && !('scopes' in opts)) {
Expand Down Expand Up @@ -231,7 +231,7 @@ export class BigQueryReadClient {
'google.cloud.bigquery.storage.v1.BigQueryRead',
gapicConfig as gax.ClientConfig,
opts.clientConfig || {},
{ 'x-goog-api-client': clientHeader.join(' ') },
{'x-goog-api-client': clientHeader.join(' ')},
);

// Set up a dictionary of "inner API calls"; the core implementation
Expand Down Expand Up @@ -271,7 +271,7 @@ export class BigQueryReadClient {
(this._protos as any).google.cloud.bigquery.storage.v1.BigQueryRead,
this._opts,
this._providedCustomServicePath,
) as Promise<{ [method: string]: Function }>;
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
// and create an API call method for each.
Expand All @@ -282,11 +282,11 @@ export class BigQueryReadClient {
];
for (const methodName of bigQueryReadStubMethods) {
const callPromise = this.bigQueryReadStub.then(
(stub) =>
stub =>
(...args: Array<{}>) => {
if (this._terminated) {
if (methodName in this.descriptors.stream) {
const stream = new PassThrough({ objectMode: true });
const stream = new PassThrough({objectMode: true});
setImmediate(() => {
stream.emit(
'error',
Expand Down Expand Up @@ -542,7 +542,7 @@ export class BigQueryReadClient {
this._gaxModule.routingHeader.fromParams({
'read_session.table': request.readSession!.table ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('createReadSession request %j', request);
Expand Down Expand Up @@ -704,7 +704,7 @@ export class BigQueryReadClient {
this._gaxModule.routingHeader.fromParams({
name: request.name ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('splitReadStream request %j', request);
Expand Down Expand Up @@ -793,7 +793,7 @@ export class BigQueryReadClient {
this._gaxModule.routingHeader.fromParams({
read_stream: request.readStream ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('readRows stream %j', options);
Expand Down Expand Up @@ -1078,7 +1078,7 @@ export class BigQueryReadClient {
*/
close(): Promise<void> {
if (this.bigQueryReadStub && !this._terminated) {
return this.bigQueryReadStub.then((stub) => {
return this.bigQueryReadStub.then(stub => {
this._log.info('ending gRPC channel');
this._terminated = true;
stub.close();
Expand Down
36 changes: 18 additions & 18 deletions handwritten/bigquery-storage/src/v1/big_query_write_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import type {
Descriptors,
ClientOptions,
} from 'google-gax';
import { PassThrough } from 'stream';
import {PassThrough} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax';
import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax';

/**
* Client JSON configuration object, loaded from
Expand All @@ -54,7 +54,7 @@ export class BigQueryWriteClient {
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
private _defaults: { [method: string]: gax.CallSettings };
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
private _log = logging.log('bigquery-storage');
Expand All @@ -67,9 +67,9 @@ export class BigQueryWriteClient {
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: { [name: string]: Function };
pathTemplates: { [name: string]: gax.PathTemplate };
bigQueryWriteStub?: Promise<{ [name: string]: Function }>;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
bigQueryWriteStub?: Promise<{[name: string]: Function}>;

/**
* Construct an instance of BigQueryWriteClient.
Expand Down Expand Up @@ -145,7 +145,7 @@ export class BigQueryWriteClient {
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== this._servicePath && !('scopes' in opts)) {
Expand Down Expand Up @@ -234,7 +234,7 @@ export class BigQueryWriteClient {
'google.cloud.bigquery.storage.v1.BigQueryWrite',
gapicConfig as gax.ClientConfig,
opts.clientConfig || {},
{ 'x-goog-api-client': clientHeader.join(' ') },
{'x-goog-api-client': clientHeader.join(' ')},
);

// Set up a dictionary of "inner API calls"; the core implementation
Expand Down Expand Up @@ -274,7 +274,7 @@ export class BigQueryWriteClient {
(this._protos as any).google.cloud.bigquery.storage.v1.BigQueryWrite,
this._opts,
this._providedCustomServicePath,
) as Promise<{ [method: string]: Function }>;
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
// and create an API call method for each.
Expand All @@ -288,11 +288,11 @@ export class BigQueryWriteClient {
];
for (const methodName of bigQueryWriteStubMethods) {
const callPromise = this.bigQueryWriteStub.then(
(stub) =>
stub =>
(...args: Array<{}>) => {
if (this._terminated) {
if (methodName in this.descriptors.stream) {
const stream = new PassThrough({ objectMode: true });
const stream = new PassThrough({objectMode: true});
setImmediate(() => {
stream.emit(
'error',
Expand Down Expand Up @@ -516,7 +516,7 @@ export class BigQueryWriteClient {
this._gaxModule.routingHeader.fromParams({
parent: request.parent ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('createWriteStream request %j', request);
Expand Down Expand Up @@ -663,7 +663,7 @@ export class BigQueryWriteClient {
this._gaxModule.routingHeader.fromParams({
name: request.name ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('getWriteStream request %j', request);
Expand Down Expand Up @@ -808,7 +808,7 @@ export class BigQueryWriteClient {
this._gaxModule.routingHeader.fromParams({
name: request.name ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('finalizeWriteStream request %j', request);
Expand Down Expand Up @@ -959,7 +959,7 @@ export class BigQueryWriteClient {
this._gaxModule.routingHeader.fromParams({
parent: request.parent ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('batchCommitWriteStreams request %j', request);
Expand Down Expand Up @@ -1106,7 +1106,7 @@ export class BigQueryWriteClient {
this._gaxModule.routingHeader.fromParams({
write_stream: request.writeStream ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('flushRows request %j', request);
Expand Down Expand Up @@ -1199,7 +1199,7 @@ export class BigQueryWriteClient {
* region_tag:bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async
*/
appendRows(options?: CallOptions): gax.CancellableStream {
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('appendRows stream %j', options);
Expand Down Expand Up @@ -1484,7 +1484,7 @@ export class BigQueryWriteClient {
*/
close(): Promise<void> {
if (this.bigQueryWriteStub && !this._terminated) {
return this.bigQueryWriteStub.then((stub) => {
return this.bigQueryWriteStub.then(stub => {
this._log.info('ending gRPC channel');
this._terminated = true;
stub.close();
Expand Down
4 changes: 2 additions & 2 deletions handwritten/bigquery-storage/src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

export { BigQueryReadClient } from './big_query_read_client';
export { BigQueryWriteClient } from './big_query_write_client';
export {BigQueryReadClient} from './big_query_read_client';
export {BigQueryWriteClient} from './big_query_write_client';
2 changes: 1 addition & 1 deletion handwritten/bigquery-storage/src/v1alpha/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

export { MetastorePartitionServiceClient } from './metastore_partition_service_client';
export {MetastorePartitionServiceClient} from './metastore_partition_service_client';
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import type {
Descriptors,
ClientOptions,
} from 'google-gax';
import { PassThrough } from 'stream';
import {PassThrough} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax';
import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax';

/**
* Client JSON configuration object, loaded from
Expand All @@ -51,7 +51,7 @@ export class MetastorePartitionServiceClient {
private _gaxModule: typeof gax | typeof gax.fallback;
private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
private _protos: {};
private _defaults: { [method: string]: gax.CallSettings };
private _defaults: {[method: string]: gax.CallSettings};
private _universeDomain: string;
private _servicePath: string;
private _log = logging.log('storage');
Expand All @@ -64,9 +64,9 @@ export class MetastorePartitionServiceClient {
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: { [name: string]: Function };
pathTemplates: { [name: string]: gax.PathTemplate };
metastorePartitionServiceStub?: Promise<{ [name: string]: Function }>;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
metastorePartitionServiceStub?: Promise<{[name: string]: Function}>;

/**
* Construct an instance of MetastorePartitionServiceClient.
Expand Down Expand Up @@ -143,7 +143,7 @@ export class MetastorePartitionServiceClient {
const fallback =
opts?.fallback ??
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

// Request numeric enum values if REST transport is used.
opts.numericEnums = true;
Expand Down Expand Up @@ -226,7 +226,7 @@ export class MetastorePartitionServiceClient {
'google.cloud.bigquery.storage.v1alpha.MetastorePartitionService',
gapicConfig as gax.ClientConfig,
opts.clientConfig || {},
{ 'x-goog-api-client': clientHeader.join(' ') },
{'x-goog-api-client': clientHeader.join(' ')},
);

// Set up a dictionary of "inner API calls"; the core implementation
Expand Down Expand Up @@ -267,7 +267,7 @@ export class MetastorePartitionServiceClient {
.MetastorePartitionService,
this._opts,
this._providedCustomServicePath,
) as Promise<{ [method: string]: Function }>;
) as Promise<{[method: string]: Function}>;

// Iterate over each of the methods that the service provides
// and create an API call method for each.
Expand All @@ -280,11 +280,11 @@ export class MetastorePartitionServiceClient {
];
for (const methodName of metastorePartitionServiceStubMethods) {
const callPromise = this.metastorePartitionServiceStub.then(
(stub) =>
stub =>
(...args: Array<{}>) => {
if (this._terminated) {
if (methodName in this.descriptors.stream) {
const stream = new PassThrough({ objectMode: true });
const stream = new PassThrough({objectMode: true});
setImmediate(() => {
stream.emit(
'error',
Expand Down Expand Up @@ -515,7 +515,7 @@ export class MetastorePartitionServiceClient {
this._gaxModule.routingHeader.fromParams({
parent: request.parent ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('batchCreateMetastorePartitions request %j', request);
Expand Down Expand Up @@ -675,7 +675,7 @@ export class MetastorePartitionServiceClient {
this._gaxModule.routingHeader.fromParams({
parent: request.parent ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('batchDeleteMetastorePartitions request %j', request);
Expand Down Expand Up @@ -834,7 +834,7 @@ export class MetastorePartitionServiceClient {
this._gaxModule.routingHeader.fromParams({
parent: request.parent ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('batchUpdateMetastorePartitions request %j', request);
Expand Down Expand Up @@ -1002,7 +1002,7 @@ export class MetastorePartitionServiceClient {
this._gaxModule.routingHeader.fromParams({
parent: request.parent ?? '',
});
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('listMetastorePartitions request %j', request);
Expand Down Expand Up @@ -1073,7 +1073,7 @@ export class MetastorePartitionServiceClient {
* region_tag:bigquerystorage_v1alpha_generated_MetastorePartitionService_StreamMetastorePartitions_async
*/
streamMetastorePartitions(options?: CallOptions): gax.CancellableStream {
this.initialize().catch((err) => {
this.initialize().catch(err => {
throw err;
});
this._log.info('streamMetastorePartitions stream %j', options);
Expand Down Expand Up @@ -1212,7 +1212,7 @@ export class MetastorePartitionServiceClient {
*/
close(): Promise<void> {
if (this.metastorePartitionServiceStub && !this._terminated) {
return this.metastorePartitionServiceStub.then((stub) => {
return this.metastorePartitionServiceStub.then(stub => {
this._log.info('ending gRPC channel');
this._terminated = true;
stub.close();
Expand Down
Loading
Loading