|
| 1 | +package org.gitlab4j.api.webhook; |
| 2 | + |
| 3 | +import java.util.Date; |
| 4 | + |
| 5 | +import org.gitlab4j.api.models.User; |
| 6 | +import org.gitlab4j.api.utils.JacksonJson; |
| 7 | + |
| 8 | +public class JobEvent extends AbstractEvent { |
| 9 | + |
| 10 | + public static final String JOB_HOOK_X_GITLAB_EVENT = "Job Hook"; |
| 11 | + public static final String OBJECT_KIND = "job"; |
| 12 | + |
| 13 | + private String ref; |
| 14 | + private Boolean tag; |
| 15 | + private String beforeSha; |
| 16 | + private String sha; |
| 17 | + private Integer jobId; |
| 18 | + private String jobName; |
| 19 | + private String jobStage; |
| 20 | + private String jobStatus; |
| 21 | + private Date jobStarted_at; |
| 22 | + private Date jobFinished_at; |
| 23 | + private Integer jobDuration; |
| 24 | + private Boolean jobAllowFailure; |
| 25 | + private String jobFailureReason; |
| 26 | + private Integer projectId; |
| 27 | + private String projectName; |
| 28 | + private User user; |
| 29 | + private JobCommit commit; |
| 30 | + private EventRepository repository; |
| 31 | + |
| 32 | + public String getObjectKind() { |
| 33 | + return (OBJECT_KIND); |
| 34 | + } |
| 35 | + |
| 36 | + public void setObjectKind(String objectKind) { |
| 37 | + if (!OBJECT_KIND.equals(objectKind)) |
| 38 | + throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'"); |
| 39 | + } |
| 40 | + |
| 41 | + public String getRef() { |
| 42 | + return ref; |
| 43 | + } |
| 44 | + |
| 45 | + public void setRef(String ref) { |
| 46 | + this.ref = ref; |
| 47 | + } |
| 48 | + |
| 49 | + public Boolean getTag() { |
| 50 | + return tag; |
| 51 | + } |
| 52 | + |
| 53 | + public void setTag(Boolean tag) { |
| 54 | + this.tag = tag; |
| 55 | + } |
| 56 | + |
| 57 | + public String getBeforeSha() { |
| 58 | + return beforeSha; |
| 59 | + } |
| 60 | + |
| 61 | + public void setBeforeSha(String beforeSha) { |
| 62 | + this.beforeSha = beforeSha; |
| 63 | + } |
| 64 | + |
| 65 | + public String getSha() { |
| 66 | + return sha; |
| 67 | + } |
| 68 | + |
| 69 | + public void setSha(String sha) { |
| 70 | + this.sha = sha; |
| 71 | + } |
| 72 | + |
| 73 | + public Integer getJobId() { |
| 74 | + return jobId; |
| 75 | + } |
| 76 | + |
| 77 | + public void setJobId(Integer jobId) { |
| 78 | + this.jobId = jobId; |
| 79 | + } |
| 80 | + |
| 81 | + public String getJobName() { |
| 82 | + return jobName; |
| 83 | + } |
| 84 | + |
| 85 | + public void setJobName(String jobName) { |
| 86 | + this.jobName = jobName; |
| 87 | + } |
| 88 | + |
| 89 | + public String getJobStage() { |
| 90 | + return jobStage; |
| 91 | + } |
| 92 | + |
| 93 | + public void setJobStage(String jobStage) { |
| 94 | + this.jobStage = jobStage; |
| 95 | + } |
| 96 | + |
| 97 | + public String getJobStatus() { |
| 98 | + return jobStatus; |
| 99 | + } |
| 100 | + |
| 101 | + public void setJobStatus(String jobStatus) { |
| 102 | + this.jobStatus = jobStatus; |
| 103 | + } |
| 104 | + |
| 105 | + public Date getJobStarted_at() { |
| 106 | + return jobStarted_at; |
| 107 | + } |
| 108 | + |
| 109 | + public void setJobStarted_at(Date jobStarted_at) { |
| 110 | + this.jobStarted_at = jobStarted_at; |
| 111 | + } |
| 112 | + |
| 113 | + public Date getJobFinished_at() { |
| 114 | + return jobFinished_at; |
| 115 | + } |
| 116 | + |
| 117 | + public void setJobFinished_at(Date jobFinished_at) { |
| 118 | + this.jobFinished_at = jobFinished_at; |
| 119 | + } |
| 120 | + |
| 121 | + public Integer getJobDuration() { |
| 122 | + return jobDuration; |
| 123 | + } |
| 124 | + |
| 125 | + public void setJobDuration(Integer jobDuration) { |
| 126 | + this.jobDuration = jobDuration; |
| 127 | + } |
| 128 | + |
| 129 | + public Boolean getJobAllowFailure() { |
| 130 | + return jobAllowFailure; |
| 131 | + } |
| 132 | + |
| 133 | + public void setJobAllowFailure(Boolean jobAllowFailure) { |
| 134 | + this.jobAllowFailure = jobAllowFailure; |
| 135 | + } |
| 136 | + |
| 137 | + public String getJobFailureReason() { |
| 138 | + return jobFailureReason; |
| 139 | + } |
| 140 | + |
| 141 | + public void setJobFailureReason(String jobFailureReason) { |
| 142 | + this.jobFailureReason = jobFailureReason; |
| 143 | + } |
| 144 | + |
| 145 | + public Integer getProjectId() { |
| 146 | + return projectId; |
| 147 | + } |
| 148 | + |
| 149 | + public void setProjectId(Integer projectId) { |
| 150 | + this.projectId = projectId; |
| 151 | + } |
| 152 | + |
| 153 | + public String getProjectName() { |
| 154 | + return projectName; |
| 155 | + } |
| 156 | + |
| 157 | + public void setProjectName(String projectName) { |
| 158 | + this.projectName = projectName; |
| 159 | + } |
| 160 | + |
| 161 | + public User getUser() { |
| 162 | + return user; |
| 163 | + } |
| 164 | + |
| 165 | + public void setUser(User user) { |
| 166 | + this.user = user; |
| 167 | + } |
| 168 | + |
| 169 | + public JobCommit getCommit() { |
| 170 | + return commit; |
| 171 | + } |
| 172 | + |
| 173 | + public void setCommit(JobCommit commit) { |
| 174 | + this.commit = commit; |
| 175 | + } |
| 176 | + |
| 177 | + public EventRepository getRepository() { |
| 178 | + return repository; |
| 179 | + } |
| 180 | + |
| 181 | + public void setRepository(EventRepository repository) { |
| 182 | + this.repository = repository; |
| 183 | + } |
| 184 | + |
| 185 | + public class JobCommit { |
| 186 | + |
| 187 | + private Integer id; |
| 188 | + private String sha; |
| 189 | + private String message; |
| 190 | + private String authorName; |
| 191 | + private String authorEmail; |
| 192 | + private String status; |
| 193 | + private Integer duration; |
| 194 | + private Date startedAt; |
| 195 | + private Date finishedAt; |
| 196 | + |
| 197 | + public Integer getId() { |
| 198 | + return id; |
| 199 | + } |
| 200 | + |
| 201 | + public void setId(Integer id) { |
| 202 | + this.id = id; |
| 203 | + } |
| 204 | + |
| 205 | + public String getSha() { |
| 206 | + return sha; |
| 207 | + } |
| 208 | + |
| 209 | + public void setSha(String sha) { |
| 210 | + this.sha = sha; |
| 211 | + } |
| 212 | + |
| 213 | + public String getMessage() { |
| 214 | + return message; |
| 215 | + } |
| 216 | + |
| 217 | + public void setMessage(String message) { |
| 218 | + this.message = message; |
| 219 | + } |
| 220 | + |
| 221 | + public String getAuthorName() { |
| 222 | + return authorName; |
| 223 | + } |
| 224 | + |
| 225 | + public void setAuthorName(String authorName) { |
| 226 | + this.authorName = authorName; |
| 227 | + } |
| 228 | + |
| 229 | + public String getAuthorEmail() { |
| 230 | + return authorEmail; |
| 231 | + } |
| 232 | + |
| 233 | + public void setAuthorEmail(String authorEmail) { |
| 234 | + this.authorEmail = authorEmail; |
| 235 | + } |
| 236 | + |
| 237 | + public String getStatus() { |
| 238 | + return status; |
| 239 | + } |
| 240 | + |
| 241 | + public void setStatus(String status) { |
| 242 | + this.status = status; |
| 243 | + } |
| 244 | + |
| 245 | + public Integer getDuration() { |
| 246 | + return duration; |
| 247 | + } |
| 248 | + |
| 249 | + public void setDuration(Integer duration) { |
| 250 | + this.duration = duration; |
| 251 | + } |
| 252 | + |
| 253 | + public Date getStartedAt() { |
| 254 | + return startedAt; |
| 255 | + } |
| 256 | + |
| 257 | + public void setStartedAt(Date startedAt) { |
| 258 | + this.startedAt = startedAt; |
| 259 | + } |
| 260 | + |
| 261 | + public Date getFinishedAt() { |
| 262 | + return finishedAt; |
| 263 | + } |
| 264 | + |
| 265 | + public void setFinishedAt(Date finishedAt) { |
| 266 | + this.finishedAt = finishedAt; |
| 267 | + } |
| 268 | + |
| 269 | + @Override |
| 270 | + public String toString() { |
| 271 | + return (JacksonJson.toJsonString(this)); |
| 272 | + } |
| 273 | + } |
| 274 | + |
| 275 | + @Override |
| 276 | + public String toString() { |
| 277 | + return (JacksonJson.toJsonString(this)); |
| 278 | + } |
| 279 | +} |
0 commit comments