diff --git a/typescript/src/schema/proto.ts b/typescript/src/schema/proto.ts index ddbad3b10..0e49056f4 100644 --- a/typescript/src/schema/proto.ts +++ b/typescript/src/schema/proto.ts @@ -164,11 +164,13 @@ function pagingField( // next version. // // This should not be done for any other API. - const serviceName = + const serviceNameException = service && service.packageName === 'google.cloud.talent.v4beta1'; - const methodName = - method.name === 'SearchProfiles' || method.name === 'SearchJobs'; - if (serviceName && methodName) { + const methodNameException = + method.name === 'SearchProfiles' || + method.name === 'SearchJobs' || + method.name === 'SearchJobsForAlert'; + if (serviceNameException && methodNameException) { return undefined; } diff --git a/typescript/test/unit/proto.ts b/typescript/test/unit/proto.ts index 010b4c1cf..a79048308 100644 --- a/typescript/test/unit/proto.ts +++ b/typescript/test/unit/proto.ts @@ -113,10 +113,12 @@ describe('src/schema/proto.ts', () => { fd.service[0].method[1] = new plugin.google.protobuf.MethodDescriptorProto(); fd.service[0].method[1].name = 'SearchProfiles'; fd.service[0].method[2] = new plugin.google.protobuf.MethodDescriptorProto(); - fd.service[0].method[2].name = 'ListJobs'; - fd.service[0].method[2].outputType = + fd.service[0].method[2].name = 'SearchJobsForAlert'; + fd.service[0].method[3] = new plugin.google.protobuf.MethodDescriptorProto(); + fd.service[0].method[3].name = 'ListJobs'; + fd.service[0].method[3].outputType = '.google.cloud.talent.v4beta1.ListJobsOutput'; - fd.service[0].method[2].inputType = + fd.service[0].method[3].inputType = '.google.cloud.talent.v4beta1.ListJobsInput'; fd.messageType = [new plugin.google.protobuf.DescriptorProto()]; @@ -169,6 +171,10 @@ describe('src/schema/proto.ts', () => { ); assert.deepStrictEqual( proto.services['service'].method[2].pagingFieldName, + undefined + ); + assert.deepStrictEqual( + proto.services['service'].method[3].pagingFieldName, 'next_page_token' ); });