Commit 8ff38545 authored by burt's avatar burt Committed by Greg Messner
Browse files

Added MergeRequestFilter.in and MergeRequestFilter.wip (#446)

parent 065c94bf
...@@ -350,6 +350,27 @@ public interface Constants { ...@@ -350,6 +350,27 @@ public interface Constants {
} }
} }
/** Enum to use for specifying the scope of the search attribute when calling getMergeRequests(). */
public enum MergeRequestSearchIn {
TITLE, DESCRIPTION;
private static JacksonJsonEnumHelper<MergeRequestSearchIn> enumHelper = new JacksonJsonEnumHelper<>(MergeRequestSearchIn.class);
@JsonCreator
public static MergeRequestSearchIn forValue(String value) { return enumHelper.forValue(value); }
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
/** Enum to use for specifying the state of a merge request or issue update. */ /** Enum to use for specifying the state of a merge request or issue update. */
public enum StateEvent { public enum StateEvent {
......
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import org.gitlab4j.api.Constants; import org.gitlab4j.api.Constants;
import org.gitlab4j.api.Constants.MergeRequestOrderBy; import org.gitlab4j.api.Constants.MergeRequestOrderBy;
import org.gitlab4j.api.Constants.MergeRequestScope; import org.gitlab4j.api.Constants.MergeRequestScope;
import org.gitlab4j.api.Constants.MergeRequestSearchIn;
import org.gitlab4j.api.Constants.MergeRequestState; import org.gitlab4j.api.Constants.MergeRequestState;
import org.gitlab4j.api.Constants.SortOrder; import org.gitlab4j.api.Constants.SortOrder;
import org.gitlab4j.api.GitLabApiForm; import org.gitlab4j.api.GitLabApiForm;
...@@ -36,6 +37,8 @@ public class MergeRequestFilter { ...@@ -36,6 +37,8 @@ public class MergeRequestFilter {
private String sourceBranch; private String sourceBranch;
private String targetBranch; private String targetBranch;
private String search; private String search;
private MergeRequestSearchIn in;
private Boolean wip;
public Integer getProjectId() { public Integer getProjectId() {
return projectId; return projectId;
...@@ -284,6 +287,32 @@ public class MergeRequestFilter { ...@@ -284,6 +287,32 @@ public class MergeRequestFilter {
return (this); return (this);
} }
public MergeRequestSearchIn getIn() {
return in;
}
public void setIn(MergeRequestSearchIn in) {
this.in = in;
}
public MergeRequestFilter withIn(MergeRequestSearchIn in) {
this.in = in;
return (this);
}
public Boolean getWip() {
return wip;
}
public void setWip(Boolean wip) {
this.wip = wip;
}
public MergeRequestFilter withWip(Boolean wip) {
this.wip = wip;
return (this);
}
@JsonIgnore @JsonIgnore
public GitLabApiForm getQueryParams(int page, int perPage) { public GitLabApiForm getQueryParams(int page, int perPage) {
return (getQueryParams() return (getQueryParams()
...@@ -291,7 +320,7 @@ public class MergeRequestFilter { ...@@ -291,7 +320,7 @@ public class MergeRequestFilter {
.withParam(Constants.PER_PAGE_PARAM, perPage)); .withParam(Constants.PER_PAGE_PARAM, perPage));
} }
@JsonIgnore @JsonIgnore
public GitLabApiForm getQueryParams() { public GitLabApiForm getQueryParams() {
return (new GitLabApiForm() return (new GitLabApiForm()
.withParam("iids", iids) .withParam("iids", iids)
...@@ -310,6 +339,8 @@ public class MergeRequestFilter { ...@@ -310,6 +339,8 @@ public class MergeRequestFilter {
.withParam("my_reaction_emoji", myReactionEmoji) .withParam("my_reaction_emoji", myReactionEmoji)
.withParam("source_branch", sourceBranch) .withParam("source_branch", sourceBranch)
.withParam("target_branch", targetBranch) .withParam("target_branch", targetBranch)
.withParam("search", search)); .withParam("search", search)
.withParam("in", in)
.withParam("wip", (wip == null ? null : wip ? "yes" : "no")));
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment