Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Sep 19, 2024
2 parents db1a758 + ec740d4 commit 1785fb3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/main/java/org/gitlab4j/api/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,29 @@ public String toString() {
}
}

/** Enum to use for specifying the source when calling getPipelines(). */
public enum PipelineSource {

PUSH, WEB, TRIGGER, SCHEDULE, API, EXTERNAL, PIPELINE, CHAT, WEBIDE, MERGE_REQUEST_EVENT, EXTERNAL_PULL_REQUEST_EVENT;

private static JacksonJsonEnumHelper<PipelineSource> enumHelper = new JacksonJsonEnumHelper<>(PipelineSource.class);

@JsonCreator
public static PipelineSource 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 scope when calling getJobs(). */
public enum JobScope {

Expand Down Expand Up @@ -1098,4 +1121,3 @@ public String toString() {
}
}
}

14 changes: 14 additions & 0 deletions src/main/java/org/gitlab4j/api/models/PipelineFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.gitlab4j.api.Constants.PipelineOrderBy;
import org.gitlab4j.api.Constants.PipelineScope;
import org.gitlab4j.api.Constants.PipelineSource;
import org.gitlab4j.api.Constants.SortOrder;
import org.gitlab4j.api.GitLabApiForm;
import org.gitlab4j.api.utils.JacksonJson;
Expand All @@ -22,6 +23,9 @@ public class PipelineFilter implements Serializable {
/** {@link org.gitlab4j.api.Constants.PipelineScope} The status of pipelines, one of: running, pending, success, failed, canceled, skipped, created */
private PipelineStatus status;

/** {@link org.gitlab4j.api.Constants.PipelineSource} The source of pipelines */
private PipelineSource source;

/** The ref of pipelines. */
private String ref;

Expand Down Expand Up @@ -62,6 +66,10 @@ public void setStatus(PipelineStatus status) {
this.status = status;
}

public void setSource(PipelineSource source) {
this.source = source;
}

public void setRef(String ref) {
this.ref = ref;
}
Expand Down Expand Up @@ -108,6 +116,11 @@ public PipelineFilter withStatus(PipelineStatus status) {
return this;
}

public PipelineFilter withSource(PipelineSource source) {
this.source = source;
return this;
}

public PipelineFilter withRef(String ref) {
this.ref = ref;
return this;
Expand Down Expand Up @@ -158,6 +171,7 @@ public GitLabApiForm getQueryParams() {
return (new GitLabApiForm()
.withParam("scope", scope)
.withParam("status", status)
.withParam("source", source)
.withParam("ref", ref)
.withParam("sha", sha)
.withParam("yaml_errors", yamlErrors)
Expand Down

0 comments on commit 1785fb3

Please sign in to comment.