diff --git a/packages/grafeas/protos/protos.d.ts b/packages/grafeas/protos/protos.d.ts index 97d7c82d239..8bf5b670285 100644 --- a/packages/grafeas/protos/protos.d.ts +++ b/packages/grafeas/protos/protos.d.ts @@ -1612,7 +1612,7 @@ export namespace grafeas { public repoId?: (grafeas.v1.IRepoId|null); /** CloudRepoSourceContext revisionId. */ - public revisionId: string; + public revisionId?: (string|null); /** CloudRepoSourceContext aliasContext. */ public aliasContext?: (grafeas.v1.IAliasContext|null); @@ -1723,7 +1723,7 @@ export namespace grafeas { public gerritProject: string; /** GerritSourceContext revisionId. */ - public revisionId: string; + public revisionId?: (string|null); /** GerritSourceContext aliasContext. */ public aliasContext?: (grafeas.v1.IAliasContext|null); @@ -1921,7 +1921,7 @@ export namespace grafeas { public projectRepoId?: (grafeas.v1.IProjectRepoId|null); /** RepoId uid. */ - public uid: string; + public uid?: (string|null); /** RepoId id. */ public id?: ("projectRepoId"|"uid"); @@ -11372,19 +11372,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/grafeas/protos/protos.js b/packages/grafeas/protos/protos.js index 6e4528e6297..d2f1b2a33b3 100644 --- a/packages/grafeas/protos/protos.js +++ b/packages/grafeas/protos/protos.js @@ -4050,11 +4050,11 @@ /** * CloudRepoSourceContext revisionId. - * @member {string} revisionId + * @member {string|null|undefined} revisionId * @memberof grafeas.v1.CloudRepoSourceContext * @instance */ - CloudRepoSourceContext.prototype.revisionId = ""; + CloudRepoSourceContext.prototype.revisionId = null; /** * CloudRepoSourceContext aliasContext. @@ -4326,11 +4326,11 @@ /** * GerritSourceContext revisionId. - * @member {string} revisionId + * @member {string|null|undefined} revisionId * @memberof grafeas.v1.GerritSourceContext * @instance */ - GerritSourceContext.prototype.revisionId = ""; + GerritSourceContext.prototype.revisionId = null; /** * GerritSourceContext aliasContext. @@ -4811,11 +4811,11 @@ /** * RepoId uid. - * @member {string} uid + * @member {string|null|undefined} uid * @memberof grafeas.v1.RepoId * @instance */ - RepoId.prototype.uid = ""; + RepoId.prototype.uid = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -29381,43 +29381,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/grafeas/src/v1/grafeas_client.ts b/packages/grafeas/src/v1/grafeas_client.ts index 7c2b2c7e4e9..b7101f1e16d 100644 --- a/packages/grafeas/src/v1/grafeas_client.ts +++ b/packages/grafeas/src/v1/grafeas_client.ts @@ -272,13 +272,14 @@ export class GrafeasClient { ]; for (const methodName of grafeasStubMethods) { const callPromise = this.grafeasStub.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 GrafeasClient { 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.getOccurrence(request, options, callback); } @@ -514,11 +514,10 @@ export class GrafeasClient { 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.deleteOccurrence(request, options, callback); } @@ -601,11 +600,10 @@ export class GrafeasClient { 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.createOccurrence(request, options, callback); } @@ -688,11 +686,10 @@ export class GrafeasClient { 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.batchCreateOccurrences( request, @@ -781,11 +778,10 @@ export class GrafeasClient { 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.updateOccurrence(request, options, callback); } @@ -867,11 +863,10 @@ export class GrafeasClient { 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.getOccurrenceNote(request, options, callback); } @@ -952,11 +947,10 @@ export class GrafeasClient { 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.getNote(request, options, callback); } @@ -1037,11 +1031,10 @@ export class GrafeasClient { 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.deleteNote(request, options, callback); } @@ -1126,11 +1119,10 @@ export class GrafeasClient { 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.createNote(request, options, callback); } @@ -1213,11 +1205,10 @@ export class GrafeasClient { 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.batchCreateNotes(request, options, callback); } @@ -1302,11 +1293,10 @@ export class GrafeasClient { 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.updateNote(request, options, callback); } @@ -1398,11 +1388,10 @@ export class GrafeasClient { 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.listOccurrences(request, options, callback); } @@ -1441,11 +1430,10 @@ export class GrafeasClient { 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.listOccurrences.createStream( @@ -1495,17 +1483,16 @@ export class GrafeasClient { 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.listOccurrences.asyncIterate( this.innerApiCalls['listOccurrences'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1596,11 +1583,10 @@ export class GrafeasClient { 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.listNotes(request, options, callback); } @@ -1639,11 +1625,10 @@ export class GrafeasClient { 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.listNotes.createStream( @@ -1693,17 +1678,16 @@ export class GrafeasClient { 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.listNotes.asyncIterate( this.innerApiCalls['listNotes'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1795,11 +1779,10 @@ export class GrafeasClient { 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.listNoteOccurrences(request, options, callback); } @@ -1837,11 +1820,10 @@ export class GrafeasClient { 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 || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNoteOccurrences.createStream( @@ -1890,17 +1872,16 @@ export class GrafeasClient { 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 || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listNoteOccurrences.asyncIterate( this.innerApiCalls['listNoteOccurrences'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/grafeas/test/gapic_grafeas_v1.ts b/packages/grafeas/test/gapic_grafeas_v1.ts index 1621dd41457..4031a10dc06 100644 --- a/packages/grafeas/test/gapic_grafeas_v1.ts +++ b/packages/grafeas/test/gapic_grafeas_v1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -247,9 +246,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Occurrence() ); - client.innerApiCalls.getOccurrence = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getOccurrence = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getOccurrence( request, @@ -359,9 +357,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteOccurrence = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteOccurrence = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteOccurrence( request, @@ -471,9 +468,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Occurrence() ); - client.innerApiCalls.createOccurrence = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createOccurrence = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createOccurrence( request, @@ -552,9 +548,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.BatchCreateOccurrencesResponse() ); - client.innerApiCalls.batchCreateOccurrences = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.batchCreateOccurrences = + stubSimpleCall(expectedResponse); const [response] = await client.batchCreateOccurrences(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -585,9 +580,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.BatchCreateOccurrencesResponse() ); - client.innerApiCalls.batchCreateOccurrences = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchCreateOccurrences = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchCreateOccurrences( request, @@ -700,9 +694,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Occurrence() ); - client.innerApiCalls.updateOccurrence = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateOccurrence = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateOccurrence( request, @@ -812,9 +805,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Note() ); - client.innerApiCalls.getOccurrenceNote = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getOccurrenceNote = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getOccurrenceNote( request, @@ -921,9 +913,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Note() ); - client.innerApiCalls.getNote = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getNote = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getNote( request, @@ -1027,9 +1018,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteNote = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteNote = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteNote( request, @@ -1139,9 +1129,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Note() ); - client.innerApiCalls.createNote = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createNote = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createNote( request, @@ -1248,9 +1237,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.BatchCreateNotesResponse() ); - client.innerApiCalls.batchCreateNotes = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchCreateNotes = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchCreateNotes( request, @@ -1360,9 +1348,8 @@ describe('v1.GrafeasClient', () => { const expectedResponse = generateSampleMessage( new protos.grafeas.v1.Note() ); - client.innerApiCalls.updateNote = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateNote = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateNote( request, @@ -1473,9 +1460,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.innerApiCalls.listOccurrences = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listOccurrences = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listOccurrences( request, @@ -1547,9 +1533,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.descriptors.page.listOccurrences.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listOccurrences.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listOccurrencesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.grafeas.v1.Occurrence[] = []; @@ -1571,10 +1556,9 @@ describe('v1.GrafeasClient', () => { .calledWith(client.innerApiCalls.listOccurrences, request) ); assert.strictEqual( - (client.descriptors.page.listOccurrences - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listOccurrences.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1591,10 +1575,8 @@ describe('v1.GrafeasClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listOccurrences.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listOccurrences.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listOccurrencesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.grafeas.v1.Occurrence[] = []; @@ -1615,10 +1597,9 @@ describe('v1.GrafeasClient', () => { .calledWith(client.innerApiCalls.listOccurrences, request) ); assert.strictEqual( - (client.descriptors.page.listOccurrences - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listOccurrences.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1639,9 +1620,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.descriptors.page.listOccurrences.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listOccurrences.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.grafeas.v1.IOccurrence[] = []; const iterable = client.listOccurrencesAsync(request); for await (const resource of iterable) { @@ -1649,15 +1629,15 @@ describe('v1.GrafeasClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listOccurrences - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listOccurrences.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listOccurrences - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listOccurrences.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1674,10 +1654,8 @@ describe('v1.GrafeasClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listOccurrences.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listOccurrences.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listOccurrencesAsync(request); await assert.rejects(async () => { const responses: protos.grafeas.v1.IOccurrence[] = []; @@ -1686,15 +1664,15 @@ describe('v1.GrafeasClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listOccurrences - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listOccurrences.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listOccurrences - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listOccurrences.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1757,9 +1735,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Note()), generateSampleMessage(new protos.grafeas.v1.Note()), ]; - client.innerApiCalls.listNotes = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNotes = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNotes( request, @@ -1825,9 +1802,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Note()), generateSampleMessage(new protos.grafeas.v1.Note()), ]; - client.descriptors.page.listNotes.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listNotes.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listNotesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.grafeas.v1.Note[] = []; @@ -1913,9 +1889,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Note()), generateSampleMessage(new protos.grafeas.v1.Note()), ]; - client.descriptors.page.listNotes.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listNotes.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.grafeas.v1.INote[] = []; const iterable = client.listNotesAsync(request); for await (const resource of iterable) { @@ -1994,9 +1969,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.innerApiCalls.listNoteOccurrences = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listNoteOccurrences = + stubSimpleCall(expectedResponse); const [response] = await client.listNoteOccurrences(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -2029,9 +2003,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.innerApiCalls.listNoteOccurrences = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listNoteOccurrences = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listNoteOccurrences( request, @@ -2103,9 +2076,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.descriptors.page.listNoteOccurrences.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listNoteOccurrences.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listNoteOccurrencesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.grafeas.v1.Occurrence[] = []; @@ -2127,10 +2099,9 @@ describe('v1.GrafeasClient', () => { .calledWith(client.innerApiCalls.listNoteOccurrences, request) ); assert.strictEqual( - (client.descriptors.page.listNoteOccurrences - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNoteOccurrences.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2147,10 +2118,8 @@ describe('v1.GrafeasClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listNoteOccurrences.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listNoteOccurrences.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listNoteOccurrencesStream(request); const promise = new Promise((resolve, reject) => { const responses: protos.grafeas.v1.Occurrence[] = []; @@ -2171,10 +2140,9 @@ describe('v1.GrafeasClient', () => { .calledWith(client.innerApiCalls.listNoteOccurrences, request) ); assert.strictEqual( - (client.descriptors.page.listNoteOccurrences - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNoteOccurrences.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2195,9 +2163,8 @@ describe('v1.GrafeasClient', () => { generateSampleMessage(new protos.grafeas.v1.Occurrence()), generateSampleMessage(new protos.grafeas.v1.Occurrence()), ]; - client.descriptors.page.listNoteOccurrences.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + client.descriptors.page.listNoteOccurrences.asyncIterate = + stubAsyncIterationCall(expectedResponse); const responses: protos.grafeas.v1.IOccurrence[] = []; const iterable = client.listNoteOccurrencesAsync(request); for await (const resource of iterable) { @@ -2205,15 +2172,15 @@ describe('v1.GrafeasClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listNoteOccurrences - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNoteOccurrences - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2230,10 +2197,8 @@ describe('v1.GrafeasClient', () => { request.name = ''; const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listNoteOccurrences.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listNoteOccurrences.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listNoteOccurrencesAsync(request); await assert.rejects(async () => { const responses: protos.grafeas.v1.IOccurrence[] = []; @@ -2242,15 +2207,15 @@ describe('v1.GrafeasClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listNoteOccurrences - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listNoteOccurrences - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listNoteOccurrences.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); });