
com.hpe.caf.services.job.api.generated.model.Job Maven / Gradle / Ivy
The newest version!
package com.hpe.caf.services.job.api.generated.model;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.hpe.caf.services.job.api.generated.model.Failure;
import com.hpe.caf.services.job.api.generated.model.JobStatus;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonTypeName("job")
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", date = "2024-10-23T20:35:51.516502756Z[Etc/UTC]")
public class Job {
private String id;
private String name;
private String description;
private String externalData;
private Long createTime;
private Long lastUpdateTime;
private JobStatus status;
private Float percentageComplete;
private List failures;
private Map labels = new HashMap<>();
/**
* The job identifier
**/
public Job id(String id) {
this.id = id;
return this;
}
@JsonProperty("id")
public String getId() {
return id;
}
@JsonProperty("id")
public void setId(String id) {
this.id = id;
}
/**
* The name of the job
**/
public Job name(String name) {
this.name = name;
return this;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
/**
* The description of the job
**/
public Job description(String description) {
this.description = description;
return this;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* DEPRECATED - Replaced by labels External data can be associated with the job for use by other components.
**/
public Job externalData(String externalData) {
this.externalData = externalData;
return this;
}
@JsonProperty("externalData")
public String getExternalData() {
return externalData;
}
@JsonProperty("externalData")
public void setExternalData(String externalData) {
this.externalData = externalData;
}
/**
* The time the job was created
**/
public Job createTime(Long createTime) {
this.createTime = createTime;
return this;
}
@JsonProperty("createTime")
public Long getCreateTime() {
return createTime;
}
@JsonProperty("createTime")
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
/**
* The time the job status or progress last changed
**/
public Job lastUpdateTime(Long lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
return this;
}
@JsonProperty("lastUpdateTime")
public Long getLastUpdateTime() {
return lastUpdateTime;
}
@JsonProperty("lastUpdateTime")
public void setLastUpdateTime(Long lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}
/**
**/
public Job status(JobStatus status) {
this.status = status;
return this;
}
@JsonProperty("status")
public JobStatus getStatus() {
return status;
}
@JsonProperty("status")
public void setStatus(JobStatus status) {
this.status = status;
}
/**
* Gives an indication of the progress of the job.
**/
public Job percentageComplete(Float percentageComplete) {
this.percentageComplete = percentageComplete;
return this;
}
@JsonProperty("percentageComplete")
public Float getPercentageComplete() {
return percentageComplete;
}
@JsonProperty("percentageComplete")
public void setPercentageComplete(Float percentageComplete) {
this.percentageComplete = percentageComplete;
}
/**
* Job failure details
**/
public Job failures(List failures) {
this.failures = failures;
return this;
}
@JsonProperty("failures")
public List getFailures() {
return failures;
}
@JsonProperty("failures")
public void setFailures(List failures) {
this.failures = failures;
}
public Job addFailuresItem(Failure failuresItem) {
if (this.failures == null) {
this.failures = new ArrayList<>();
}
this.failures.add(failuresItem);
return this;
}
public Job removeFailuresItem(Failure failuresItem) {
if (failuresItem != null && this.failures != null) {
this.failures.remove(failuresItem);
}
return this;
}
/**
* A map of meta data associated with this job. Note that the keys can only include alphanumeric, '_', '-' and ':' characters
**/
public Job labels(Map labels) {
this.labels = labels;
return this;
}
@JsonProperty("labels")
public Map getLabels() {
return labels;
}
@JsonProperty("labels")
public void setLabels(Map labels) {
this.labels = labels;
}
public Job putLabelsItem(String key, String labelsItem) {
if (this.labels == null) {
this.labels = new HashMap<>();
}
this.labels.put(key, labelsItem);
return this;
}
public Job removeLabelsItem(String labelsItem) {
if (labelsItem != null && this.labels != null) {
this.labels.remove(labelsItem);
}
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Job job = (Job) o;
return Objects.equals(this.id, job.id) &&
Objects.equals(this.name, job.name) &&
Objects.equals(this.description, job.description) &&
Objects.equals(this.externalData, job.externalData) &&
Objects.equals(this.createTime, job.createTime) &&
Objects.equals(this.lastUpdateTime, job.lastUpdateTime) &&
Objects.equals(this.status, job.status) &&
Objects.equals(this.percentageComplete, job.percentageComplete) &&
Objects.equals(this.failures, job.failures) &&
Objects.equals(this.labels, job.labels);
}
@Override
public int hashCode() {
return Objects.hash(id, name, description, externalData, createTime, lastUpdateTime, status, percentageComplete, failures, labels);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Job {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" externalData: ").append(toIndentedString(externalData)).append("\n");
sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n");
sb.append(" lastUpdateTime: ").append(toIndentedString(lastUpdateTime)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" percentageComplete: ").append(toIndentedString(percentageComplete)).append("\n");
sb.append(" failures: ").append(toIndentedString(failures)).append("\n");
sb.append(" labels: ").append(toIndentedString(labels)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy