From a41ff0b5049da66251838cb08ba1a2f71711bf37 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:00:27 +0000 Subject: [PATCH] chore: new owl bot post processor docker image (#317) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../google-cloud-talent/protos/protos.d.ts | 20 +- packages/google-cloud-talent/protos/protos.js | 40 +- .../src/v4/company_service_client.ts | 80 ++-- .../src/v4/completion_client.ts | 24 +- .../src/v4/event_service_client.ts | 24 +- .../src/v4/job_service_client.ts | 125 +++---- .../src/v4/tenant_service_client.ts | 80 ++-- .../src/v4beta1/application_service_client.ts | 80 ++-- .../src/v4beta1/company_service_client.ts | 80 ++-- .../src/v4beta1/completion_client.ts | 24 +- .../src/v4beta1/event_service_client.ts | 24 +- .../src/v4beta1/job_service_client.ts | 125 +++---- .../src/v4beta1/profile_service_client.ts | 89 ++--- .../src/v4beta1/tenant_service_client.ts | 80 ++-- .../test/gapic_application_service_v4beta1.ts | 352 ++++++++---------- .../test/gapic_company_service_v4.ts | 92 ++--- .../test/gapic_company_service_v4beta1.ts | 132 ++++--- .../test/gapic_completion_v4.ts | 12 +- .../test/gapic_completion_v4beta1.ts | 52 +-- .../test/gapic_event_service_v4.ts | 12 +- .../test/gapic_event_service_v4beta1.ts | 52 +-- .../test/gapic_job_service_v4.ts | 87 ++--- .../test/gapic_job_service_v4beta1.ts | 122 +++--- .../test/gapic_profile_service_v4beta1.ts | 131 ++++--- .../test/gapic_tenant_service_v4.ts | 42 +-- .../test/gapic_tenant_service_v4beta1.ts | 82 ++-- 26 files changed, 959 insertions(+), 1104 deletions(-) diff --git a/packages/google-cloud-talent/protos/protos.d.ts b/packages/google-cloud-talent/protos/protos.d.ts index 1c878ff2718..0d0aab87639 100644 --- a/packages/google-cloud-talent/protos/protos.d.ts +++ b/packages/google-cloud-talent/protos/protos.d.ts @@ -3587,7 +3587,7 @@ export namespace google { public allowImpreciseAddresses: boolean; /** CommuteFilter roadTraffic. */ - public roadTraffic: (google.cloud.talent.v4.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4.CommuteFilter.RoadTraffic); + public roadTraffic?: (google.cloud.talent.v4.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4.CommuteFilter.RoadTraffic|null); /** CommuteFilter departureTime. */ public departureTime?: (google.type.ITimeOfDay|null); @@ -12606,7 +12606,7 @@ export namespace google { public allowImpreciseAddresses: boolean; /** CommuteFilter roadTraffic. */ - public roadTraffic: (google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic); + public roadTraffic?: (google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|keyof typeof google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|null); /** CommuteFilter departureTime. */ public departureTime?: (google.type.ITimeOfDay|null); @@ -17106,7 +17106,7 @@ export namespace google { constructor(properties?: google.cloud.talent.v4beta1.IPersonName); /** PersonName formattedName. */ - public formattedName: string; + public formattedName?: (string|null); /** PersonName structuredName. */ public structuredName?: (google.cloud.talent.v4beta1.PersonName.IPersonStructuredName|null); @@ -17340,7 +17340,7 @@ export namespace google { public usage: (google.cloud.talent.v4beta1.ContactInfoUsage|keyof typeof google.cloud.talent.v4beta1.ContactInfoUsage); /** Address unstructuredAddress. */ - public unstructuredAddress: string; + public unstructuredAddress?: (string|null); /** Address structuredAddress. */ public structuredAddress?: (google.type.IPostalAddress|null); @@ -18059,7 +18059,7 @@ export namespace google { public address?: (google.cloud.talent.v4beta1.IAddress|null); /** EducationRecord degreeDescription. */ - public degreeDescription: string; + public degreeDescription?: (string|null); /** EducationRecord structuredDegree. */ public structuredDegree?: (google.cloud.talent.v4beta1.IDegree|null); @@ -20765,19 +20765,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-talent/protos/protos.js b/packages/google-cloud-talent/protos/protos.js index 07eff741141..02d373079e8 100644 --- a/packages/google-cloud-talent/protos/protos.js +++ b/packages/google-cloud-talent/protos/protos.js @@ -9329,11 +9329,11 @@ /** * CommuteFilter roadTraffic. - * @member {google.cloud.talent.v4.CommuteFilter.RoadTraffic} roadTraffic + * @member {google.cloud.talent.v4.CommuteFilter.RoadTraffic|null|undefined} roadTraffic * @memberof google.cloud.talent.v4.CommuteFilter * @instance */ - CommuteFilter.prototype.roadTraffic = 0; + CommuteFilter.prototype.roadTraffic = null; /** * CommuteFilter departureTime. @@ -32923,11 +32923,11 @@ /** * CommuteFilter roadTraffic. - * @member {google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic} roadTraffic + * @member {google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic|null|undefined} roadTraffic * @memberof google.cloud.talent.v4beta1.CommuteFilter * @instance */ - CommuteFilter.prototype.roadTraffic = 0; + CommuteFilter.prototype.roadTraffic = null; /** * CommuteFilter departureTime. @@ -45209,11 +45209,11 @@ /** * PersonName formattedName. - * @member {string} formattedName + * @member {string|null|undefined} formattedName * @memberof google.cloud.talent.v4beta1.PersonName * @instance */ - PersonName.prototype.formattedName = ""; + PersonName.prototype.formattedName = null; /** * PersonName structuredName. @@ -45812,11 +45812,11 @@ /** * Address unstructuredAddress. - * @member {string} unstructuredAddress + * @member {string|null|undefined} unstructuredAddress * @memberof google.cloud.talent.v4beta1.Address * @instance */ - Address.prototype.unstructuredAddress = ""; + Address.prototype.unstructuredAddress = null; /** * Address structuredAddress. @@ -47681,11 +47681,11 @@ /** * EducationRecord degreeDescription. - * @member {string} degreeDescription + * @member {string|null|undefined} degreeDescription * @memberof google.cloud.talent.v4beta1.EducationRecord * @instance */ - EducationRecord.prototype.degreeDescription = ""; + EducationRecord.prototype.degreeDescription = null; /** * EducationRecord structuredDegree. @@ -54378,43 +54378,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-talent/src/v4/company_service_client.ts b/packages/google-cloud-talent/src/v4/company_service_client.ts index 769ce81f239..d1eed04e3ee 100644 --- a/packages/google-cloud-talent/src/v4/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4/company_service_client.ts @@ -242,13 +242,14 @@ export class CompanyServiceClient { ]; for (const methodName of companyServiceStubMethods) { const callPromise = this.companyServiceStub.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; } @@ -406,11 +407,10 @@ export class CompanyServiceClient { 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.createCompany(request, options, callback); } @@ -494,11 +494,10 @@ export class CompanyServiceClient { 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.getCompany(request, options, callback); } @@ -588,11 +587,10 @@ export class CompanyServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'company.name': request.company!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'company.name': request.company!.name || '', + }); this.initialize(); return this.innerApiCalls.updateCompany(request, options, callback); } @@ -679,11 +677,10 @@ export class CompanyServiceClient { 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.deleteCompany(request, options, callback); } @@ -784,11 +781,10 @@ export class CompanyServiceClient { 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.listCompanies(request, options, callback); } @@ -834,11 +830,10 @@ export class CompanyServiceClient { 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.listCompanies.createStream( @@ -895,17 +890,16 @@ export class CompanyServiceClient { 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.listCompanies.asyncIterate( this.innerApiCalls['listCompanies'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4/completion_client.ts b/packages/google-cloud-talent/src/v4/completion_client.ts index 030ef566800..2d01a9efd7a 100644 --- a/packages/google-cloud-talent/src/v4/completion_client.ts +++ b/packages/google-cloud-talent/src/v4/completion_client.ts @@ -216,13 +216,14 @@ export class CompletionClient { const completionStubMethods = ['completeQuery']; for (const methodName of completionStubMethods) { const callPromise = this.completionStub.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; } @@ -404,11 +405,10 @@ export class CompletionClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - tenant: request.tenant || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + tenant: request.tenant || '', + }); this.initialize(); return this.innerApiCalls.completeQuery(request, options, callback); } diff --git a/packages/google-cloud-talent/src/v4/event_service_client.ts b/packages/google-cloud-talent/src/v4/event_service_client.ts index 4e99ddf3ae4..71528c534db 100644 --- a/packages/google-cloud-talent/src/v4/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4/event_service_client.ts @@ -216,13 +216,14 @@ export class EventServiceClient { const eventServiceStubMethods = ['createClientEvent']; for (const methodName of eventServiceStubMethods) { const callPromise = this.eventServiceStub.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; } @@ -393,11 +394,10 @@ export class EventServiceClient { 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.createClientEvent(request, options, callback); } diff --git a/packages/google-cloud-talent/src/v4/job_service_client.ts b/packages/google-cloud-talent/src/v4/job_service_client.ts index 9288501e967..4cc132a9a1e 100644 --- a/packages/google-cloud-talent/src/v4/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4/job_service_client.ts @@ -305,13 +305,14 @@ export class JobServiceClient { ]; for (const methodName of jobServiceStubMethods) { const callPromise = this.jobServiceStub.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; } @@ -473,11 +474,10 @@ export class JobServiceClient { 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.createJob(request, options, callback); } @@ -562,11 +562,10 @@ export class JobServiceClient { 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.getJob(request, options, callback); } @@ -657,11 +656,10 @@ export class JobServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'job.name': request.job!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'job.name': request.job!.name || '', + }); this.initialize(); return this.innerApiCalls.updateJob(request, options, callback); } @@ -748,11 +746,10 @@ export class JobServiceClient { 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.deleteJob(request, options, callback); } @@ -1053,11 +1050,10 @@ export class JobServiceClient { 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.searchJobs(request, options, callback); } @@ -1363,11 +1359,10 @@ export class JobServiceClient { 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.searchJobsForAlert(request, options, callback); } @@ -1475,11 +1470,10 @@ export class JobServiceClient { 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.batchCreateJobs(request, options, callback); } @@ -1638,11 +1632,10 @@ export class JobServiceClient { 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.batchUpdateJobs(request, options, callback); } @@ -1792,11 +1785,10 @@ export class JobServiceClient { 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.batchDeleteJobs(request, options, callback); } @@ -1951,11 +1943,10 @@ export class JobServiceClient { 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.listJobs(request, options, callback); } @@ -2021,11 +2012,10 @@ export class JobServiceClient { 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.listJobs.createStream( @@ -2102,17 +2092,16 @@ export class JobServiceClient { 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.listJobs.asyncIterate( this.innerApiCalls['listJobs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4/tenant_service_client.ts b/packages/google-cloud-talent/src/v4/tenant_service_client.ts index d964414277f..43f920711e3 100644 --- a/packages/google-cloud-talent/src/v4/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4/tenant_service_client.ts @@ -245,13 +245,14 @@ export class TenantServiceClient { ]; for (const methodName of tenantServiceStubMethods) { const callPromise = this.tenantServiceStub.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; } @@ -407,11 +408,10 @@ export class TenantServiceClient { 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.createTenant(request, options, callback); } @@ -494,11 +494,10 @@ export class TenantServiceClient { 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.getTenant(request, options, callback); } @@ -586,11 +585,10 @@ export class TenantServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tenant.name': request.tenant!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'tenant.name': request.tenant!.name || '', + }); this.initialize(); return this.innerApiCalls.updateTenant(request, options, callback); } @@ -673,11 +671,10 @@ export class TenantServiceClient { 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.deleteTenant(request, options, callback); } @@ -769,11 +766,10 @@ export class TenantServiceClient { 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.listTenants(request, options, callback); } @@ -812,11 +808,10 @@ export class TenantServiceClient { 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.listTenants.createStream( @@ -866,17 +861,16 @@ export class TenantServiceClient { 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.listTenants.asyncIterate( this.innerApiCalls['listTenants'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4beta1/application_service_client.ts b/packages/google-cloud-talent/src/v4beta1/application_service_client.ts index 0eddee5df05..ac0e28daf2e 100644 --- a/packages/google-cloud-talent/src/v4beta1/application_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/application_service_client.ts @@ -255,13 +255,14 @@ export class ApplicationServiceClient { ]; for (const methodName of applicationServiceStubMethods) { const callPromise = this.applicationServiceStub.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 ApplicationServiceClient { 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.createApplication(request, options, callback); } @@ -522,11 +522,10 @@ export class ApplicationServiceClient { 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.getApplication(request, options, callback); } @@ -622,11 +621,10 @@ export class ApplicationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'application.name': request.application!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'application.name': request.application!.name || '', + }); this.initialize(); return this.innerApiCalls.updateApplication(request, options, callback); } @@ -718,11 +716,10 @@ export class ApplicationServiceClient { 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.deleteApplication(request, options, callback); } @@ -823,11 +820,10 @@ export class ApplicationServiceClient { 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.listApplications(request, options, callback); } @@ -867,11 +863,10 @@ export class ApplicationServiceClient { 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.listApplications.createStream( @@ -922,17 +917,16 @@ export class ApplicationServiceClient { 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.listApplications.asyncIterate( this.innerApiCalls['listApplications'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts index 7b46b35202c..5c1880c60eb 100644 --- a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts @@ -257,13 +257,14 @@ export class CompanyServiceClient { ]; for (const methodName of companyServiceStubMethods) { const callPromise = this.companyServiceStub.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; } @@ -428,11 +429,10 @@ export class CompanyServiceClient { 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.createCompany(request, options, callback); } @@ -521,11 +521,10 @@ export class CompanyServiceClient { 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.getCompany(request, options, callback); } @@ -621,11 +620,10 @@ export class CompanyServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'company.name': request.company!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'company.name': request.company!.name || '', + }); this.initialize(); return this.innerApiCalls.updateCompany(request, options, callback); } @@ -721,11 +719,10 @@ export class CompanyServiceClient { 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.deleteCompany(request, options, callback); } @@ -835,11 +832,10 @@ export class CompanyServiceClient { 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.listCompanies(request, options, callback); } @@ -888,11 +884,10 @@ export class CompanyServiceClient { 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.listCompanies.createStream( @@ -952,17 +947,16 @@ export class CompanyServiceClient { 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.listCompanies.asyncIterate( this.innerApiCalls['listCompanies'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4beta1/completion_client.ts b/packages/google-cloud-talent/src/v4beta1/completion_client.ts index 6dcce0ee8ac..fbbcdefeb6f 100644 --- a/packages/google-cloud-talent/src/v4beta1/completion_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/completion_client.ts @@ -231,13 +231,14 @@ export class CompletionClient { const completionStubMethods = ['completeQuery']; for (const methodName of completionStubMethods) { const callPromise = this.completionStub.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; } @@ -431,11 +432,10 @@ export class CompletionClient { 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.completeQuery(request, options, callback); } diff --git a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts index 741bc5a0790..4e18b0c501f 100644 --- a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts @@ -231,13 +231,14 @@ export class EventServiceClient { const eventServiceStubMethods = ['createClientEvent']; for (const methodName of eventServiceStubMethods) { const callPromise = this.eventServiceStub.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; } @@ -409,11 +410,10 @@ export class EventServiceClient { 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.createClientEvent(request, options, callback); } diff --git a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts index c929226341a..e1aa4d85a3e 100644 --- a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts @@ -306,13 +306,14 @@ export class JobServiceClient { ]; for (const methodName of jobServiceStubMethods) { const callPromise = this.jobServiceStub.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; } @@ -477,11 +478,10 @@ export class JobServiceClient { 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.createJob(request, options, callback); } @@ -569,11 +569,10 @@ export class JobServiceClient { 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.getJob(request, options, callback); } @@ -666,11 +665,10 @@ export class JobServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'job.name': request.job!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'job.name': request.job!.name || '', + }); this.initialize(); return this.innerApiCalls.updateJob(request, options, callback); } @@ -762,11 +760,10 @@ export class JobServiceClient { 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.deleteJob(request, options, callback); } @@ -870,11 +867,10 @@ export class JobServiceClient { 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.batchDeleteJobs(request, options, callback); } @@ -1188,11 +1184,10 @@ export class JobServiceClient { 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.searchJobs(request, options, callback); } @@ -1511,11 +1506,10 @@ export class JobServiceClient { 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.searchJobsForAlert(request, options, callback); } @@ -1623,11 +1617,10 @@ export class JobServiceClient { 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.batchCreateJobs(request, options, callback); } @@ -1786,11 +1779,10 @@ export class JobServiceClient { 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.batchUpdateJobs(request, options, callback); } @@ -1948,11 +1940,10 @@ export class JobServiceClient { 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.listJobs(request, options, callback); } @@ -2019,11 +2010,10 @@ export class JobServiceClient { 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.listJobs.createStream( @@ -2101,17 +2091,16 @@ export class JobServiceClient { 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.listJobs.asyncIterate( this.innerApiCalls['listJobs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts b/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts index 895a08a5c3a..28fed84db84 100644 --- a/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts @@ -259,13 +259,14 @@ export class ProfileServiceClient { ]; for (const methodName of profileServiceStubMethods) { const callPromise = this.profileServiceStub.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; } @@ -429,11 +430,10 @@ export class ProfileServiceClient { 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.createProfile(request, options, callback); } @@ -519,11 +519,10 @@ export class ProfileServiceClient { 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.getProfile(request, options, callback); } @@ -615,11 +614,10 @@ export class ProfileServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'profile.name': request.profile!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'profile.name': request.profile!.name || '', + }); this.initialize(); return this.innerApiCalls.updateProfile(request, options, callback); } @@ -713,11 +711,10 @@ export class ProfileServiceClient { 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.deleteProfile(request, options, callback); } @@ -980,11 +977,10 @@ export class ProfileServiceClient { 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.searchProfiles(request, options, callback); } @@ -1113,11 +1109,10 @@ export class ProfileServiceClient { 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.listProfiles(request, options, callback); } @@ -1185,11 +1180,10 @@ export class ProfileServiceClient { 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.listProfiles.createStream( @@ -1268,17 +1262,16 @@ export class ProfileServiceClient { 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.listProfiles.asyncIterate( this.innerApiCalls['listProfiles'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts index d5019b73183..74d0c4e61b8 100644 --- a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts @@ -257,13 +257,14 @@ export class TenantServiceClient { ]; for (const methodName of tenantServiceStubMethods) { const callPromise = this.tenantServiceStub.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; } @@ -427,11 +428,10 @@ export class TenantServiceClient { 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.createTenant(request, options, callback); } @@ -516,11 +516,10 @@ export class TenantServiceClient { 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.getTenant(request, options, callback); } @@ -616,11 +615,10 @@ export class TenantServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'tenant.name': request.tenant!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'tenant.name': request.tenant!.name || '', + }); this.initialize(); return this.innerApiCalls.updateTenant(request, options, callback); } @@ -711,11 +709,10 @@ export class TenantServiceClient { 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.deleteTenant(request, options, callback); } @@ -815,11 +812,10 @@ export class TenantServiceClient { 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.listTenants(request, options, callback); } @@ -858,11 +854,10 @@ export class TenantServiceClient { 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.listTenants.createStream( @@ -912,17 +907,16 @@ export class TenantServiceClient { 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.listTenants.asyncIterate( this.innerApiCalls['listTenants'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-talent/test/gapic_application_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_application_service_v4beta1.ts index acf406852bc..cbc24a51145 100644 --- a/packages/google-cloud-talent/test/gapic_application_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_application_service_v4beta1.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; @@ -133,49 +132,46 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('should create a client with no option', () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient(); + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.applicationServiceStub, undefined); await client.initialize(); assert(client.applicationServiceStub); }); it('has close method', () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); const result = await client.getProjectId(); assert.strictEqual(result, fakeProjectId); @@ -184,12 +180,11 @@ describe('v4beta1.ApplicationServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -208,12 +203,11 @@ describe('v4beta1.ApplicationServiceClient', () => { describe('createApplication', () => { it('invokes createApplication without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.CreateApplicationRequest() @@ -241,12 +235,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes createApplication without error using callback', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.CreateApplicationRequest() @@ -263,9 +256,8 @@ describe('v4beta1.ApplicationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Application() ); - client.innerApiCalls.createApplication = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createApplication = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createApplication( request, @@ -291,12 +283,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes createApplication with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.CreateApplicationRequest() @@ -326,12 +317,11 @@ describe('v4beta1.ApplicationServiceClient', () => { describe('getApplication', () => { it('invokes getApplication without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.GetApplicationRequest() @@ -359,12 +349,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes getApplication without error using callback', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.GetApplicationRequest() @@ -381,9 +370,8 @@ describe('v4beta1.ApplicationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Application() ); - client.innerApiCalls.getApplication = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getApplication = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getApplication( request, @@ -409,12 +397,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes getApplication with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.GetApplicationRequest() @@ -444,12 +431,11 @@ describe('v4beta1.ApplicationServiceClient', () => { describe('updateApplication', () => { it('invokes updateApplication without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.UpdateApplicationRequest() @@ -478,12 +464,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes updateApplication without error using callback', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.UpdateApplicationRequest() @@ -501,9 +486,8 @@ describe('v4beta1.ApplicationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Application() ); - client.innerApiCalls.updateApplication = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateApplication = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateApplication( request, @@ -529,12 +513,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes updateApplication with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.UpdateApplicationRequest() @@ -565,12 +548,11 @@ describe('v4beta1.ApplicationServiceClient', () => { describe('deleteApplication', () => { it('invokes deleteApplication without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.DeleteApplicationRequest() @@ -598,12 +580,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes deleteApplication without error using callback', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.DeleteApplicationRequest() @@ -620,9 +601,8 @@ describe('v4beta1.ApplicationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteApplication = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteApplication = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteApplication( request, @@ -648,12 +628,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes deleteApplication with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.DeleteApplicationRequest() @@ -683,12 +662,11 @@ describe('v4beta1.ApplicationServiceClient', () => { describe('listApplications', () => { it('invokes listApplications without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -724,12 +702,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes listApplications without error using callback', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -754,9 +731,8 @@ describe('v4beta1.ApplicationServiceClient', () => { new protos.google.cloud.talent.v4beta1.Application() ), ]; - client.innerApiCalls.listApplications = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listApplications = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listApplications( request, @@ -782,12 +758,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes listApplications with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -815,12 +790,11 @@ describe('v4beta1.ApplicationServiceClient', () => { }); it('invokes listApplicationsStream without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -838,9 +812,8 @@ describe('v4beta1.ApplicationServiceClient', () => { new protos.google.cloud.talent.v4beta1.Application() ), ]; - client.descriptors.page.listApplications.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listApplications.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listApplicationsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Application[] = []; @@ -865,21 +838,19 @@ describe('v4beta1.ApplicationServiceClient', () => { .calledWith(client.innerApiCalls.listApplications, request) ); assert.strictEqual( - (client.descriptors.page.listApplications - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listApplications.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listApplicationsStream with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -887,10 +858,8 @@ describe('v4beta1.ApplicationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listApplications.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listApplications.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listApplicationsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Application[] = []; @@ -914,21 +883,19 @@ describe('v4beta1.ApplicationServiceClient', () => { .calledWith(client.innerApiCalls.listApplications, request) ); assert.strictEqual( - (client.descriptors.page.listApplications - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listApplications.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listApplications without error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -946,9 +913,8 @@ describe('v4beta1.ApplicationServiceClient', () => { new protos.google.cloud.talent.v4beta1.Application() ), ]; - client.descriptors.page.listApplications.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listApplications.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4beta1.IApplication[] = []; const iterable = client.listApplicationsAsync(request); for await (const resource of iterable) { @@ -956,26 +922,25 @@ describe('v4beta1.ApplicationServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listApplications - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listApplications.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listApplications - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listApplications.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listApplications with error', async () => { - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ListApplicationsRequest() @@ -983,10 +948,8 @@ describe('v4beta1.ApplicationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listApplications.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listApplications.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listApplicationsAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.talent.v4beta1.IApplication[] = []; @@ -995,15 +958,15 @@ describe('v4beta1.ApplicationServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listApplications - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listApplications.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listApplications - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listApplications.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1018,12 +981,11 @@ describe('v4beta1.ApplicationServiceClient', () => { profile: 'profileValue', application: 'applicationValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.applicationPathTemplate.render = sinon .stub() @@ -1095,12 +1057,11 @@ describe('v4beta1.ApplicationServiceClient', () => { tenant: 'tenantValue', profile: 'profileValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.profilePathTemplate.render = sinon .stub() @@ -1160,12 +1121,11 @@ describe('v4beta1.ApplicationServiceClient', () => { project: 'projectValue', company: 'companyValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectCompanyPathTemplate.render = sinon .stub() @@ -1214,12 +1174,11 @@ describe('v4beta1.ApplicationServiceClient', () => { project: 'projectValue', job: 'jobValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectJobPathTemplate.render = sinon .stub() @@ -1266,12 +1225,11 @@ describe('v4beta1.ApplicationServiceClient', () => { tenant: 'tenantValue', company: 'companyValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectTenantCompanyPathTemplate.render = sinon .stub() @@ -1288,21 +1246,24 @@ describe('v4beta1.ApplicationServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1312,21 +1273,24 @@ describe('v4beta1.ApplicationServiceClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1340,12 +1304,11 @@ describe('v4beta1.ApplicationServiceClient', () => { tenant: 'tenantValue', job: 'jobValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.projectTenantJobPathTemplate.render = sinon .stub() @@ -1362,8 +1325,10 @@ describe('v4beta1.ApplicationServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1406,12 +1371,11 @@ describe('v4beta1.ApplicationServiceClient', () => { project: 'projectValue', tenant: 'tenantValue', }; - const client = new applicationserviceModule.v4beta1.ApplicationServiceClient( - { + const client = + new applicationserviceModule.v4beta1.ApplicationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.tenantPathTemplate.render = sinon .stub() diff --git a/packages/google-cloud-talent/test/gapic_company_service_v4.ts b/packages/google-cloud-talent/test/gapic_company_service_v4.ts index 2e03d896615..0efa2387196 100644 --- a/packages/google-cloud-talent/test/gapic_company_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_company_service_v4.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; @@ -249,9 +248,8 @@ describe('v4.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Company() ); - client.innerApiCalls.createCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createCompany( request, @@ -361,9 +359,8 @@ describe('v4.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Company() ); - client.innerApiCalls.getCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getCompany( request, @@ -475,9 +472,8 @@ describe('v4.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Company() ); - client.innerApiCalls.updateCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCompany( request, @@ -588,9 +584,8 @@ describe('v4.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteCompany( request, @@ -704,9 +699,8 @@ describe('v4.CompanyServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Company()), generateSampleMessage(new protos.google.cloud.talent.v4.Company()), ]; - client.innerApiCalls.listCompanies = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listCompanies = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listCompanies( request, @@ -778,9 +772,8 @@ describe('v4.CompanyServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Company()), generateSampleMessage(new protos.google.cloud.talent.v4.Company()), ]; - client.descriptors.page.listCompanies.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listCompaniesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4.Company[] = []; @@ -802,10 +795,9 @@ describe('v4.CompanyServiceClient', () => { .calledWith(client.innerApiCalls.listCompanies, request) ); assert.strictEqual( - (client.descriptors.page.listCompanies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -822,10 +814,8 @@ describe('v4.CompanyServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCompanies.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listCompaniesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4.Company[] = []; @@ -846,10 +836,9 @@ describe('v4.CompanyServiceClient', () => { .calledWith(client.innerApiCalls.listCompanies, request) ); assert.strictEqual( - (client.descriptors.page.listCompanies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -870,9 +859,8 @@ describe('v4.CompanyServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Company()), generateSampleMessage(new protos.google.cloud.talent.v4.Company()), ]; - client.descriptors.page.listCompanies.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4.ICompany[] = []; const iterable = client.listCompaniesAsync(request); for await (const resource of iterable) { @@ -880,15 +868,15 @@ describe('v4.CompanyServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -905,10 +893,8 @@ describe('v4.CompanyServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCompanies.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCompaniesAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.talent.v4.ICompany[] = []; @@ -917,15 +903,15 @@ describe('v4.CompanyServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); diff --git a/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts index 3b899ca2715..5a2e8886780 100644 --- a/packages/google-cloud-talent/test/gapic_company_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_company_service_v4beta1.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; @@ -249,9 +248,8 @@ describe('v4beta1.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Company() ); - client.innerApiCalls.createCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createCompany( request, @@ -361,9 +359,8 @@ describe('v4beta1.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Company() ); - client.innerApiCalls.getCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getCompany( request, @@ -475,9 +472,8 @@ describe('v4beta1.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Company() ); - client.innerApiCalls.updateCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCompany( request, @@ -588,9 +584,8 @@ describe('v4beta1.CompanyServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteCompany = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteCompany = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteCompany( request, @@ -704,9 +699,8 @@ describe('v4beta1.CompanyServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), ]; - client.innerApiCalls.listCompanies = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listCompanies = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listCompanies( request, @@ -778,9 +772,8 @@ describe('v4beta1.CompanyServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), ]; - client.descriptors.page.listCompanies.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listCompaniesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Company[] = []; @@ -805,10 +798,9 @@ describe('v4beta1.CompanyServiceClient', () => { .calledWith(client.innerApiCalls.listCompanies, request) ); assert.strictEqual( - (client.descriptors.page.listCompanies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -825,10 +817,8 @@ describe('v4beta1.CompanyServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCompanies.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listCompanies.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listCompaniesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Company[] = []; @@ -852,10 +842,9 @@ describe('v4beta1.CompanyServiceClient', () => { .calledWith(client.innerApiCalls.listCompanies, request) ); assert.strictEqual( - (client.descriptors.page.listCompanies - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -876,9 +865,8 @@ describe('v4beta1.CompanyServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Company()), ]; - client.descriptors.page.listCompanies.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4beta1.ICompany[] = []; const iterable = client.listCompaniesAsync(request); for await (const resource of iterable) { @@ -886,15 +874,15 @@ describe('v4beta1.CompanyServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -911,10 +899,8 @@ describe('v4beta1.CompanyServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCompanies.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listCompanies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCompaniesAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.talent.v4beta1.ICompany[] = []; @@ -923,15 +909,15 @@ describe('v4beta1.CompanyServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCompanies - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCompanies.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1244,21 +1230,24 @@ describe('v4beta1.CompanyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1268,21 +1257,24 @@ describe('v4beta1.CompanyServiceClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1316,8 +1308,10 @@ describe('v4beta1.CompanyServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); diff --git a/packages/google-cloud-talent/test/gapic_completion_v4.ts b/packages/google-cloud-talent/test/gapic_completion_v4.ts index 3ed1ff395f2..9f52e5b6919 100644 --- a/packages/google-cloud-talent/test/gapic_completion_v4.ts +++ b/packages/google-cloud-talent/test/gapic_completion_v4.ts @@ -26,10 +26,9 @@ import * as completionModule from '../src'; 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; @@ -184,9 +183,8 @@ describe('v4.CompletionClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.CompleteQueryResponse() ); - client.innerApiCalls.completeQuery = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.completeQuery = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.completeQuery( request, diff --git a/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts b/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts index c0e777f74d1..6499cadd4af 100644 --- a/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_completion_v4beta1.ts @@ -26,10 +26,9 @@ import * as completionModule from '../src'; 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; @@ -184,9 +183,8 @@ describe('v4beta1.CompletionClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.CompleteQueryResponse() ); - client.innerApiCalls.completeQuery = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.completeQuery = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.completeQuery( request, @@ -550,21 +548,24 @@ describe('v4beta1.CompletionClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -574,21 +575,24 @@ describe('v4beta1.CompletionClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -622,8 +626,10 @@ describe('v4beta1.CompletionClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); diff --git a/packages/google-cloud-talent/test/gapic_event_service_v4.ts b/packages/google-cloud-talent/test/gapic_event_service_v4.ts index ab1c183c93a..6d9c369e662 100644 --- a/packages/google-cloud-talent/test/gapic_event_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_event_service_v4.ts @@ -26,10 +26,9 @@ import * as eventserviceModule from '../src'; 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; @@ -184,9 +183,8 @@ describe('v4.EventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.ClientEvent() ); - client.innerApiCalls.createClientEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createClientEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createClientEvent( request, diff --git a/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts index 57e8c8e1ade..9f9b55b95a5 100644 --- a/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_event_service_v4beta1.ts @@ -26,10 +26,9 @@ import * as eventserviceModule from '../src'; 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; @@ -186,9 +185,8 @@ describe('v4beta1.EventServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.ClientEvent() ); - client.innerApiCalls.createClientEvent = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createClientEvent = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createClientEvent( request, @@ -552,21 +550,24 @@ describe('v4beta1.EventServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -576,21 +577,24 @@ describe('v4beta1.EventServiceClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -624,8 +628,10 @@ describe('v4beta1.EventServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); diff --git a/packages/google-cloud-talent/test/gapic_job_service_v4.ts b/packages/google-cloud-talent/test/gapic_job_service_v4.ts index 20cea857d95..e519e0b8d52 100644 --- a/packages/google-cloud-talent/test/gapic_job_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_job_service_v4.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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; @@ -279,9 +278,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Job() ); - client.innerApiCalls.createJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createJob( request, @@ -388,9 +386,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Job() ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getJob( request, @@ -499,9 +496,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Job() ); - client.innerApiCalls.updateJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateJob( request, @@ -609,9 +605,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteJob( request, @@ -718,9 +713,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.SearchJobsResponse() ); - client.innerApiCalls.searchJobs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchJobs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchJobs( request, @@ -799,9 +793,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.SearchJobsResponse() ); - client.innerApiCalls.searchJobsForAlert = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCall(expectedResponse); const [response] = await client.searchJobsForAlert(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -832,9 +825,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.SearchJobsResponse() ); - client.innerApiCalls.searchJobsForAlert = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchJobsForAlert( request, @@ -913,9 +905,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateJobs = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchCreateJobs(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -947,9 +938,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateJobs = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchCreateJobs( request, @@ -1109,9 +1099,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchUpdateJobs = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchUpdateJobs(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1143,9 +1132,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchUpdateJobs = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchUpdateJobs( request, @@ -1305,9 +1293,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchDeleteJobs = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchDeleteJobs = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchDeleteJobs(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1339,9 +1326,8 @@ describe('v4.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchDeleteJobs = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchDeleteJobs = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchDeleteJobs( request, @@ -1536,9 +1522,8 @@ describe('v4.JobServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Job()), generateSampleMessage(new protos.google.cloud.talent.v4.Job()), ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listJobs( request, @@ -1607,9 +1592,8 @@ describe('v4.JobServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Job()), generateSampleMessage(new protos.google.cloud.talent.v4.Job()), ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listJobsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4.Job[] = []; @@ -1695,9 +1679,8 @@ describe('v4.JobServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Job()), generateSampleMessage(new protos.google.cloud.talent.v4.Job()), ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4.IJob[] = []; const iterable = client.listJobsAsync(request); for await (const resource of iterable) { diff --git a/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts index 149df3ee89d..49bbef4c2c6 100644 --- a/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_job_service_v4beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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; @@ -279,9 +278,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Job() ); - client.innerApiCalls.createJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createJob( request, @@ -388,9 +386,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Job() ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getJob( request, @@ -499,9 +496,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Job() ); - client.innerApiCalls.updateJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateJob( request, @@ -609,9 +605,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteJob = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteJob = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteJob( request, @@ -718,9 +713,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.batchDeleteJobs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchDeleteJobs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchDeleteJobs( request, @@ -830,9 +824,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.SearchJobsResponse() ); - client.innerApiCalls.searchJobs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchJobs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchJobs( request, @@ -911,9 +904,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.SearchJobsResponse() ); - client.innerApiCalls.searchJobsForAlert = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCall(expectedResponse); const [response] = await client.searchJobsForAlert(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -944,9 +936,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.SearchJobsResponse() ); - client.innerApiCalls.searchJobsForAlert = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchJobsForAlert = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchJobsForAlert( request, @@ -1025,9 +1016,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateJobs = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchCreateJobs(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1059,9 +1049,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchCreateJobs = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchCreateJobs = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchCreateJobs( request, @@ -1221,9 +1210,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchUpdateJobs = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCall(expectedResponse); const [operation] = await client.batchUpdateJobs(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1255,9 +1243,8 @@ describe('v4beta1.JobServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.batchUpdateJobs = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchUpdateJobs = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchUpdateJobs( request, @@ -1452,9 +1439,8 @@ describe('v4beta1.JobServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listJobs( request, @@ -1523,9 +1509,8 @@ describe('v4beta1.JobServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listJobsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Job[] = []; @@ -1617,9 +1602,8 @@ describe('v4beta1.JobServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Job()), ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4beta1.IJob[] = []; const iterable = client.listJobsAsync(request); for await (const resource of iterable) { @@ -1981,21 +1965,24 @@ describe('v4beta1.JobServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2005,21 +1992,24 @@ describe('v4beta1.JobServiceClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2053,8 +2043,10 @@ describe('v4beta1.JobServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); diff --git a/packages/google-cloud-talent/test/gapic_profile_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_profile_service_v4beta1.ts index 606237d618e..db7764edb2e 100644 --- a/packages/google-cloud-talent/test/gapic_profile_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_profile_service_v4beta1.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; @@ -249,9 +248,8 @@ describe('v4beta1.ProfileServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Profile() ); - client.innerApiCalls.createProfile = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createProfile = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createProfile( request, @@ -361,9 +359,8 @@ describe('v4beta1.ProfileServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Profile() ); - client.innerApiCalls.getProfile = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getProfile = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getProfile( request, @@ -475,9 +472,8 @@ describe('v4beta1.ProfileServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Profile() ); - client.innerApiCalls.updateProfile = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateProfile = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateProfile( request, @@ -588,9 +584,8 @@ describe('v4beta1.ProfileServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteProfile = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteProfile = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteProfile( request, @@ -700,9 +695,8 @@ describe('v4beta1.ProfileServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.SearchProfilesResponse() ); - client.innerApiCalls.searchProfiles = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchProfiles = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchProfiles( request, @@ -816,9 +810,8 @@ describe('v4beta1.ProfileServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Profile()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Profile()), ]; - client.innerApiCalls.listProfiles = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listProfiles = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listProfiles( request, @@ -890,9 +883,8 @@ describe('v4beta1.ProfileServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Profile()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Profile()), ]; - client.descriptors.page.listProfiles.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listProfiles.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listProfilesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Profile[] = []; @@ -917,10 +909,9 @@ describe('v4beta1.ProfileServiceClient', () => { .calledWith(client.innerApiCalls.listProfiles, request) ); assert.strictEqual( - (client.descriptors.page.listProfiles - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listProfiles.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -964,10 +955,9 @@ describe('v4beta1.ProfileServiceClient', () => { .calledWith(client.innerApiCalls.listProfiles, request) ); assert.strictEqual( - (client.descriptors.page.listProfiles - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listProfiles.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -988,9 +978,8 @@ describe('v4beta1.ProfileServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Profile()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Profile()), ]; - client.descriptors.page.listProfiles.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listProfiles.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4beta1.IProfile[] = []; const iterable = client.listProfilesAsync(request); for await (const resource of iterable) { @@ -998,15 +987,15 @@ describe('v4beta1.ProfileServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listProfiles - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listProfiles.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listProfiles - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listProfiles.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1023,10 +1012,8 @@ describe('v4beta1.ProfileServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listProfiles.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listProfiles.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listProfilesAsync(request); await assert.rejects(async () => { const responses: protos.google.cloud.talent.v4beta1.IProfile[] = []; @@ -1035,15 +1022,15 @@ describe('v4beta1.ProfileServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listProfiles - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listProfiles.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listProfiles - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listProfiles.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1356,21 +1343,24 @@ describe('v4beta1.ProfileServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1380,21 +1370,24 @@ describe('v4beta1.ProfileServiceClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1428,8 +1421,10 @@ describe('v4beta1.ProfileServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); diff --git a/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts b/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts index 9f0feabc2ef..b4bea0bd47b 100644 --- a/packages/google-cloud-talent/test/gapic_tenant_service_v4.ts +++ b/packages/google-cloud-talent/test/gapic_tenant_service_v4.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('v4.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Tenant() ); - client.innerApiCalls.createTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createTenant( request, @@ -359,9 +357,8 @@ describe('v4.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Tenant() ); - client.innerApiCalls.getTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getTenant( request, @@ -470,9 +467,8 @@ describe('v4.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4.Tenant() ); - client.innerApiCalls.updateTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateTenant( request, @@ -583,9 +579,8 @@ describe('v4.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteTenant( request, @@ -699,9 +694,8 @@ describe('v4.TenantServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), ]; - client.innerApiCalls.listTenants = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listTenants = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listTenants( request, @@ -773,9 +767,8 @@ describe('v4.TenantServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), ]; - client.descriptors.page.listTenants.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listTenants.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listTenantsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4.Tenant[] = []; @@ -863,9 +856,8 @@ describe('v4.TenantServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), generateSampleMessage(new protos.google.cloud.talent.v4.Tenant()), ]; - client.descriptors.page.listTenants.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listTenants.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4.ITenant[] = []; const iterable = client.listTenantsAsync(request); for await (const resource of iterable) { diff --git a/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts b/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts index 3ad13507c87..ca3bbb60ad1 100644 --- a/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.ts +++ b/packages/google-cloud-talent/test/gapic_tenant_service_v4beta1.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; @@ -249,9 +248,8 @@ describe('v4beta1.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Tenant() ); - client.innerApiCalls.createTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createTenant( request, @@ -361,9 +359,8 @@ describe('v4beta1.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Tenant() ); - client.innerApiCalls.getTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getTenant( request, @@ -472,9 +469,8 @@ describe('v4beta1.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.talent.v4beta1.Tenant() ); - client.innerApiCalls.updateTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateTenant( request, @@ -585,9 +581,8 @@ describe('v4beta1.TenantServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteTenant = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteTenant = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteTenant( request, @@ -701,9 +696,8 @@ describe('v4beta1.TenantServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), ]; - client.innerApiCalls.listTenants = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listTenants = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listTenants( request, @@ -775,9 +769,8 @@ describe('v4beta1.TenantServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), ]; - client.descriptors.page.listTenants.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listTenants.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listTenantsStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.google.cloud.talent.v4beta1.Tenant[] = []; @@ -871,9 +864,8 @@ describe('v4beta1.TenantServiceClient', () => { generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), generateSampleMessage(new protos.google.cloud.talent.v4beta1.Tenant()), ]; - client.descriptors.page.listTenants.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listTenants.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.google.cloud.talent.v4beta1.ITenant[] = []; const iterable = client.listTenantsAsync(request); for await (const resource of iterable) { @@ -1239,21 +1231,24 @@ describe('v4beta1.TenantServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromProjectTenantCompanyName', () => { - const result = client.matchProjectFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchProjectFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1263,21 +1258,24 @@ describe('v4beta1.TenantServiceClient', () => { const result = client.matchTenantFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'tenantValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCompanyFromProjectTenantCompanyName', () => { - const result = client.matchCompanyFromProjectTenantCompanyName( - fakePath - ); + const result = + client.matchCompanyFromProjectTenantCompanyName(fakePath); assert.strictEqual(result, 'companyValue'); assert( - (client.pathTemplates.projectTenantCompanyPathTemplate - .match as SinonStub) + ( + client.pathTemplates.projectTenantCompanyPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1311,8 +1309,10 @@ describe('v4beta1.TenantServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectTenantJobPathTemplate - .render as SinonStub) + ( + client.pathTemplates.projectTenantJobPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) );