diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 619dc695897..4ab3a82b13b 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -4197,19 +4197,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 6f315f5ffad..a948d7dd4df 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -9799,43 +9799,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index a5d7db865c2..f25c074a4f8 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -230,13 +230,14 @@ export class BigQueryReadClient { ]; for (const methodName of bigQueryReadStubMethods) { const callPromise = this.bigQueryReadStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -432,11 +433,10 @@ export class BigQueryReadClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'read_session.table': request.readSession!.table || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'read_session.table': request.readSession!.table || '', + }); this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); } @@ -549,11 +549,10 @@ export class BigQueryReadClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.splitReadStream(request, options, callback); } @@ -595,11 +594,10 @@ export class BigQueryReadClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - read_stream: request.readStream || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + read_stream: request.readStream || '', + }); this.initialize(); return this.innerApiCalls.readRows(request, options); } diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index da6f81c04e4..4defcb909f4 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -233,13 +233,14 @@ export class BigQueryStorageClient { ]; for (const methodName of bigQueryStorageStubMethods) { const callPromise = this.bigQueryStorageStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -437,12 +438,11 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'table_reference.project_id': request.tableReference!.projectId || '', - 'table_reference.dataset_id': request.tableReference!.datasetId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'table_reference.project_id': request.tableReference!.projectId || '', + 'table_reference.dataset_id': request.tableReference!.datasetId || '', + }); this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); } @@ -543,11 +543,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'session.name': request.session!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'session.name': request.session!.name || '', + }); this.initialize(); return this.innerApiCalls.batchCreateReadSessionStreams( request, @@ -658,11 +657,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'stream.name': request.stream!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'stream.name': request.stream!.name || '', + }); this.initialize(); return this.innerApiCalls.finalizeStream(request, options, callback); } @@ -776,11 +774,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'original_stream.name': request.originalStream!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'original_stream.name': request.originalStream!.name || '', + }); this.initialize(); return this.innerApiCalls.splitReadStream(request, options, callback); } @@ -822,11 +819,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'read_position.stream.name': request.readPosition!.stream!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'read_position.stream.name': request.readPosition!.stream!.name || '', + }); this.initialize(); return this.innerApiCalls.readRows(request, options); } diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index 6d69543ebaf..e7feeb4724d 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -209,9 +208,8 @@ describe('v1.BigQueryReadClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadSession() ); - client.innerApiCalls.createReadSession = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createReadSession = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createReadSession( request, @@ -322,9 +320,8 @@ describe('v1.BigQueryReadClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamResponse() ); - client.innerApiCalls.splitReadStream = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.splitReadStream = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.splitReadStream( request, diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 471cebc8ec7..b4821b15682 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -217,9 +216,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadSession() ); - client.innerApiCalls.createReadSession = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createReadSession = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createReadSession( request, @@ -303,9 +301,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() ); - client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.batchCreateReadSessionStreams = + stubSimpleCall(expectedResponse); const [response] = await client.batchCreateReadSessionStreams(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -337,9 +334,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() ); - client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchCreateReadSessionStreams = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchCreateReadSessionStreams( request, @@ -455,9 +451,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.finalizeStream = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.finalizeStream = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.finalizeStream( request, @@ -570,9 +565,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse() ); - client.innerApiCalls.splitReadStream = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.splitReadStream = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.splitReadStream( request,