Skip to content

Commit

Permalink
Merge branch 'main' into heek-feature-gitlab4j-1049-not-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
KoCoder authored Dec 14, 2023
2 parents 7d83541 + f7441c7 commit 1105f47
Show file tree
Hide file tree
Showing 16 changed files with 433 additions and 6 deletions.
31 changes: 31 additions & 0 deletions src/main/java/org/gitlab4j/api/PipelineApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;

import org.gitlab4j.api.models.Bridge;
import org.gitlab4j.api.models.Pipeline;
import org.gitlab4j.api.models.PipelineFilter;
import org.gitlab4j.api.models.PipelineSchedule;
Expand Down Expand Up @@ -856,4 +857,34 @@ public Pager<Variable> getPipelineVariables(Object projectIdOrPath, Long pipelin
public Stream<Variable> getPipelineVariablesStream(Object projectIdOrPath, Long pipelineId) throws GitLabApiException {
return (getPipelineVariables(projectIdOrPath, pipelineId, getDefaultPerPage()).stream());
}

/**
* Get a Pager of bridges in a pipeline.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/bridges </code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
* @param pipelineId the pipeline ID to get the list of bridges for
* @param itemsPerPage the number of Bridge instances that will be fetched per page
* @return a list containing the bridges for the specified project ID and pipeline ID
* @throws GitLabApiException if any exception occurs during execution
*/
public Pager<Bridge> getBridgesForPipeline(Object projectIdOrPath, long pipelineId, int itemsPerPage, JobScope scope) throws GitLabApiException {
return (new Pager<>(this, Bridge.class, itemsPerPage, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "bridges", scope));
}

/**
* Get a Stream of bridges in a pipeline.
* <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/bridges</code></pre>
*
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
* @param pipelineId the pipeline ID to get the list of bridges for
* @return a Stream containing the bridges for the specified project ID
* @throws GitLabApiException if any exception occurs during execution
*/
public Stream<Bridge> getBridgesStream(Object projectIdOrPath, long pipelineId, JobScope scope) throws GitLabApiException {
return (getBridgesForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage(), scope).stream());
}

}
7 changes: 7 additions & 0 deletions src/main/java/org/gitlab4j/api/models/ApprovedBy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

package org.gitlab4j.api.models;

import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
Expand Down Expand Up @@ -48,4 +50,9 @@ public void setGroup(Group group) {
public Object getApprovedBy() {
return (user != null ? user : group);
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
7 changes: 7 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Assignee.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

package org.gitlab4j.api.models;

import org.gitlab4j.api.utils.JacksonJson;

public class Assignee extends AbstractUser<Assignee> {

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
185 changes: 185 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Bridge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
package org.gitlab4j.api.models;

import org.gitlab4j.api.utils.JacksonJson;

import java.util.Date;

public class Bridge {
private Commit commit;
private boolean allowFailure;
private Date createdAt;
private Date startedAt;
private Date finishedAt;
private Date erasedAt;
private Double duration;
private Double queuedDuration;
private int id;
private String name;
private String coverage;
private Pipeline pipeline;
private String ref;
private String stage;
private String status;
private boolean tag;
private String webUrl;
private User user;
private DownstreamPipeline downstreamPipeline;

public Commit getCommit() {
return commit;
}

public void setCommit(Commit commit) {
this.commit = commit;
}

public boolean isAllowFailure() {
return allowFailure;
}

public void setAllowFailure(boolean allowFailure) {
this.allowFailure = allowFailure;
}

public Date getCreatedAt() {
return createdAt;
}

public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

public Date getStartedAt() {
return startedAt;
}

public void setStartedAt(Date startedAt) {
this.startedAt = startedAt;
}

public Date getFinishedAt() {
return finishedAt;
}

public void setFinishedAt(Date finishedAt) {
this.finishedAt = finishedAt;
}

public Date getErasedAt() {
return erasedAt;
}

public void setErasedAt(Date erasedAt) {
this.erasedAt = erasedAt;
}

public Double getDuration() {
return duration;
}

public void setDuration(Double duration) {
this.duration = duration;
}

public Double getQueuedDuration() {
return queuedDuration;
}

public void setQueuedDuration(Double queuedDuration) {
this.queuedDuration = queuedDuration;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getCoverage() {
return coverage;
}

public void setCoverage(String coverage) {
this.coverage = coverage;
}

public Pipeline getPipeline() {
return pipeline;
}

public void setPipeline(Pipeline pipeline) {
this.pipeline = pipeline;
}

public String getRef() {
return ref;
}

public void setRef(String ref) {
this.ref = ref;
}

public String getStage() {
return stage;
}

public void setStage(String stage) {
this.stage = stage;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public boolean isTag() {
return tag;
}

public void setTag(boolean tag) {
this.tag = tag;
}

public String getWebUrl() {
return webUrl;
}

public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public DownstreamPipeline getDownstreamPipeline() {
return downstreamPipeline;
}

public void setDownstreamPipeline(DownstreamPipeline downstreamPipeline) {
this.downstreamPipeline = downstreamPipeline;
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}

}
7 changes: 7 additions & 0 deletions src/main/java/org/gitlab4j/api/models/DiffRef.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.gitlab4j.api.models;

import org.gitlab4j.api.utils.JacksonJson;

public class DiffRef {
private String baseSha;
private String headSha;
Expand Down Expand Up @@ -31,4 +33,9 @@ public String getStartSha() {
public void setStartSha(final String startSha) {
this.startSha = startSha;
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
76 changes: 76 additions & 0 deletions src/main/java/org/gitlab4j/api/models/DownstreamPipeline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package org.gitlab4j.api.models;

import org.gitlab4j.api.utils.JacksonJson;

import java.util.Date;

public class DownstreamPipeline {
private int id;
private String sha;
private String ref;
private String status;
private Date createdAt;
private Date updatedAt;
private String webUrl;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getSha() {
return sha;
}

public void setSha(String sha) {
this.sha = sha;
}

public String getRef() {
return ref;
}

public void setRef(String ref) {
this.ref = ref;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public Date getCreatedAt() {
return createdAt;
}

public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

public Date getUpdatedAt() {
return updatedAt;
}

public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}

public String getWebUrl() {
return webUrl;
}

public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
6 changes: 6 additions & 0 deletions src/main/java/org/gitlab4j/api/models/GroupFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.gitlab4j.api.Constants.GroupOrderBy;
import org.gitlab4j.api.Constants.SortOrder;
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.GitLabApiForm;

/**
Expand Down Expand Up @@ -160,4 +161,9 @@ public GitLabApiForm getQueryParams() {
.withParam("top_level_only", topLevelOnly)
);
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.gitlab4j.api.Constants.ProjectOrderBy;
import org.gitlab4j.api.Constants.SortOrder;
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.GitLabApiForm;

/**
Expand Down Expand Up @@ -189,4 +190,9 @@ public GitLabApiForm getQueryParams() {
.withParam("include_subgroups", includeSubGroups)
);
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
Loading

0 comments on commit 1105f47

Please sign in to comment.