Skip to content

Commit 1105f47

Browse files
authored
Merge branch 'main' into heek-feature-gitlab4j-1049-not-filter
2 parents 7d83541 + f7441c7 commit 1105f47

16 files changed

+433
-6
lines changed

src/main/java/org/gitlab4j/api/PipelineApi.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import javax.ws.rs.core.GenericType;
1010
import javax.ws.rs.core.Response;
1111

12+
import org.gitlab4j.api.models.Bridge;
1213
import org.gitlab4j.api.models.Pipeline;
1314
import org.gitlab4j.api.models.PipelineFilter;
1415
import org.gitlab4j.api.models.PipelineSchedule;
@@ -856,4 +857,34 @@ public Pager<Variable> getPipelineVariables(Object projectIdOrPath, Long pipelin
856857
public Stream<Variable> getPipelineVariablesStream(Object projectIdOrPath, Long pipelineId) throws GitLabApiException {
857858
return (getPipelineVariables(projectIdOrPath, pipelineId, getDefaultPerPage()).stream());
858859
}
860+
861+
/**
862+
* Get a Pager of bridges in a pipeline.
863+
*
864+
* <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/bridges </code></pre>
865+
*
866+
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the pipelines for
867+
* @param pipelineId the pipeline ID to get the list of bridges for
868+
* @param itemsPerPage the number of Bridge instances that will be fetched per page
869+
* @return a list containing the bridges for the specified project ID and pipeline ID
870+
* @throws GitLabApiException if any exception occurs during execution
871+
*/
872+
public Pager<Bridge> getBridgesForPipeline(Object projectIdOrPath, long pipelineId, int itemsPerPage, JobScope scope) throws GitLabApiException {
873+
return (new Pager<>(this, Bridge.class, itemsPerPage, getDefaultPerPageParam(),
874+
"projects", getProjectIdOrPath(projectIdOrPath), "pipelines", pipelineId, "bridges", scope));
875+
}
876+
877+
/**
878+
* Get a Stream of bridges in a pipeline.
879+
* <pre><code>GitLab Endpoint: GET /projects/:id/pipelines/:pipeline_id/bridges</code></pre>
880+
*
881+
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
882+
* @param pipelineId the pipeline ID to get the list of bridges for
883+
* @return a Stream containing the bridges for the specified project ID
884+
* @throws GitLabApiException if any exception occurs during execution
885+
*/
886+
public Stream<Bridge> getBridgesStream(Object projectIdOrPath, long pipelineId, JobScope scope) throws GitLabApiException {
887+
return (getBridgesForPipeline(projectIdOrPath, pipelineId, getDefaultPerPage(), scope).stream());
888+
}
889+
859890
}

src/main/java/org/gitlab4j/api/models/ApprovedBy.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
package org.gitlab4j.api.models;
33

4+
import org.gitlab4j.api.utils.JacksonJson;
5+
46
import com.fasterxml.jackson.annotation.JsonIgnore;
57

68
/**
@@ -48,4 +50,9 @@ public void setGroup(Group group) {
4850
public Object getApprovedBy() {
4951
return (user != null ? user : group);
5052
}
53+
54+
@Override
55+
public String toString() {
56+
return (JacksonJson.toJsonString(this));
57+
}
5158
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11

22
package org.gitlab4j.api.models;
33

4+
import org.gitlab4j.api.utils.JacksonJson;
5+
46
public class Assignee extends AbstractUser<Assignee> {
7+
8+
@Override
9+
public String toString() {
10+
return (JacksonJson.toJsonString(this));
11+
}
512
}
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
package org.gitlab4j.api.models;
2+
3+
import org.gitlab4j.api.utils.JacksonJson;
4+
5+
import java.util.Date;
6+
7+
public class Bridge {
8+
private Commit commit;
9+
private boolean allowFailure;
10+
private Date createdAt;
11+
private Date startedAt;
12+
private Date finishedAt;
13+
private Date erasedAt;
14+
private Double duration;
15+
private Double queuedDuration;
16+
private int id;
17+
private String name;
18+
private String coverage;
19+
private Pipeline pipeline;
20+
private String ref;
21+
private String stage;
22+
private String status;
23+
private boolean tag;
24+
private String webUrl;
25+
private User user;
26+
private DownstreamPipeline downstreamPipeline;
27+
28+
public Commit getCommit() {
29+
return commit;
30+
}
31+
32+
public void setCommit(Commit commit) {
33+
this.commit = commit;
34+
}
35+
36+
public boolean isAllowFailure() {
37+
return allowFailure;
38+
}
39+
40+
public void setAllowFailure(boolean allowFailure) {
41+
this.allowFailure = allowFailure;
42+
}
43+
44+
public Date getCreatedAt() {
45+
return createdAt;
46+
}
47+
48+
public void setCreatedAt(Date createdAt) {
49+
this.createdAt = createdAt;
50+
}
51+
52+
public Date getStartedAt() {
53+
return startedAt;
54+
}
55+
56+
public void setStartedAt(Date startedAt) {
57+
this.startedAt = startedAt;
58+
}
59+
60+
public Date getFinishedAt() {
61+
return finishedAt;
62+
}
63+
64+
public void setFinishedAt(Date finishedAt) {
65+
this.finishedAt = finishedAt;
66+
}
67+
68+
public Date getErasedAt() {
69+
return erasedAt;
70+
}
71+
72+
public void setErasedAt(Date erasedAt) {
73+
this.erasedAt = erasedAt;
74+
}
75+
76+
public Double getDuration() {
77+
return duration;
78+
}
79+
80+
public void setDuration(Double duration) {
81+
this.duration = duration;
82+
}
83+
84+
public Double getQueuedDuration() {
85+
return queuedDuration;
86+
}
87+
88+
public void setQueuedDuration(Double queuedDuration) {
89+
this.queuedDuration = queuedDuration;
90+
}
91+
92+
public int getId() {
93+
return id;
94+
}
95+
96+
public void setId(int id) {
97+
this.id = id;
98+
}
99+
100+
public String getName() {
101+
return name;
102+
}
103+
104+
public void setName(String name) {
105+
this.name = name;
106+
}
107+
108+
public String getCoverage() {
109+
return coverage;
110+
}
111+
112+
public void setCoverage(String coverage) {
113+
this.coverage = coverage;
114+
}
115+
116+
public Pipeline getPipeline() {
117+
return pipeline;
118+
}
119+
120+
public void setPipeline(Pipeline pipeline) {
121+
this.pipeline = pipeline;
122+
}
123+
124+
public String getRef() {
125+
return ref;
126+
}
127+
128+
public void setRef(String ref) {
129+
this.ref = ref;
130+
}
131+
132+
public String getStage() {
133+
return stage;
134+
}
135+
136+
public void setStage(String stage) {
137+
this.stage = stage;
138+
}
139+
140+
public String getStatus() {
141+
return status;
142+
}
143+
144+
public void setStatus(String status) {
145+
this.status = status;
146+
}
147+
148+
public boolean isTag() {
149+
return tag;
150+
}
151+
152+
public void setTag(boolean tag) {
153+
this.tag = tag;
154+
}
155+
156+
public String getWebUrl() {
157+
return webUrl;
158+
}
159+
160+
public void setWebUrl(String webUrl) {
161+
this.webUrl = webUrl;
162+
}
163+
164+
public User getUser() {
165+
return user;
166+
}
167+
168+
public void setUser(User user) {
169+
this.user = user;
170+
}
171+
172+
public DownstreamPipeline getDownstreamPipeline() {
173+
return downstreamPipeline;
174+
}
175+
176+
public void setDownstreamPipeline(DownstreamPipeline downstreamPipeline) {
177+
this.downstreamPipeline = downstreamPipeline;
178+
}
179+
180+
@Override
181+
public String toString() {
182+
return (JacksonJson.toJsonString(this));
183+
}
184+
185+
}

src/main/java/org/gitlab4j/api/models/DiffRef.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.gitlab4j.api.models;
22

3+
import org.gitlab4j.api.utils.JacksonJson;
4+
35
public class DiffRef {
46
private String baseSha;
57
private String headSha;
@@ -31,4 +33,9 @@ public String getStartSha() {
3133
public void setStartSha(final String startSha) {
3234
this.startSha = startSha;
3335
}
36+
37+
@Override
38+
public String toString() {
39+
return (JacksonJson.toJsonString(this));
40+
}
3441
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package org.gitlab4j.api.models;
2+
3+
import org.gitlab4j.api.utils.JacksonJson;
4+
5+
import java.util.Date;
6+
7+
public class DownstreamPipeline {
8+
private int id;
9+
private String sha;
10+
private String ref;
11+
private String status;
12+
private Date createdAt;
13+
private Date updatedAt;
14+
private String webUrl;
15+
16+
public int getId() {
17+
return id;
18+
}
19+
20+
public void setId(int id) {
21+
this.id = id;
22+
}
23+
24+
public String getSha() {
25+
return sha;
26+
}
27+
28+
public void setSha(String sha) {
29+
this.sha = sha;
30+
}
31+
32+
public String getRef() {
33+
return ref;
34+
}
35+
36+
public void setRef(String ref) {
37+
this.ref = ref;
38+
}
39+
40+
public String getStatus() {
41+
return status;
42+
}
43+
44+
public void setStatus(String status) {
45+
this.status = status;
46+
}
47+
48+
public Date getCreatedAt() {
49+
return createdAt;
50+
}
51+
52+
public void setCreatedAt(Date createdAt) {
53+
this.createdAt = createdAt;
54+
}
55+
56+
public Date getUpdatedAt() {
57+
return updatedAt;
58+
}
59+
60+
public void setUpdatedAt(Date updatedAt) {
61+
this.updatedAt = updatedAt;
62+
}
63+
64+
public String getWebUrl() {
65+
return webUrl;
66+
}
67+
68+
public void setWebUrl(String webUrl) {
69+
this.webUrl = webUrl;
70+
}
71+
72+
@Override
73+
public String toString() {
74+
return (JacksonJson.toJsonString(this));
75+
}
76+
}

src/main/java/org/gitlab4j/api/models/GroupFilter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import org.gitlab4j.api.Constants.GroupOrderBy;
66
import org.gitlab4j.api.Constants.SortOrder;
7+
import org.gitlab4j.api.utils.JacksonJson;
78
import org.gitlab4j.api.GitLabApiForm;
89

910
/**
@@ -160,4 +161,9 @@ public GitLabApiForm getQueryParams() {
160161
.withParam("top_level_only", topLevelOnly)
161162
);
162163
}
164+
165+
@Override
166+
public String toString() {
167+
return (JacksonJson.toJsonString(this));
168+
}
163169
}

src/main/java/org/gitlab4j/api/models/GroupProjectsFilter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.gitlab4j.api.Constants.ProjectOrderBy;
44
import org.gitlab4j.api.Constants.SortOrder;
5+
import org.gitlab4j.api.utils.JacksonJson;
56
import org.gitlab4j.api.GitLabApiForm;
67

78
/**
@@ -189,4 +190,9 @@ public GitLabApiForm getQueryParams() {
189190
.withParam("include_subgroups", includeSubGroups)
190191
);
191192
}
193+
194+
@Override
195+
public String toString() {
196+
return (JacksonJson.toJsonString(this));
197+
}
192198
}

0 commit comments

Comments
 (0)