From 346a02a01c199e9da88277dafba8869f179daa64 Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Thu, 16 May 2024 01:38:37 -0600 Subject: [PATCH] Change the type of ids to be Long (#1113) Co-authored-by: Clayton Walker --- .../java/org/gitlab4j/api/PipelineApi.java | 31 +++++++++++++++++++ .../java/org/gitlab4j/api/models/Bridge.java | 6 ++-- .../api/models/DownstreamPipeline.java | 6 ++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gitlab4j/api/PipelineApi.java b/src/main/java/org/gitlab4j/api/PipelineApi.java index 5d296c4d..434062de 100644 --- a/src/main/java/org/gitlab4j/api/PipelineApi.java +++ b/src/main/java/org/gitlab4j/api/PipelineApi.java @@ -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; @@ -858,6 +859,35 @@ public Stream getPipelineVariablesStream(Object projectIdOrPath, Long return (getPipelineVariables(projectIdOrPath, pipelineId, getDefaultPerPage()).stream()); } + /** + * Get a List of bridges in a pipeline. + * + *
GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/bridges 
+ * + * @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 getBridgesForPipeline(Object projectIdOrPath, long pipelineId) throws GitLabApiException { + return (getBridgesForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage(), null).all()); + } + + /** + * Get a List of bridges in a pipeline. + * + *
GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/bridges 
+ * + * @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 getBridgesForPipeline(Object projectIdOrPath, long pipelineId, JobScope scope) throws GitLabApiException { + return (getBridgesForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage(), scope).all()); + } + /** * Get a Pager of bridges in a pipeline. * @@ -866,6 +896,7 @@ public Stream 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 */ diff --git a/src/main/java/org/gitlab4j/api/models/Bridge.java b/src/main/java/org/gitlab4j/api/models/Bridge.java index 5ea56e03..a0737789 100644 --- a/src/main/java/org/gitlab4j/api/models/Bridge.java +++ b/src/main/java/org/gitlab4j/api/models/Bridge.java @@ -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; @@ -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; } diff --git a/src/main/java/org/gitlab4j/api/models/DownstreamPipeline.java b/src/main/java/org/gitlab4j/api/models/DownstreamPipeline.java index 6e458414..79366b79 100644 --- a/src/main/java/org/gitlab4j/api/models/DownstreamPipeline.java +++ b/src/main/java/org/gitlab4j/api/models/DownstreamPipeline.java @@ -8,7 +8,7 @@ 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; @@ -16,11 +16,11 @@ public class DownstreamPipeline implements Serializable { 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; }