Merge "Add ability to modify workInProgress to PostReview"
This commit is contained in:
@@ -74,6 +74,18 @@ public class ReviewInput {
|
||||
/** Reviewers that should be added to this change. */
|
||||
public List<AddReviewerInput> reviewers;
|
||||
|
||||
/**
|
||||
* If true mark the change as work in progress. It is an error for both {@link #workInProgress}
|
||||
* and {@link #ready} to be true.
|
||||
*/
|
||||
public boolean workInProgress;
|
||||
|
||||
/**
|
||||
* If true mark the change as ready for review. It is an error for both {@link #workInProgress}
|
||||
* and {@link #ready} to be true.
|
||||
*/
|
||||
public boolean ready;
|
||||
|
||||
public enum DraftHandling {
|
||||
/** Delete pending drafts on this revision only. */
|
||||
DELETE,
|
||||
@@ -141,6 +153,18 @@ public class ReviewInput {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReviewInput setWorkInProgress(boolean workInProgress) {
|
||||
this.workInProgress = workInProgress;
|
||||
ready = !workInProgress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReviewInput setReady(boolean ready) {
|
||||
this.ready = ready;
|
||||
workInProgress = !ready;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static ReviewInput recommend() {
|
||||
return new ReviewInput().label("Code-Review", 1);
|
||||
}
|
||||
|
||||
@@ -30,4 +30,7 @@ public class ReviewResult {
|
||||
* additions were requested.
|
||||
*/
|
||||
@Nullable public Map<String, AddReviewerResult> reviewers;
|
||||
|
||||
/** Error message for non-200 responses. */
|
||||
@Nullable public String error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user