Skip to content

Commit

Permalink
fix: disable auto-pagination for SearchJobsForAlert method in talen…
Browse files Browse the repository at this point in the history
…t API (#446)

* disable auto-pagination for one more method in talent API

* lint

* feedback
  • Loading branch information
xiaozhenliu-gg5 authored Apr 27, 2020
1 parent a746a62 commit 7e55bba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 6 additions & 4 deletions typescript/src/schema/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
12 changes: 9 additions & 3 deletions typescript/test/unit/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand Down Expand Up @@ -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'
);
});
Expand Down

0 comments on commit 7e55bba

Please sign in to comment.