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

add request reviewers as attribute of GHPullRequest #464

Merged
merged 1 commit into from
Nov 6, 2018
Merged
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
9 changes: 9 additions & 0 deletions src/main/java/org/kohsuke/github/GHPullRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class GHPullRequest extends GHIssue {
private int changed_files;
private String merge_commit_sha;

// pull request reviewers
private GHUser[] requested_reviewers;

/**
* GitHub doesn't return some properties of {@link GHIssue} when requesting the GET on the 'pulls' API
* route as opposed to 'issues' API route. This flag remembers whether we made the GET call on the 'issues' route
Expand All @@ -76,6 +79,7 @@ GHPullRequest wrapUp(GitHub root) {
if (base != null) base.wrapUp(root);
if (head != null) head.wrapUp(root);
if (merged_by != null) merged_by.wrapUp(root);
if (requested_reviewers != null) GHUser.wrap(requested_reviewers, root);
return this;
}

Expand Down Expand Up @@ -219,6 +223,11 @@ public String getMergeCommitSha() throws IOException {
return merge_commit_sha;
}

public GHUser[] getRequestedReviewers() throws IOException {
populate();
return requested_reviewers;
}

/**
* Fully populate the data by retrieving missing data.
*
Expand Down