forked from gitlab4j/gitlab4j-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildEvent.java
More file actions
261 lines (200 loc) · 5.86 KB
/
BuildEvent.java
File metadata and controls
261 lines (200 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
package org.gitlab4j.api.webhook;
import java.util.Date;
import org.gitlab4j.api.models.Runner;
import org.gitlab4j.models.utils.JacksonJson;
/**
* The documentation at: <a href="https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#job-events">
* Job Events</a> is incorrect, this class represents the actual content of the Job Hook event.
*/
public class BuildEvent extends AbstractEvent {
private static final long serialVersionUID = 1L;
public static final String JOB_HOOK_X_GITLAB_EVENT = "Job Hook";
public static final String OBJECT_KIND = "build";
private String ref;
private Boolean tag;
private String beforeSha;
private String sha;
private Integer retriesCount;
private Long buildId;
private String buildName;
private String buildStage;
private String buildStatus;
private Date buildCreatedAt;
private Date buildStartedAt;
private Date buildFinishedAt;
private Float buildDuration;
private Float buildQueuedDuration;
private Boolean buildAllowFailure;
private String buildFailureReason;
private Long projectId;
private Long pipelineId;
private String projectName;
private EventUser user;
private BuildCommit commit;
private EventRepository repository;
private EventProject project;
private Runner runner;
private EventEnvironment environment;
@Override
public String getObjectKind() {
return (OBJECT_KIND);
}
public void setObjectKind(String objectKind) {
if (!OBJECT_KIND.equals(objectKind))
throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'");
}
public String getRef() {
return ref;
}
public void setRef(String ref) {
this.ref = ref;
}
public Boolean getTag() {
return tag;
}
public void setTag(Boolean tag) {
this.tag = tag;
}
public String getBeforeSha() {
return beforeSha;
}
public void setBeforeSha(String beforeSha) {
this.beforeSha = beforeSha;
}
public String getSha() {
return sha;
}
public void setSha(String sha) {
this.sha = sha;
}
public Integer getRetriesCount() {
return retriesCount;
}
public void setRetriesCount(Integer retriesCount) {
this.retriesCount = retriesCount;
}
public Long getBuildId() {
return buildId;
}
public void setBuildId(Long buildId) {
this.buildId = buildId;
}
public String getBuildName() {
return buildName;
}
public void setBuildName(String buildName) {
this.buildName = buildName;
}
public String getBuildStage() {
return buildStage;
}
public void setBuildStage(String buildStage) {
this.buildStage = buildStage;
}
public String getBuildStatus() {
return buildStatus;
}
public void setBuildStatus(String buildStatus) {
this.buildStatus = buildStatus;
}
public Date getBuildCreatedAt() {
return buildCreatedAt;
}
public void setBuildCreatedAt(Date buildCreatedAt) {
this.buildCreatedAt = buildCreatedAt;
}
public Date getBuildStartedAt() {
return buildStartedAt;
}
public void setBuildStartedAt(Date buildStartedAt) {
this.buildStartedAt = buildStartedAt;
}
public Date getBuildFinishedAt() {
return buildFinishedAt;
}
public void setBuildFinishedAt(Date buildFinishedAt) {
this.buildFinishedAt = buildFinishedAt;
}
public Float getBuildDuration() {
return buildDuration;
}
public void setBuildDuration(Float buildDuration) {
this.buildDuration = buildDuration;
}
public Float getBuildQueuedDuration() {
return buildQueuedDuration;
}
public void setBuildQueuedDuration(Float buildQueuedDuration) {
this.buildQueuedDuration = buildQueuedDuration;
}
public Boolean getBuildAllowFailure() {
return buildAllowFailure;
}
public void setBuildAllowFailure(Boolean buildAllowFailure) {
this.buildAllowFailure = buildAllowFailure;
}
public String getBuildFailureReason() {
return buildFailureReason;
}
public void setBuildFailureReason(String buildFailureReason) {
this.buildFailureReason = buildFailureReason;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public Long getPipelineId() {
return pipelineId;
}
public void setPipelineId(Long pipelineId) {
this.pipelineId = pipelineId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public EventUser getUser() {
return user;
}
public void setUser(EventUser user) {
this.user = user;
}
public BuildCommit getCommit() {
return commit;
}
public void setCommit(BuildCommit commit) {
this.commit = commit;
}
public EventRepository getRepository() {
return repository;
}
public void setRepository(EventRepository repository) {
this.repository = repository;
}
public EventProject getProject() {
return project;
}
public void setProject(EventProject project) {
this.project = project;
}
public Runner getRunner() {
return runner;
}
public void setRunner(Runner runner) {
this.runner = runner;
}
public EventEnvironment getEnvironment() {
return environment;
}
public void setEnvironment(EventEnvironment environment) {
this.environment = environment;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}