package com.gilt.svc.sundial.v0.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.Boolean; import java.lang.Double; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.util.Arrays; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.2.7 * User agent: apibuilder app.apibuilder.io/gilt/svc-sundial/0.2.7/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 * * An individual task that runs as part of a process */ @JsonIgnoreProperties( ignoreUnknown = true ) public class TaskDefinition { private final String taskDefinitionName; private final TaskDependency[] dependencies; private final TaskExecutable executable; private final Integer maxAttempts; private final Integer maxRuntimeSeconds; private final Integer backoffBaseSeconds; private final Double backoffExponent; private final Boolean requireExplicitSuccess; @JsonCreator public TaskDefinition(@JsonProperty("task_definition_name") String taskDefinitionName, @JsonProperty("dependencies") TaskDependency[] dependencies, @JsonProperty("executable") TaskExecutable executable, @JsonProperty("max_attempts") Integer maxAttempts, @JsonProperty("max_runtime_seconds") Integer maxRuntimeSeconds, @JsonProperty("backoff_base_seconds") Integer backoffBaseSeconds, @JsonProperty("backoff_exponent") Double backoffExponent, @JsonProperty("require_explicit_success") Boolean requireExplicitSuccess) { this.taskDefinitionName = taskDefinitionName; this.dependencies = dependencies; this.executable = executable; this.maxAttempts = maxAttempts; this.maxRuntimeSeconds = maxRuntimeSeconds; this.backoffBaseSeconds = backoffBaseSeconds; this.backoffExponent = backoffExponent; this.requireExplicitSuccess = requireExplicitSuccess; } /** * The canonical name for this task used by other tasks to identify this task */ public String getTaskDefinitionName() { return taskDefinitionName; } /** * The tasks that must have completed prior to this one beginning */ public TaskDependency[] getDependencies() { return dependencies; } public TaskExecutable getExecutable() { return executable; } public Integer getMaxAttempts() { return maxAttempts; } /** * The execution time (for a single attempt) after which the system will kill the task */ public Integer getMaxRuntimeSeconds() { return maxRuntimeSeconds; } public Integer getBackoffBaseSeconds() { return backoffBaseSeconds; } public Double getBackoffExponent() { return backoffExponent; } /** * If true, the task must explicitly update its status with Sundial in order to succeed. */ public Boolean getRequireExplicitSuccess() { return requireExplicitSuccess; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TaskDefinition that = (TaskDefinition) o; if (taskDefinitionName != null ? !taskDefinitionName.equals(that.taskDefinitionName) : that.taskDefinitionName != null) return false; if (!Arrays.equals(dependencies, that.dependencies)) return false; if (executable != null ? !executable.equals(that.executable) : that.executable != null) return false; if (maxAttempts != null ? !maxAttempts.equals(that.maxAttempts) : that.maxAttempts != null) return false; if (maxRuntimeSeconds != null ? !maxRuntimeSeconds.equals(that.maxRuntimeSeconds) : that.maxRuntimeSeconds != null) return false; if (backoffBaseSeconds != null ? !backoffBaseSeconds.equals(that.backoffBaseSeconds) : that.backoffBaseSeconds != null) return false; if (backoffExponent != null ? !backoffExponent.equals(that.backoffExponent) : that.backoffExponent != null) return false; if (requireExplicitSuccess != null ? !requireExplicitSuccess.equals(that.requireExplicitSuccess) : that.requireExplicitSuccess != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (taskDefinitionName != null ? taskDefinitionName.hashCode() : 0); result = 31 * result + (dependencies != null ? dependencies.hashCode() : 0); result = 31 * result + (executable != null ? executable.hashCode() : 0); result = 31 * result + (maxAttempts != null ? maxAttempts.hashCode() : 0); result = 31 * result + (maxRuntimeSeconds != null ? maxRuntimeSeconds.hashCode() : 0); result = 31 * result + (backoffBaseSeconds != null ? backoffBaseSeconds.hashCode() : 0); result = 31 * result + (backoffExponent != null ? backoffExponent.hashCode() : 0); result = 31 * result + (requireExplicitSuccess != null ? requireExplicitSuccess.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.gilt.svc.sundial.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static TaskDefinition parseJson(String json) throws IOException { return com.gilt.svc.sundial.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, TaskDefinition.class); } }