Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable auto-pagination for SearchJobsForAlert method in talent API #446

Merged
merged 6 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add SearchJobs here?

Copy link
Contributor Author

@xiaozhenliu-gg5 xiaozhenliu-gg5 Apr 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! I think we have searchJobs at L112 :)

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