org.gs4tr.gcc.restclient.request.SubmissionCreateRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gcc-restclient Show documentation
Show all versions of gcc-restclient Show documentation
GlobalLink Connect Cloud java is a library to connect your system to GlobalLink Connect Cloud REST API.
package org.gs4tr.gcc.restclient.request;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.gs4tr.gcc.restclient.model.GCNode;
import org.gs4tr.gcc.restclient.util.StringUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SubmissionCreateRequest extends GCRequest {
@JsonProperty("submission_name")
private String submissionName;
@JsonProperty("due_date")
private Date dueDate;
@JsonProperty("instructions")
private String instructions;
@JsonProperty("source_locale")
private String sourceLocale;
@JsonProperty("target_locale")
private List targetLocales;
@JsonProperty("task_list")
private List taskList;
@JsonProperty("reference_file_list")
private List referenceFileList;
@JsonProperty("public_preview_url")
private String publicPreviewUrl;
@JsonProperty("context_url")
private String contextUrl;
@JsonProperty("submitter")
private String submitter;
@JsonProperty("callback_url")
private String callbackUrl;
@JsonProperty("attributes")
private Map attributes;
@JsonProperty("config")
private Map config;
public SubmissionCreateRequest(String submissionName, Date dueDate, String sourceLocale, List targetLocales,
List taskList) {
if (StringUtils.isNullOrEmpty(submissionName)) {
throw new IllegalArgumentException("Job Name is required");
}
if (dueDate.compareTo(new Date()) < 0) {
throw new IllegalArgumentException("DueDate must be after current date");
}
if (StringUtils.isNullOrEmpty(sourceLocale)) {
throw new IllegalArgumentException("Source Locale is required");
}
if (targetLocales == null || targetLocales.size() <= 0) {
throw new IllegalArgumentException("At least one target locale is required");
}
if (taskList == null || taskList.size() <= 0) {
throw new IllegalArgumentException("At least one Node is required");
}
this.submissionName = submissionName;
this.dueDate = dueDate;
this.sourceLocale = sourceLocale;
this.targetLocales = targetLocales;
this.taskList = taskList;
}
public SubmissionCreateRequest(String jobName, Date dueDate, String sourceLocale, List targetLocales,
List taskList, String instructions, String submitter, List referenceFileList,
String publicPreviewUrl, String contextUrl, String previewUrl, String callbackUrl,
Map attributes, Map config) {
this(jobName, dueDate, sourceLocale, targetLocales, taskList);
this.instructions = instructions;
this.submitter = submitter;
this.attributes = attributes;
this.config = config;
this.referenceFileList = referenceFileList;
this.publicPreviewUrl = publicPreviewUrl;
this.contextUrl = contextUrl;
this.callbackUrl = callbackUrl;
}
public String getSubmissionName() {
return submissionName;
}
public void setSubmissionName(String submissionName) {
this.submissionName = submissionName;
}
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
public String getInstructions() {
return instructions;
}
public void setInstructions(String instructions) {
this.instructions = instructions;
}
public String getSourceLocale() {
return sourceLocale;
}
public void setSourceLocale(String sourceLocale) {
this.sourceLocale = sourceLocale;
}
public List getTargetLocales() {
return targetLocales;
}
public void setTargetLocales(List targetLocales) {
this.targetLocales = targetLocales;
}
public List getTaskList() {
return taskList;
}
public void setTaskList(List taskList) {
this.taskList = taskList;
}
public List getReferenceFileList() {
return referenceFileList;
}
public void setReferenceFileList(List referenceFileList) {
this.referenceFileList = referenceFileList;
}
public String getPublicPreviewUrl() {
return publicPreviewUrl;
}
public void setPublicPreviewUrl(String publicPreviewUrl) {
this.publicPreviewUrl = publicPreviewUrl;
}
public String getContextUrl() {
return contextUrl;
}
public void setContextUrl(String contextUrl) {
this.contextUrl = contextUrl;
}
public String getSubmitter() {
return submitter;
}
public void setSubmitter(String submitter) {
this.submitter = submitter;
}
public String getCallbackUrl() {
return callbackUrl;
}
public void setCallbackUrl(String callbackUrl) {
this.callbackUrl = callbackUrl;
}
public Map getAttributes() {
return attributes;
}
public void setAttributes(Map attributes) {
this.attributes = attributes;
}
public Map getConfig() {
return config;
}
public void setConfig(Map config) {
this.config = config;
}
}