Skip to content

Commit 63ee878

Browse files
committed
Merge remote-tracking branch 'github-api/master' into task/cache-error-test
2 parents 3479e4f + b9c8bf0 commit 63ee878

127 files changed

Lines changed: 34980 additions & 169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/org/kohsuke/github/GHApp.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ GHApp wrapUp(GitHub root) {
180180
public PagedIterable<GHAppInstallation> listInstallations() {
181181
return root.createRequest()
182182
.withPreview(MACHINE_MAN)
183-
.asPagedIterable("/app/installations", GHAppInstallation[].class, item -> item.wrapUp(root));
183+
.withUrlPath("/app/installations")
184+
.toIterable(GHAppInstallation[].class, item -> item.wrapUp(root));
184185
}
185186

186187
/**

src/main/java/org/kohsuke/github/GHCommit.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,9 @@ private GHUser resolveUser(User author) throws IOException {
442442
*/
443443
public PagedIterable<GHCommitComment> listComments() {
444444
return owner.root.createRequest()
445-
.asPagedIterable(
446-
String.format("/repos/%s/%s/commits/%s/comments", owner.getOwnerName(), owner.getName(), sha),
447-
GHCommitComment[].class,
448-
item -> item.wrap(owner));
445+
.withUrlPath(
446+
String.format("/repos/%s/%s/commits/%s/comments", owner.getOwnerName(), owner.getName(), sha))
447+
.toIterable(GHCommitComment[].class, item -> item.wrap(owner));
449448
}
450449

451450
/**

src/main/java/org/kohsuke/github/GHCommitComment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
138138
public PagedIterable<GHReaction> listReactions() {
139139
return owner.root.createRequest()
140140
.withPreview(SQUIRREL_GIRL)
141-
.asPagedIterable(getApiTail() + "/reactions", GHReaction[].class, item -> item.wrap(owner.root));
141+
.withUrlPath(getApiTail() + "/reactions")
142+
.toIterable(GHReaction[].class, item -> item.wrap(owner.root));
142143
}
143144

144145
/**

src/main/java/org/kohsuke/github/GHCommitQueryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ public GHCommitQueryBuilder until(long timestamp) {
127127
* @return the paged iterable
128128
*/
129129
public PagedIterable<GHCommit> list() {
130-
return req.asPagedIterable(repo.getApiTailUrl("commits"), GHCommit[].class, item -> item.wrapUp(repo));
130+
return req.withUrlPath(repo.getApiTailUrl("commits")).toIterable(GHCommit[].class, item -> item.wrapUp(repo));
131131
}
132132
}

src/main/java/org/kohsuke/github/GHContent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ public PagedIterable<GHContent> listDirectoryContent() throws IOException {
237237
if (!isDirectory())
238238
throw new IllegalStateException(path + " is not a directory");
239239

240-
return root.createRequest()
241-
.setRawUrlPath(url)
242-
.asPagedIterable(GHContent[].class, item -> item.wrap(repository));
240+
return root.createRequest().setRawUrlPath(url).toIterable(GHContent[].class, item -> item.wrap(repository));
243241
}
244242

245243
/**

src/main/java/org/kohsuke/github/GHDeployment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public GHDeploymentStatusBuilder createStatus(GHDeploymentState state) {
131131
* @return the paged iterable
132132
*/
133133
public PagedIterable<GHDeploymentStatus> listStatuses() {
134-
return root.createRequest().asPagedIterable(statuses_url, GHDeploymentStatus[].class, item -> item.wrap(owner));
134+
return root.createRequest()
135+
.withUrlPath(statuses_url)
136+
.toIterable(GHDeploymentStatus[].class, item -> item.wrap(owner));
135137
}
136138

137139
}

src/main/java/org/kohsuke/github/GHGist.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ public GHGist fork() throws IOException {
223223
* @return the paged iterable
224224
*/
225225
public PagedIterable<GHGist> listForks() {
226-
return root.createRequest().asPagedIterable(getApiTailUrl("forks"), GHGist[].class, item -> item.wrapUp(root));
226+
return root.createRequest()
227+
.withUrlPath(getApiTailUrl("forks"))
228+
.toIterable(GHGist[].class, item -> item.wrapUp(root));
227229
}
228230

229231
/**

src/main/java/org/kohsuke/github/GHIssue.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,8 @@ public List<GHIssueComment> getComments() throws IOException {
446446
*/
447447
public PagedIterable<GHIssueComment> listComments() throws IOException {
448448
return root.createRequest()
449-
.asPagedIterable(getIssuesApiRoute() + "/comments",
450-
GHIssueComment[].class,
451-
item -> item.wrapUp(GHIssue.this));
449+
.withUrlPath(getIssuesApiRoute() + "/comments")
450+
.toIterable(GHIssueComment[].class, item -> item.wrapUp(this));
452451
}
453452

454453
@Preview
@@ -468,7 +467,8 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
468467
public PagedIterable<GHReaction> listReactions() {
469468
return owner.root.createRequest()
470469
.withPreview(SQUIRREL_GIRL)
471-
.asPagedIterable(getApiRoute() + "/reactions", GHReaction[].class, item -> item.wrap(owner.root));
470+
.withUrlPath(getApiRoute() + "/reactions")
471+
.toIterable(GHReaction[].class, item -> item.wrap(owner.root));
472472
}
473473

474474
/**
@@ -716,8 +716,7 @@ protected static List<String> getLogins(Collection<GHUser> users) {
716716
*/
717717
public PagedIterable<GHIssueEvent> listEvents() throws IOException {
718718
return root.createRequest()
719-
.asPagedIterable(owner.getApiTailUrl(String.format("/issues/%s/events", number)),
720-
GHIssueEvent[].class,
721-
item -> item.wrapUp(GHIssue.this));
719+
.withUrlPath(owner.getApiTailUrl(String.format("/issues/%s/events", number)))
720+
.toIterable(GHIssueEvent[].class, item -> item.wrapUp(this));
722721
}
723722
}

src/main/java/org/kohsuke/github/GHIssueComment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
143143
public PagedIterable<GHReaction> listReactions() {
144144
return owner.root.createRequest()
145145
.withPreview(SQUIRREL_GIRL)
146-
.asPagedIterable(getApiRoute() + "/reactions", GHReaction[].class, item -> item.wrap(owner.root));
146+
.withUrlPath(getApiRoute() + "/reactions")
147+
.toIterable(GHReaction[].class, item -> item.wrap(owner.root));
147148
}
148149

149150
private String getApiRoute() {

src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ public enum Sort {
6464
* on error
6565
*/
6666
public PagedIterable<GHMarketplaceAccountPlan> createRequest() throws IOException {
67-
return builder.asPagedIterable(String.format("/marketplace_listing/plans/%d/accounts", this.planId),
68-
GHMarketplaceAccountPlan[].class,
69-
item -> item.wrapUp(root));
67+
return builder.withUrlPath(String.format("/marketplace_listing/plans/%d/accounts", this.planId))
68+
.toIterable(GHMarketplaceAccountPlan[].class, item -> item.wrapUp(root));
7069
}
7170

7271
}

0 commit comments

Comments
 (0)