All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gs4tr.gcc.restclient.request.SubmissionSubmitRequest Maven / Gradle / Ivy

Go to download

GlobalLink Connect Cloud java is a library to connect your system to GlobalLink Connect Cloud REST API.

There is a newer version: 3.1.3
Show newest version
package org.gs4tr.gcc.restclient.request;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.gs4tr.gcc.restclient.model.ContentLocales;
import org.gs4tr.gcc.restclient.util.StringUtils;

import com.fasterxml.jackson.annotation.JsonProperty;

public class SubmissionSubmitRequest 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("content_list")
	private List contentList;
	@JsonProperty("reference_file_list")
	private List referenceFileList;
	@JsonProperty("submitter")
	private String submitter;
	@JsonProperty("callback_url")
	private String callbackUrl;
	@JsonProperty("attributes")
	private Map attributes;
	@JsonProperty("config")
	private Map config;
	@JsonProperty("content_list_locale")
	private List contentLocales;
	@JsonProperty("workflow")
	private String workflow;
	@JsonProperty("tags")
	private List tags;

	public SubmissionSubmitRequest(String submissionName, Date dueDate, String sourceLocale, List targetLocales,
			List contentList) {
		if (StringUtils.isNullOrEmpty(submissionName)) {
			throw new IllegalArgumentException("Submission 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 (contentList == null || contentList.size() <= 0) {
			throw new IllegalArgumentException("At least one Content is required");
		}
		this.submissionName = submissionName;
		this.dueDate = dueDate;
		this.sourceLocale = sourceLocale;
		this.targetLocales = targetLocales;
		this.contentList = contentList;
	}

	public SubmissionSubmitRequest(String submissionName, Date dueDate, String sourceLocale,
			List contentLocales) {
		if (StringUtils.isNullOrEmpty(submissionName)) {
			throw new IllegalArgumentException("Submission 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 (contentLocales == null || contentLocales.size() <= 0) {
			throw new IllegalArgumentException("At least one Content is required");
		}
		this.submissionName = submissionName;
		this.dueDate = dueDate;
		this.sourceLocale = sourceLocale;
		this.contentLocales = contentLocales;
	}

	public SubmissionSubmitRequest(String submissionName, Date dueDate, String sourceLocale, List targetLocales,
			List contentList, String instructions, String submitter, List referenceFileList,
			String callbackUrl, Map attributes, Map config) {
		this(submissionName, dueDate, sourceLocale, targetLocales, contentList);
		this.instructions = instructions;
		this.submitter = submitter;
		this.attributes = attributes;
		this.config = config;
		this.referenceFileList = referenceFileList;
		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 getContentList() {
		return contentList;
	}

	public void setContentList(List contentList) {
		this.contentList = contentList;
	}

	public List getReferenceFileList() {
		return referenceFileList;
	}

	public void setReferenceFileList(List referenceFileList) {
		this.referenceFileList = referenceFileList;
	}

	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;
	}

	public List getContentLocales() {
		return contentLocales;
	}

	public void setContentLocales(List contentLocales) {
		this.contentLocales = contentLocales;
	}

	public String getWorkflow() {
		return workflow;
	}

	public void setWorkflow(String workflow) {
		this.workflow = workflow;
	}

	public List getTags() {
		return tags;
	}

	public void setTags(List tags) {
		this.tags = tags;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy