Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Commit 9954466

Browse files
authored
Merge pull request #50 from spotify/pr/add-params
feat: add `page` & `per_page` to PullRequestParameters
2 parents 688b886 + b92c294 commit 9954466

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/main/java/com/spotify/github/v3/prs/requests/PullRequestParameters.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,16 @@ public interface PullRequestParameters extends Parameters {
5858
*/
5959
Optional<String> direction();
6060

61+
/**
62+
* Results per page (max 100)
63+
*/
64+
@SuppressWarnings("checkstyle:methodname")
65+
Optional<Integer> per_page();
66+
67+
/**
68+
* Page number of the results to fetch.
69+
*/
70+
Optional<Integer> page();
71+
6172
/** Serialize declared non-Object methods as key=value joined by & */
6273
}

src/test/java/com/spotify/github/v3/prs/requests/PullRequestParametersTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ public void testFullSerialize() {
3636
.head("bogus-head")
3737
.sort("bogus-sort")
3838
.state("bogus-state")
39+
.page(2)
40+
.per_page(5)
3941
.build();
4042

4143
assertThat(
4244
params.serialize(),
4345
is(
44-
"base=bogus-base&direction=bogus-direction&head=bogus-head&sort=bogus-sort&state=bogus-state"));
46+
"base=bogus-base&direction=bogus-direction&head=bogus-head&page=2" +
47+
"&per_page=5&sort=bogus-sort&state=bogus-state"));
4548
}
4649
}

0 commit comments

Comments
 (0)