package com.hbc.svc.sundial.v2.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; import java.util.UUID; import org.joda.time.DateTime; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 2.0.0-dev * User agent: apibuilder app.apibuilder.io/hbc/svc-sundial/2.0.0-dev/android_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson and retrofit2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * */ @JsonIgnoreProperties( ignoreUnknown = true ) public class Task { private final UUID taskId; private final UUID processId; private final String processDefinitionName; private final String taskDefinitionName; private final DateTime startTime; private final DateTime endTime; private final Integer previousAttemptCount; private final LogEntry[] logEntries; private final MetadataEntry[] metadataEntries; private final MetadataEntry[] executionState; private final TaskStatus status; @JsonCreator public Task(@JsonProperty("task_id") UUID taskId, @JsonProperty("process_id") UUID processId, @JsonProperty("process_definition_name") String processDefinitionName, @JsonProperty("task_definition_name") String taskDefinitionName, @JsonProperty("start_time") DateTime startTime, @JsonProperty("end_time") DateTime endTime, @JsonProperty("previous_attempt_count") Integer previousAttemptCount, @JsonProperty("log_entries") LogEntry[] logEntries, @JsonProperty("metadata_entries") MetadataEntry[] metadataEntries, @JsonProperty("execution_state") MetadataEntry[] executionState, @JsonProperty("status") TaskStatus status) { this.taskId = taskId; this.processId = processId; this.processDefinitionName = processDefinitionName; this.taskDefinitionName = taskDefinitionName; this.startTime = startTime; this.endTime = endTime; this.previousAttemptCount = previousAttemptCount; this.logEntries = logEntries; this.metadataEntries = metadataEntries; this.executionState = executionState; this.status = status; } public UUID getTaskId() { return taskId; } public UUID getProcessId() { return processId; } public String getProcessDefinitionName() { return processDefinitionName; } public String getTaskDefinitionName() { return taskDefinitionName; } public DateTime getStartTime() { return startTime; } public DateTime getEndTime() { return endTime; } public Integer getPreviousAttemptCount() { return previousAttemptCount; } public LogEntry[] getLogEntries() { return logEntries; } public MetadataEntry[] getMetadataEntries() { return metadataEntries; } /** * Internal bookkeeping metadata used for task scheduling (e.g. ECS task ID and cluster name) */ public MetadataEntry[] getExecutionState() { return executionState; } public TaskStatus getStatus() { return status; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Task that = (Task) o; if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false; if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false; if (processDefinitionName != null ? !processDefinitionName.equals(that.processDefinitionName) : that.processDefinitionName != null) return false; if (taskDefinitionName != null ? !taskDefinitionName.equals(that.taskDefinitionName) : that.taskDefinitionName != null) return false; if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false; if (endTime != null ? !endTime.equals(that.endTime) : that.endTime != null) return false; if (previousAttemptCount != null ? !previousAttemptCount.equals(that.previousAttemptCount) : that.previousAttemptCount != null) return false; if (!Arrays.equals(logEntries, that.logEntries)) return false; if (!Arrays.equals(metadataEntries, that.metadataEntries)) return false; if (!Arrays.equals(executionState, that.executionState)) return false; if (status != null ? !status.equals(that.status) : that.status != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (taskId != null ? taskId.hashCode() : 0); result = 31 * result + (processId != null ? processId.hashCode() : 0); result = 31 * result + (processDefinitionName != null ? processDefinitionName.hashCode() : 0); result = 31 * result + (taskDefinitionName != null ? taskDefinitionName.hashCode() : 0); result = 31 * result + (startTime != null ? startTime.hashCode() : 0); result = 31 * result + (endTime != null ? endTime.hashCode() : 0); result = 31 * result + (previousAttemptCount != null ? previousAttemptCount.hashCode() : 0); result = 31 * result + (logEntries != null ? logEntries.hashCode() : 0); result = 31 * result + (metadataEntries != null ? metadataEntries.hashCode() : 0); result = 31 * result + (executionState != null ? executionState.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.hbc.svc.sundial.v2.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static Task parseJson(String json) throws IOException { return com.hbc.svc.sundial.v2.android.ApiBuilderObjectMapper.getInstance().readValue( json, Task.class); } }