com.finbourne.scheduler.model.JobDefinition Maven / Gradle / Ivy
/*
* FINBOURNE Scheduler API
* ### Introduction # Error Codes | Code|Name|Description | | ---|---|--- | | -1|Unknown error|An unexpected error was encountered on our side. | | 144|Duplicate In Parameter Set| | | 151|Invalid Parameter Value| | | 152|Action Execution Failure| | | 157|Invalid Request| | | 186|Access Denied| | | 187|Invalid Identity Token| | | 689|The supplied pagination token is invalid| | | 692|This endpoint does not support impersonation| | | 704|Cannot Delete Job| | | 731|Unable to process images associated with request.| | | 756|Image Scan Failure| | | 871|The specified impersonated user does not exist| |
*
* The version of the OpenAPI document: 0.0.932
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.finbourne.scheduler.model;
import java.util.Objects;
import java.util.Arrays;
import com.finbourne.scheduler.model.ArgumentDefinition;
import com.finbourne.scheduler.model.RequiredResources;
import com.finbourne.scheduler.model.ResourceId;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Definition of a job
*/
@ApiModel(description = "Definition of a job")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class JobDefinition {
public static final String SERIALIZED_NAME_JOB_ID = "jobId";
@SerializedName(SERIALIZED_NAME_JOB_ID)
private ResourceId jobId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_AUTHOR = "author";
@SerializedName(SERIALIZED_NAME_AUTHOR)
private String author;
public static final String SERIALIZED_NAME_DATE_CREATED = "dateCreated";
@SerializedName(SERIALIZED_NAME_DATE_CREATED)
private OffsetDateTime dateCreated;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;
public static final String SERIALIZED_NAME_DOCKER_IMAGE = "dockerImage";
@SerializedName(SERIALIZED_NAME_DOCKER_IMAGE)
private String dockerImage;
public static final String SERIALIZED_NAME_TTL = "ttl";
@SerializedName(SERIALIZED_NAME_TTL)
private Integer ttl;
public static final String SERIALIZED_NAME_MIN_CPU = "minCpu";
@SerializedName(SERIALIZED_NAME_MIN_CPU)
private String minCpu;
public static final String SERIALIZED_NAME_MAX_CPU = "maxCpu";
@SerializedName(SERIALIZED_NAME_MAX_CPU)
private String maxCpu;
public static final String SERIALIZED_NAME_MIN_MEMORY = "minMemory";
@SerializedName(SERIALIZED_NAME_MIN_MEMORY)
private String minMemory;
public static final String SERIALIZED_NAME_MAX_MEMORY = "maxMemory";
@SerializedName(SERIALIZED_NAME_MAX_MEMORY)
private String maxMemory;
public static final String SERIALIZED_NAME_ARGUMENT_DEFINITIONS = "argumentDefinitions";
@SerializedName(SERIALIZED_NAME_ARGUMENT_DEFINITIONS)
private Map argumentDefinitions = null;
public static final String SERIALIZED_NAME_COMMAND_LINE_ARGUMENT_SEPARATOR = "commandLineArgumentSeparator";
@SerializedName(SERIALIZED_NAME_COMMAND_LINE_ARGUMENT_SEPARATOR)
private String commandLineArgumentSeparator;
public static final String SERIALIZED_NAME_REQUIRED_RESOURCES = "requiredResources";
@SerializedName(SERIALIZED_NAME_REQUIRED_RESOURCES)
private RequiredResources requiredResources;
public JobDefinition jobId(ResourceId jobId) {
this.jobId = jobId;
return this;
}
/**
* Get jobId
* @return jobId
**/
@ApiModelProperty(required = true, value = "")
public ResourceId getJobId() {
return jobId;
}
public void setJobId(ResourceId jobId) {
this.jobId = jobId;
}
public JobDefinition name(String name) {
this.name = name;
return this;
}
/**
* Name of the job
* @return name
**/
@ApiModelProperty(value = "Name of the job")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public JobDefinition author(String author) {
this.author = author;
return this;
}
/**
* Author of the job
* @return author
**/
@ApiModelProperty(value = "Author of the job")
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public JobDefinition dateCreated(OffsetDateTime dateCreated) {
this.dateCreated = dateCreated;
return this;
}
/**
* Date when job was created
* @return dateCreated
**/
@ApiModelProperty(value = "Date when job was created")
public OffsetDateTime getDateCreated() {
return dateCreated;
}
public void setDateCreated(OffsetDateTime dateCreated) {
this.dateCreated = dateCreated;
}
public JobDefinition description(String description) {
this.description = description;
return this;
}
/**
* Description of this job
* @return description
**/
@ApiModelProperty(value = "Description of this job")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public JobDefinition dockerImage(String dockerImage) {
this.dockerImage = dockerImage;
return this;
}
/**
* Information about the docker image in the format “image_source/image_name:image_tag”
* @return dockerImage
**/
@ApiModelProperty(value = "Information about the docker image in the format “image_source/image_name:image_tag”")
public String getDockerImage() {
return dockerImage;
}
public void setDockerImage(String dockerImage) {
this.dockerImage = dockerImage;
}
public JobDefinition ttl(Integer ttl) {
this.ttl = ttl;
return this;
}
/**
* Time To Live of the job run in seconds Defaults to 5 minutes(300)
* @return ttl
**/
@ApiModelProperty(value = "Time To Live of the job run in seconds Defaults to 5 minutes(300)")
public Integer getTtl() {
return ttl;
}
public void setTtl(Integer ttl) {
this.ttl = ttl;
}
public JobDefinition minCpu(String minCpu) {
this.minCpu = minCpu;
return this;
}
/**
* Specifies minimum number of CPUs to be allocated for the job Default to 2
* @return minCpu
**/
@ApiModelProperty(value = "Specifies minimum number of CPUs to be allocated for the job Default to 2")
public String getMinCpu() {
return minCpu;
}
public void setMinCpu(String minCpu) {
this.minCpu = minCpu;
}
public JobDefinition maxCpu(String maxCpu) {
this.maxCpu = maxCpu;
return this;
}
/**
* Specifies maximum number of CPUs to be allocated for the job
* @return maxCpu
**/
@ApiModelProperty(value = "Specifies maximum number of CPUs to be allocated for the job")
public String getMaxCpu() {
return maxCpu;
}
public void setMaxCpu(String maxCpu) {
this.maxCpu = maxCpu;
}
public JobDefinition minMemory(String minMemory) {
this.minMemory = minMemory;
return this;
}
/**
* Specifies the minimum amount of memory (in GiB) to be allocated for the job
* @return minMemory
**/
@ApiModelProperty(value = "Specifies the minimum amount of memory (in GiB) to be allocated for the job")
public String getMinMemory() {
return minMemory;
}
public void setMinMemory(String minMemory) {
this.minMemory = minMemory;
}
public JobDefinition maxMemory(String maxMemory) {
this.maxMemory = maxMemory;
return this;
}
/**
* Specifies the maximum amount of memory (in GiB) to be allocated for the job
* @return maxMemory
**/
@ApiModelProperty(value = "Specifies the maximum amount of memory (in GiB) to be allocated for the job")
public String getMaxMemory() {
return maxMemory;
}
public void setMaxMemory(String maxMemory) {
this.maxMemory = maxMemory;
}
public JobDefinition argumentDefinitions(Map argumentDefinitions) {
this.argumentDefinitions = argumentDefinitions;
return this;
}
public JobDefinition putArgumentDefinitionsItem(String key, ArgumentDefinition argumentDefinitionsItem) {
if (this.argumentDefinitions == null) {
this.argumentDefinitions = new HashMap<>();
}
this.argumentDefinitions.put(key, argumentDefinitionsItem);
return this;
}
/**
* All arguments for this job to run
* @return argumentDefinitions
**/
@ApiModelProperty(value = "All arguments for this job to run")
public Map getArgumentDefinitions() {
return argumentDefinitions;
}
public void setArgumentDefinitions(Map argumentDefinitions) {
this.argumentDefinitions = argumentDefinitions;
}
public JobDefinition commandLineArgumentSeparator(String commandLineArgumentSeparator) {
this.commandLineArgumentSeparator = commandLineArgumentSeparator;
return this;
}
/**
* Value to separate command line arguments e.g : If a job has a command line argument named 'folder' and the runtime value is 's3://path' then this would be supplied to the command as 'folder{separatorValue}s3://path' Default to a space
* @return commandLineArgumentSeparator
**/
@ApiModelProperty(value = "Value to separate command line arguments e.g : If a job has a command line argument named 'folder' and the runtime value is 's3://path' then this would be supplied to the command as 'folder{separatorValue}s3://path' Default to a space")
public String getCommandLineArgumentSeparator() {
return commandLineArgumentSeparator;
}
public void setCommandLineArgumentSeparator(String commandLineArgumentSeparator) {
this.commandLineArgumentSeparator = commandLineArgumentSeparator;
}
public JobDefinition requiredResources(RequiredResources requiredResources) {
this.requiredResources = requiredResources;
return this;
}
/**
* Get requiredResources
* @return requiredResources
**/
@ApiModelProperty(value = "")
public RequiredResources getRequiredResources() {
return requiredResources;
}
public void setRequiredResources(RequiredResources requiredResources) {
this.requiredResources = requiredResources;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return super.hashCode();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class JobDefinition {\n");
sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" author: ").append(toIndentedString(author)).append("\n");
sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" dockerImage: ").append(toIndentedString(dockerImage)).append("\n");
sb.append(" ttl: ").append(toIndentedString(ttl)).append("\n");
sb.append(" minCpu: ").append(toIndentedString(minCpu)).append("\n");
sb.append(" maxCpu: ").append(toIndentedString(maxCpu)).append("\n");
sb.append(" minMemory: ").append(toIndentedString(minMemory)).append("\n");
sb.append(" maxMemory: ").append(toIndentedString(maxMemory)).append("\n");
sb.append(" argumentDefinitions: ").append(toIndentedString(argumentDefinitions)).append("\n");
sb.append(" commandLineArgumentSeparator: ").append(toIndentedString(commandLineArgumentSeparator)).append("\n");
sb.append(" requiredResources: ").append(toIndentedString(requiredResources)).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 ");
}
}