Skip to content

Commit b5b00e3

Browse files
authored
Added missing attributes for webhook events (#1240)
1 parent 7e8795e commit b5b00e3

17 files changed

+814
-17
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
package org.gitlab4j.api.models;
2+
3+
import java.util.Date;
4+
5+
import org.gitlab4j.models.utils.JacksonJson;
6+
7+
/**
8+
* @author Yaris van Thiel
9+
*/
10+
public class Build {
11+
12+
private Long id;
13+
private String stage;
14+
private String name;
15+
private BuildStatus status;
16+
private Date createdAt;
17+
private Date startedAt;
18+
private Date finishedAt;
19+
private Float duration;
20+
private Float queuedDuration;
21+
private String failureReason;
22+
private String when;
23+
private Boolean manual;
24+
private Boolean allowFailure;
25+
private User user;
26+
private Runner runner;
27+
private ArtifactsFile artifactsFile;
28+
29+
public Long getId() {
30+
return id;
31+
}
32+
33+
public void setId(Long id) {
34+
this.id = id;
35+
}
36+
37+
public String getStage() {
38+
return stage;
39+
}
40+
41+
public void setStage(String stage) {
42+
this.stage = stage;
43+
}
44+
45+
public String getName() {
46+
return name;
47+
}
48+
49+
public void setName(String name) {
50+
this.name = name;
51+
}
52+
53+
public BuildStatus getStatus() {
54+
return status;
55+
}
56+
57+
public void setStatus(BuildStatus status) {
58+
this.status = status;
59+
}
60+
61+
public Date getCreatedAt() {
62+
return createdAt;
63+
}
64+
65+
public void setCreatedAt(Date createdAt) {
66+
this.createdAt = createdAt;
67+
}
68+
69+
public Date getStartedAt() {
70+
return startedAt;
71+
}
72+
73+
public void setStartedAt(Date startedAt) {
74+
this.startedAt = startedAt;
75+
}
76+
77+
public Date getFinishedAt() {
78+
return finishedAt;
79+
}
80+
81+
public void setFinishedAt(Date finishedAt) {
82+
this.finishedAt = finishedAt;
83+
}
84+
85+
public Float getDuration() {
86+
return duration;
87+
}
88+
89+
public void setDuration(Float duration) {
90+
this.duration = duration;
91+
}
92+
93+
public Float getQueuedDuration() {
94+
return queuedDuration;
95+
}
96+
97+
public void setQueuedDuration(Float queuedDuration) {
98+
this.queuedDuration = queuedDuration;
99+
}
100+
101+
public String getFailureReason() {
102+
return failureReason;
103+
}
104+
105+
public void setFailureReason(String failureReason) {
106+
this.failureReason = failureReason;
107+
}
108+
109+
public String getWhen() {
110+
return when;
111+
}
112+
113+
public void setWhen(String when) {
114+
this.when = when;
115+
}
116+
117+
public Boolean getManual() {
118+
return manual;
119+
}
120+
121+
public void setManual(Boolean manual) {
122+
this.manual = manual;
123+
}
124+
125+
public Boolean getAllowFailure() {
126+
return allowFailure;
127+
}
128+
129+
public void setAllowFailure(Boolean allowFailure) {
130+
this.allowFailure = allowFailure;
131+
}
132+
133+
public User getUser() {
134+
return user;
135+
}
136+
137+
public void setUser(User user) {
138+
this.user = user;
139+
}
140+
141+
public Runner getRunner() {
142+
return runner;
143+
}
144+
145+
public void setRunner(Runner runner) {
146+
this.runner = runner;
147+
}
148+
149+
public ArtifactsFile getArtifactsFile() {
150+
return artifactsFile;
151+
}
152+
153+
public void setArtifactsFile(ArtifactsFile artifactsFile) {
154+
this.artifactsFile = artifactsFile;
155+
}
156+
157+
@Override
158+
public String toString() {
159+
return (JacksonJson.toJsonString(this));
160+
}
161+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2017 Greg Messner <[email protected]>
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
* this software and associated documentation files (the "Software"), to deal in
8+
* the Software without restriction, including without limitation the rights to
9+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10+
* the Software, and to permit persons to whom the Software is furnished to do so,
11+
* subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
23+
24+
package org.gitlab4j.api.models;
25+
26+
import org.gitlab4j.models.utils.JacksonJsonEnumHelper;
27+
28+
import com.fasterxml.jackson.annotation.JsonCreator;
29+
import com.fasterxml.jackson.annotation.JsonValue;
30+
31+
/**
32+
* Enum for the various Build status values.
33+
*/
34+
public enum BuildStatus {
35+
CREATED,
36+
RUNNING,
37+
PENDING,
38+
SUCCESS,
39+
FAILED,
40+
CANCELED,
41+
SKIPPED,
42+
MANUAL;
43+
44+
private static JacksonJsonEnumHelper<BuildStatus> enumHelper = new JacksonJsonEnumHelper<>(BuildStatus.class);
45+
46+
@JsonCreator
47+
public static BuildStatus forValue(String value) {
48+
return enumHelper.forValue(value);
49+
}
50+
51+
@JsonValue
52+
public String toValue() {
53+
return (enumHelper.toString(this));
54+
}
55+
56+
@Override
57+
public String toString() {
58+
return (enumHelper.toString(this));
59+
}
60+
}

gitlab4j-models/src/main/java/org/gitlab4j/api/models/Runner.java

+19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.gitlab4j.api.models;
22

33
import java.io.Serializable;
4+
import java.util.List;
45

56
import org.gitlab4j.models.utils.JacksonJson;
67
import org.gitlab4j.models.utils.JacksonJsonEnumHelper;
@@ -13,8 +14,10 @@ public class Runner implements Serializable {
1314

1415
private Long id;
1516
private String description;
17+
private RunnerType runnerType;
1618
private Boolean active;
1719
private Boolean isShared;
20+
private List<String> tags;
1821
private String name;
1922
private Boolean online;
2023
private RunnerStatus status;
@@ -88,6 +91,14 @@ public void setDescription(String description) {
8891
this.description = description;
8992
}
9093

94+
public RunnerType getRunnerType() {
95+
return runnerType;
96+
}
97+
98+
public void setRunnerType(RunnerType runnerType) {
99+
this.runnerType = runnerType;
100+
}
101+
91102
public Boolean getActive() {
92103
return active;
93104
}
@@ -104,6 +115,14 @@ public void setIs_shared(Boolean is_shared) {
104115
this.isShared = is_shared;
105116
}
106117

118+
public List<String> getTags() {
119+
return tags;
120+
}
121+
122+
public void setTags(List<String> tags) {
123+
this.tags = tags;
124+
}
125+
107126
public String getName() {
108127
return name;
109128
}

gitlab4j-models/src/main/java/org/gitlab4j/api/webhook/AbstractPushEvent.java

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public abstract class AbstractPushEvent {
1111
private String after;
1212
private String before;
1313
private String ref;
14+
private Boolean refProtected;
1415
private String checkoutSha;
1516

1617
private Long userId;
@@ -61,6 +62,14 @@ public void setRef(String ref) {
6162
this.ref = ref;
6263
}
6364

65+
public Boolean getRefProtected() {
66+
return refProtected;
67+
}
68+
69+
public void setRefProtected(Boolean refProtected) {
70+
this.refProtected = refProtected;
71+
}
72+
6473
public String getCheckoutSha() {
6574
return checkoutSha;
6675
}

gitlab4j-models/src/main/java/org/gitlab4j/api/webhook/BuildCommit.java

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
public class BuildCommit {
88

99
private Long id;
10+
private String name;
1011
private String sha;
1112
private String message;
1213
private String authorName;
@@ -25,6 +26,14 @@ public void setId(Long id) {
2526
this.id = id;
2627
}
2728

29+
public String getName() {
30+
return name;
31+
}
32+
33+
public void setName(String name) {
34+
this.name = name;
35+
}
36+
2837
public String getSha() {
2938
return sha;
3039
}

0 commit comments

Comments
 (0)