gitlab-runner-gateway/src/main/java/tk/antoine_roux/wiki/model/internal/Job.java

94 lines
3.4 KiB
Java

package tk.antoine_roux.wiki.model.internal;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.ZonedDateTime;
// ID int `json:"id"`
// Token string `json:"token"`
// AllowGitFetch bool `json:"allow_git_fetch"`
// JobInfo JobInfo `json:"job_info"`
// GitInfo GitInfo `json:"git_info"`
// RunnerInfo RunnerInfo `json:"runner_info"`
// Variables JobVariables `json:"variables"`
// Steps Steps `json:"steps"`
// Image Image `json:"image"`
// Services Services `json:"services"`
// Artifacts Artifacts `json:"artifacts"`
// Cache Caches `json:"cache"`
// Credentials []Credentials `json:"credentials"`
// Dependencies Dependencies `json:"dependencies"`
// Features GitlabFeatures `json:"features"`
// Secrets Secrets `json:"secrets,omitempty"`
public class Job {
@JsonProperty("artifacts_file")
public String artifactsFile;
public Commit commit;
public String coverage;
@JsonProperty("created_at")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssSSSXXX")
public ZonedDateTime createdAt;
@JsonProperty("finished_at")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssSSSXXX")
public ZonedDateTime finishedAt;
public Integer id;
public String name;
public String ref;
public Runner runner;
public String stage;
@JsonProperty("started_at")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssSSSXXX")
public ZonedDateTime startedAt;
public JobStatus status;
public boolean tag;
public UserReduced user;
public Job(
String artifactsFile, Commit commit, String coverage, ZonedDateTime createdAt, ZonedDateTime finishedAt,
Integer id, String name, String ref, Runner runner, String stage, ZonedDateTime startedAt, JobStatus status,
boolean tag, UserReduced user
) {
this.artifactsFile = artifactsFile;
this.commit = commit;
this.coverage = coverage;
this.createdAt = createdAt;
this.finishedAt = finishedAt;
this.id = id;
this.name = name;
this.ref = ref;
this.runner = runner;
this.stage = stage;
this.startedAt = startedAt;
this.status = status;
this.tag = tag;
this.user = user;
}
public static class Commit {
@JsonProperty("author_email")
public String authorEmail;
@JsonProperty("author_name")
public String authorName;
@JsonProperty("created_at")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssSSSXXX")
public ZonedDateTime createdAt;
public String id;
public String message;
@JsonProperty("short_id")
public String shortId;
public String title;
public Commit(String authorEmail, String authorName, ZonedDateTime createdAt, String id, String message, String shortId, String title) {
this.authorEmail = authorEmail;
this.authorName = authorName;
this.createdAt = createdAt;
this.id = id;
this.message = message;
this.shortId = shortId;
this.title = title;
}
}
}