
org.sourcelab.github.client.objects.WorkflowRun Maven / Gradle / Ivy
The newest version!
package org.sourcelab.github.client.objects;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class WorkflowRun {
private final long id;
private final String name;
private final long checkSuiteId;
private final String headBranch;
private final String headSha;
private final long runNumber;
private final String event;
private final WorkflowRunStatus status;
private final WorkflowRunConclusion conclusion;
private final long workflowId;
private final String htmlUrl;
private final String jobsUrl;
private final String cancelUrl;
private final String rerunUrl;
private final long runAttempt;
private final ZonedDateTime createdAt;
private final ZonedDateTime updatedAt;
private final ZonedDateTime runStartedAt;
// Dependant Objects
private final HeadCommit headCommit;
private final Repository repository;
private final List pullRequests;
private final Actor actor;
private final Actor triggeringActor;
/**
* Constructor.
*/
@JsonCreator
public WorkflowRun(
@JsonProperty("id") final long id,
@JsonProperty("name") final String name,
@JsonProperty("check_suite_id") final long checkSuiteId,
@JsonProperty("head_branch") final String headBranch,
@JsonProperty("head_sha") final String headSha,
@JsonProperty("run_number") final long runNumber,
@JsonProperty("event") final String event,
@JsonProperty("status") final WorkflowRunStatus status,
@JsonProperty("conclusion") final WorkflowRunConclusion conclusion,
@JsonProperty("workflow_id") final long workflowId,
@JsonProperty("html_url") final String htmlUrl,
@JsonProperty("jobs_url") final String jobsUrl,
@JsonProperty("cancel_url") final String cancelUrl,
@JsonProperty("rerun_url") final String rerunUrl,
@JsonProperty("run_attempt") final long runAttempt,
@JsonProperty("created_at") final ZonedDateTime createdAt,
@JsonProperty("updated_at") final ZonedDateTime updatedAt,
@JsonProperty("run_started_at") final ZonedDateTime runStartedAt,
@JsonProperty("head_commit") final HeadCommit headCommit,
@JsonProperty("repository") final Repository repository,
@JsonProperty("pull_requests") final List pullRequests,
@JsonProperty("actor") final Actor actor,
@JsonProperty("triggering_actor") final Actor triggeringActor) {
this.id = id;
this.name = name;
this.checkSuiteId = checkSuiteId;
this.headBranch = headBranch;
this.headSha = headSha;
this.runNumber = runNumber;
this.event = event;
this.status = status;
this.conclusion = conclusion;
this.workflowId = workflowId;
this.htmlUrl = htmlUrl;
this.jobsUrl = jobsUrl;
this.cancelUrl = cancelUrl;
this.rerunUrl = rerunUrl;
this.runAttempt = runAttempt;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
this.runStartedAt = runStartedAt;
this.headCommit = headCommit;
this.repository = repository;
this.pullRequests = Collections.unmodifiableList(
new ArrayList<>( (pullRequests == null) ? Collections.emptyList() : pullRequests)
);
this.actor = actor;
this.triggeringActor = triggeringActor;
}
public long getId() {
return id;
}
public String getName() {
return name;
}
public String getEvent() {
return event;
}
public long getCheckSuiteId() {
return checkSuiteId;
}
public String getHeadBranch() {
return headBranch;
}
public String getHeadSha() {
return headSha;
}
public long getRunNumber() {
return runNumber;
}
public WorkflowRunStatus getStatus() {
return status;
}
public long getWorkflowId() {
return workflowId;
}
public String getHtmlUrl() {
return htmlUrl;
}
public String getJobsUrl() {
return jobsUrl;
}
public String getCancelUrl() {
return cancelUrl;
}
public String getRerunUrl() {
return rerunUrl;
}
public long getRunAttempt() {
return runAttempt;
}
public ZonedDateTime getRunStartedAt() {
return runStartedAt;
}
public ZonedDateTime getCreatedAt() {
return createdAt;
}
public ZonedDateTime getUpdatedAt() {
return updatedAt;
}
public HeadCommit getHeadCommit() {
return headCommit;
}
public WorkflowRunConclusion getConclusion() {
return conclusion;
}
public Repository getRepository() {
return repository;
}
public List getPullRequests() {
return pullRequests;
}
public Actor getActor() {
return actor;
}
public Actor getTriggeringActor() {
return triggeringActor;
}
@Override
public String toString() {
return "WorkflowRun{"
+ "\n\tid=" + id
+ "\n\tname='" + name + '\''
+ "\n\tcheckSuiteId=" + checkSuiteId
+ "\n\theadBranch='" + headBranch + '\''
+ "\n\theadSha='" + headSha + '\''
+ "\n\trunNumber=" + runNumber
+ "\n\tevent='" + event + '\''
+ "\n\tstatus=" + status
+ "\n\tconclusion=" + conclusion
+ "\n\tworkflowId=" + workflowId
+ "\n\thtmlUrl='" + htmlUrl + '\''
+ "\n\tjobsUrl='" + jobsUrl + '\''
+ "\n\tcancelUrl='" + cancelUrl + '\''
+ "\n\trerunUrl='" + rerunUrl + '\''
+ "\n\trunAttempt=" + runAttempt
+ "\n\tcreatedAt=" + createdAt
+ "\n\tupdatedAt=" + updatedAt
+ "\n\trunStartedAt=" + runStartedAt
+ "\n\theadCommit=" + headCommit
+ "\n\trepository=" + repository
+ "\n\tpullRequests=" + pullRequests
+ "\n\tactor=" + actor
+ "\n\ttriggeringActor=" + triggeringActor
+ "\n}";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy