Skip to content

Commit

Permalink
Change the type of ids to be Long (#1113)
Browse files Browse the repository at this point in the history
Co-authored-by: Clayton Walker <[email protected]>
  • Loading branch information
Sineaggi and Clayton Walker authored May 16, 2024
1 parent c5dbbd2 commit 346a02a
Show file tree
Hide file tree
Showing 3 changed files with 37 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 @@ -10,6 +10,7 @@
import javax.ws.rs.core.Response;

import org.gitlab4j.api.models.Bridge;
import org.gitlab4j.api.models.Job;
import org.gitlab4j.api.models.Pipeline;
import org.gitlab4j.api.models.PipelineFilter;
import org.gitlab4j.api.models.PipelineSchedule;
Expand Down Expand Up @@ -858,6 +859,35 @@ public Stream<Variable> getPipelineVariablesStream(Object projectIdOrPath, Long
return (getPipelineVariables(projectIdOrPath, pipelineId, getDefaultPerPage()).stream());
}

/**
* Get a List 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
* @return a list containing the bridges for the specified project ID and pipeline ID
* @throws GitLabApiException if any exception occurs during execution
*/
public List<Bridge> getBridgesForPipeline(Object projectIdOrPath, long pipelineId) throws GitLabApiException {
return (getBridgesForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage(), null).all());
}

/**
* Get a List 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 scope the scope of the jobs to list
* @return a list containing the bridges for the specified project ID and pipeline ID
* @throws GitLabApiException if any exception occurs during execution
*/
public List<Bridge> getBridgesForPipeline(Object projectIdOrPath, long pipelineId, JobScope scope) throws GitLabApiException {
return (getBridgesForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage(), scope).all());
}

/**
* Get a Pager of bridges in a pipeline.
*
Expand All @@ -866,6 +896,7 @@ public Stream<Variable> getPipelineVariablesStream(Object projectIdOrPath, Long
* @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
* @param scope the scope of the jobs to list
* @return a list containing the bridges for the specified project ID and pipeline ID
* @throws GitLabApiException if any exception occurs during execution
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/gitlab4j/api/models/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Bridge implements Serializable {
private Date erasedAt;
private Double duration;
private Double queuedDuration;
private int id;
private Long id;
private String name;
private String coverage;
private Pipeline pipeline;
Expand Down Expand Up @@ -92,11 +92,11 @@ public void setQueuedDuration(Double queuedDuration) {
this.queuedDuration = queuedDuration;
}

public int getId() {
public Long getId() {
return id;
}

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

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/gitlab4j/api/models/DownstreamPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
public class DownstreamPipeline implements Serializable {
private static final long serialVersionUID = 1L;

private int id;
private Long id;
private String sha;
private String ref;
private String status;
private Date createdAt;
private Date updatedAt;
private String webUrl;

public int getId() {
public Long getId() {
return id;
}

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

Expand Down

0 comments on commit 346a02a

Please sign in to comment.