From 3aa5c58ce7458364d1f4e953a7a023ed64db0870 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 15:38:43 -0700 Subject: [PATCH] chore: new owl bot post processor docker image (#521) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f Co-authored-by: Owl Bot --- .../google-cloud-tasks/protos/protos.d.ts | 14 +- packages/google-cloud-tasks/protos/protos.js | 28 +-- .../src/v2/cloud_tasks_client.ts | 199 +++++++-------- .../src/v2beta2/cloud_tasks_client.ts | 235 ++++++++---------- .../src/v2beta3/cloud_tasks_client.ts | 199 +++++++-------- .../test/gapic_cloud_tasks_v2.ts | 112 ++++----- .../test/gapic_cloud_tasks_v2beta2.ts | 132 ++++------ .../test/gapic_cloud_tasks_v2beta3.ts | 112 ++++----- 8 files changed, 450 insertions(+), 581 deletions(-) diff --git a/packages/google-cloud-tasks/protos/protos.d.ts b/packages/google-cloud-tasks/protos/protos.d.ts index e0ee217dd79..cbed5b31fa2 100644 --- a/packages/google-cloud-tasks/protos/protos.d.ts +++ b/packages/google-cloud-tasks/protos/protos.d.ts @@ -5779,10 +5779,10 @@ export namespace google { constructor(properties?: google.cloud.tasks.v2beta2.IRetryConfig); /** RetryConfig maxAttempts. */ - public maxAttempts: number; + public maxAttempts?: (number|null); /** RetryConfig unlimitedAttempts. */ - public unlimitedAttempts: boolean; + public unlimitedAttempts?: (boolean|null); /** RetryConfig maxRetryDuration. */ public maxRetryDuration?: (google.protobuf.IDuration|null); @@ -10403,19 +10403,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-tasks/protos/protos.js b/packages/google-cloud-tasks/protos/protos.js index fbf7f2ed5af..c14a761de2d 100644 --- a/packages/google-cloud-tasks/protos/protos.js +++ b/packages/google-cloud-tasks/protos/protos.js @@ -13285,19 +13285,19 @@ /** * RetryConfig maxAttempts. - * @member {number} maxAttempts + * @member {number|null|undefined} maxAttempts * @memberof google.cloud.tasks.v2beta2.RetryConfig * @instance */ - RetryConfig.prototype.maxAttempts = 0; + RetryConfig.prototype.maxAttempts = null; /** * RetryConfig unlimitedAttempts. - * @member {boolean} unlimitedAttempts + * @member {boolean|null|undefined} unlimitedAttempts * @memberof google.cloud.tasks.v2beta2.RetryConfig * @instance */ - RetryConfig.prototype.unlimitedAttempts = false; + RetryConfig.prototype.unlimitedAttempts = null; /** * RetryConfig maxRetryDuration. @@ -24535,43 +24535,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-tasks/src/v2/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts index ead48331c26..8966e5f6c51 100644 --- a/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2/cloud_tasks_client.ts @@ -262,13 +262,14 @@ export class CloudTasksClient { ]; for (const methodName of cloudTasksStubMethods) { const callPromise = this.cloudTasksStub.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; } @@ -417,11 +418,10 @@ export class CloudTasksClient { 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.getQueue(request, options, callback); } @@ -521,11 +521,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createQueue(request, options, callback); } @@ -629,11 +628,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'queue.name': request.queue!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'queue.name': request.queue!.name || '', + }); this.initialize(); return this.innerApiCalls.updateQueue(request, options, callback); } @@ -726,11 +724,10 @@ export class CloudTasksClient { 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.deleteQueue(request, options, callback); } @@ -816,11 +813,10 @@ export class CloudTasksClient { 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.purgeQueue(request, options, callback); } @@ -907,11 +903,10 @@ export class CloudTasksClient { 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.pauseQueue(request, options, callback); } @@ -1004,11 +999,10 @@ export class CloudTasksClient { 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.resumeQueue(request, options, callback); } @@ -1100,11 +1094,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } @@ -1200,11 +1193,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } @@ -1296,11 +1288,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } @@ -1394,11 +1385,10 @@ export class CloudTasksClient { 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.getTask(request, options, callback); } @@ -1532,11 +1522,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createTask(request, options, callback); } @@ -1621,11 +1610,10 @@ export class CloudTasksClient { 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.deleteTask(request, options, callback); } @@ -1742,11 +1730,10 @@ export class CloudTasksClient { 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.runTask(request, options, callback); } @@ -1862,11 +1849,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listQueues(request, options, callback); } @@ -1927,11 +1913,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listQueues.createStream( @@ -2003,17 +1988,16 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listQueues.asyncIterate( this.innerApiCalls['listQueues'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2137,11 +2121,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listTasks(request, options, callback); } @@ -2205,11 +2188,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTasks.createStream( @@ -2284,17 +2266,16 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTasks.asyncIterate( this.innerApiCalls['listTasks'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts index 3b7f92ba18a..9cbad5ef95f 100644 --- a/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2beta2/cloud_tasks_client.ts @@ -266,13 +266,14 @@ export class CloudTasksClient { ]; for (const methodName of cloudTasksStubMethods) { const callPromise = this.cloudTasksStub.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; } @@ -426,11 +427,10 @@ export class CloudTasksClient { 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.getQueue(request, options, callback); } @@ -532,11 +532,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createQueue(request, options, callback); } @@ -642,11 +641,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'queue.name': request.queue!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'queue.name': request.queue!.name || '', + }); this.initialize(); return this.innerApiCalls.updateQueue(request, options, callback); } @@ -741,11 +739,10 @@ export class CloudTasksClient { 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.deleteQueue(request, options, callback); } @@ -833,11 +830,10 @@ export class CloudTasksClient { 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.purgeQueue(request, options, callback); } @@ -926,11 +922,10 @@ export class CloudTasksClient { 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.pauseQueue(request, options, callback); } @@ -1025,11 +1020,10 @@ export class CloudTasksClient { 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.resumeQueue(request, options, callback); } @@ -1121,11 +1115,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } @@ -1221,11 +1214,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } @@ -1317,11 +1309,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } @@ -1415,11 +1406,10 @@ export class CloudTasksClient { 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.getTask(request, options, callback); } @@ -1557,11 +1547,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createTask(request, options, callback); } @@ -1648,11 +1637,10 @@ export class CloudTasksClient { 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.deleteTask(request, options, callback); } @@ -1830,11 +1818,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.leaseTasks(request, options, callback); } @@ -1941,11 +1928,10 @@ export class CloudTasksClient { 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.acknowledgeTask(request, options, callback); } @@ -2057,11 +2043,10 @@ export class CloudTasksClient { 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.renewLease(request, options, callback); } @@ -2168,11 +2153,10 @@ export class CloudTasksClient { 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.cancelLease(request, options, callback); } @@ -2292,11 +2276,10 @@ export class CloudTasksClient { 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.runTask(request, options, callback); } @@ -2419,11 +2402,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listQueues(request, options, callback); } @@ -2489,11 +2471,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listQueues.createStream( @@ -2570,17 +2551,16 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listQueues.asyncIterate( this.innerApiCalls['listQueues'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2706,11 +2686,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listTasks(request, options, callback); } @@ -2774,11 +2753,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTasks.createStream( @@ -2853,17 +2831,16 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTasks.asyncIterate( this.innerApiCalls['listTasks'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts index 6e5b3e02f71..6e563105013 100644 --- a/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts +++ b/packages/google-cloud-tasks/src/v2beta3/cloud_tasks_client.ts @@ -262,13 +262,14 @@ export class CloudTasksClient { ]; for (const methodName of cloudTasksStubMethods) { const callPromise = this.cloudTasksStub.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; } @@ -422,11 +423,10 @@ export class CloudTasksClient { 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.getQueue(request, options, callback); } @@ -528,11 +528,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createQueue(request, options, callback); } @@ -638,11 +637,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'queue.name': request.queue!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'queue.name': request.queue!.name || '', + }); this.initialize(); return this.innerApiCalls.updateQueue(request, options, callback); } @@ -737,11 +735,10 @@ export class CloudTasksClient { 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.deleteQueue(request, options, callback); } @@ -829,11 +826,10 @@ export class CloudTasksClient { 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.purgeQueue(request, options, callback); } @@ -922,11 +918,10 @@ export class CloudTasksClient { 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.pauseQueue(request, options, callback); } @@ -1021,11 +1016,10 @@ export class CloudTasksClient { 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.resumeQueue(request, options, callback); } @@ -1117,11 +1111,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } @@ -1217,11 +1210,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } @@ -1313,11 +1305,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } @@ -1411,11 +1402,10 @@ export class CloudTasksClient { 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.getTask(request, options, callback); } @@ -1551,11 +1541,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createTask(request, options, callback); } @@ -1642,11 +1631,10 @@ export class CloudTasksClient { 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.deleteTask(request, options, callback); } @@ -1763,11 +1751,10 @@ export class CloudTasksClient { 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.runTask(request, options, callback); } @@ -1890,11 +1877,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listQueues(request, options, callback); } @@ -1960,11 +1946,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listQueues.createStream( @@ -2041,17 +2026,16 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listQueues.asyncIterate( this.innerApiCalls['listQueues'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2177,11 +2161,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listTasks(request, options, callback); } @@ -2245,11 +2228,10 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTasks.createStream( @@ -2324,17 +2306,16 @@ export class CloudTasksClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listTasks.asyncIterate( this.innerApiCalls['listTasks'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2.ts b/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2.ts index 2ad42f91b8e..a7322135926 100644 --- a/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2.ts +++ b/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2.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; @@ -247,9 +246,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Queue() ); - client.innerApiCalls.getQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getQueue( request, @@ -356,9 +354,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Queue() ); - client.innerApiCalls.createQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createQueue( request, @@ -470,9 +467,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Queue() ); - client.innerApiCalls.updateQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateQueue( request, @@ -583,9 +579,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteQueue( request, @@ -695,9 +690,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Queue() ); - client.innerApiCalls.purgeQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.purgeQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.purgeQueue( request, @@ -807,9 +801,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Queue() ); - client.innerApiCalls.pauseQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.pauseQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.pauseQueue( request, @@ -919,9 +912,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Queue() ); - client.innerApiCalls.resumeQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.resumeQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.resumeQueue( request, @@ -1031,9 +1023,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getIamPolicy( request, @@ -1143,9 +1134,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setIamPolicy( request, @@ -1224,9 +1214,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1257,9 +1246,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.testIamPermissions( request, @@ -1369,9 +1357,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Task() ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getTask( request, @@ -1478,9 +1465,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Task() ); - client.innerApiCalls.createTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createTask( request, @@ -1590,9 +1576,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteTask( request, @@ -1702,9 +1687,8 @@ describe('v2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2.Task() ); - client.innerApiCalls.runTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.runTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.runTask( request, @@ -1815,9 +1799,8 @@ describe('v2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), ]; - client.innerApiCalls.listQueues = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listQueues = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listQueues( request, @@ -1889,9 +1872,8 @@ describe('v2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), ]; - client.descriptors.page.listQueues.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listQueues.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listQueuesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.tasks.v2.Queue[] = []; @@ -1979,9 +1961,8 @@ describe('v2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), ]; - client.descriptors.page.listQueues.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listQueues.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.tasks.v2.IQueue[] = []; const iterable = client.listQueuesAsync(request); for await (const resource of iterable) { @@ -2097,9 +2078,8 @@ describe('v2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listTasks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listTasks( request, @@ -2168,9 +2148,8 @@ describe('v2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listTasks.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listTasksStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.tasks.v2.Task[] = []; @@ -2256,9 +2235,8 @@ describe('v2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listTasks.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.tasks.v2.ITask[] = []; const iterable = client.listTasksAsync(request); for await (const resource of iterable) { diff --git a/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta2.ts b/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta2.ts index 46937848173..7e3e914a46e 100644 --- a/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta2.ts +++ b/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta2.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; @@ -247,9 +246,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Queue() ); - client.innerApiCalls.getQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getQueue( request, @@ -356,9 +354,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Queue() ); - client.innerApiCalls.createQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createQueue( request, @@ -470,9 +467,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Queue() ); - client.innerApiCalls.updateQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateQueue( request, @@ -583,9 +579,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteQueue( request, @@ -695,9 +690,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Queue() ); - client.innerApiCalls.purgeQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.purgeQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.purgeQueue( request, @@ -807,9 +801,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Queue() ); - client.innerApiCalls.pauseQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.pauseQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.pauseQueue( request, @@ -919,9 +912,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Queue() ); - client.innerApiCalls.resumeQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.resumeQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.resumeQueue( request, @@ -1031,9 +1023,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getIamPolicy( request, @@ -1143,9 +1134,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setIamPolicy( request, @@ -1224,9 +1214,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1257,9 +1246,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.testIamPermissions( request, @@ -1369,9 +1357,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Task() ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getTask( request, @@ -1478,9 +1465,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Task() ); - client.innerApiCalls.createTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createTask( request, @@ -1590,9 +1576,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteTask( request, @@ -1702,9 +1687,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.LeaseTasksResponse() ); - client.innerApiCalls.leaseTasks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.leaseTasks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.leaseTasks( request, @@ -1814,9 +1798,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.acknowledgeTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.acknowledgeTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.acknowledgeTask( request, @@ -1926,9 +1909,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Task() ); - client.innerApiCalls.renewLease = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.renewLease = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.renewLease( request, @@ -2038,9 +2020,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Task() ); - client.innerApiCalls.cancelLease = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.cancelLease = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.cancelLease( request, @@ -2150,9 +2131,8 @@ describe('v2beta2.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta2.Task() ); - client.innerApiCalls.runTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.runTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.runTask( request, @@ -2263,9 +2243,8 @@ describe('v2beta2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), ]; - client.innerApiCalls.listQueues = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listQueues = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listQueues( request, @@ -2337,9 +2316,8 @@ describe('v2beta2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), ]; - client.descriptors.page.listQueues.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listQueues.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listQueuesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.tasks.v2beta2.Queue[] = []; @@ -2433,9 +2411,8 @@ describe('v2beta2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), ]; - client.descriptors.page.listQueues.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listQueues.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.tasks.v2beta2.IQueue[] = []; const iterable = client.listQueuesAsync(request); for await (const resource of iterable) { @@ -2551,9 +2528,8 @@ describe('v2beta2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listTasks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listTasks( request, @@ -2622,9 +2598,8 @@ describe('v2beta2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listTasks.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listTasksStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.tasks.v2beta2.Task[] = []; @@ -2716,9 +2691,8 @@ describe('v2beta2.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listTasks.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.tasks.v2beta2.ITask[] = []; const iterable = client.listTasksAsync(request); for await (const resource of iterable) { diff --git a/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta3.ts b/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta3.ts index 1c6568353ee..297cb4fe55e 100644 --- a/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta3.ts +++ b/packages/google-cloud-tasks/test/gapic_cloud_tasks_v2beta3.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; @@ -247,9 +246,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Queue() ); - client.innerApiCalls.getQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getQueue( request, @@ -356,9 +354,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Queue() ); - client.innerApiCalls.createQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createQueue( request, @@ -470,9 +467,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Queue() ); - client.innerApiCalls.updateQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateQueue( request, @@ -583,9 +579,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteQueue( request, @@ -695,9 +690,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Queue() ); - client.innerApiCalls.purgeQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.purgeQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.purgeQueue( request, @@ -807,9 +801,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Queue() ); - client.innerApiCalls.pauseQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.pauseQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.pauseQueue( request, @@ -919,9 +912,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Queue() ); - client.innerApiCalls.resumeQueue = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.resumeQueue = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.resumeQueue( request, @@ -1031,9 +1023,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getIamPolicy( request, @@ -1143,9 +1134,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.setIamPolicy( request, @@ -1224,9 +1214,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); const [response] = await client.testIamPermissions(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1257,9 +1246,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.testIamPermissions( request, @@ -1369,9 +1357,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Task() ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getTask( request, @@ -1478,9 +1465,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Task() ); - client.innerApiCalls.createTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createTask( request, @@ -1590,9 +1576,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteTask( request, @@ -1702,9 +1687,8 @@ describe('v2beta3.CloudTasksClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.tasks.v2beta3.Task() ); - client.innerApiCalls.runTask = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.runTask = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.runTask( request, @@ -1815,9 +1799,8 @@ describe('v2beta3.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), ]; - client.innerApiCalls.listQueues = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listQueues = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listQueues( request, @@ -1889,9 +1872,8 @@ describe('v2beta3.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), ]; - client.descriptors.page.listQueues.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listQueues.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listQueuesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.tasks.v2beta3.Queue[] = []; @@ -1985,9 +1967,8 @@ describe('v2beta3.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), ]; - client.descriptors.page.listQueues.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listQueues.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.tasks.v2beta3.IQueue[] = []; const iterable = client.listQueuesAsync(request); for await (const resource of iterable) { @@ -2103,9 +2084,8 @@ describe('v2beta3.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listTasks = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listTasks( request, @@ -2174,9 +2154,8 @@ describe('v2beta3.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listTasks.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listTasksStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.tasks.v2beta3.Task[] = []; @@ -2268,9 +2247,8 @@ describe('v2beta3.CloudTasksClient', () => { generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listTasks.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.tasks.v2beta3.ITask[] = []; const iterable = client.listTasksAsync(request); for await (const resource of iterable) {