com.amazonaws.services.translate.model.StartTextTranslationJobRequest Maven / Gradle / Ivy
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.translate.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class StartTextTranslationJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the batch translation job to be performed.
*
*/
private String jobName;
/**
*
* Specifies the format and S3 location of the input documents for the translation job.
*
*/
private InputDataConfig inputDataConfig;
/**
*
* Specifies the S3 folder to which your job output will be saved.
*
*/
private OutputDataConfig outputDataConfig;
/**
*
* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate
* read access to your input data. For more nformation, see identity-and-access-management.
*
*/
private String dataAccessRoleArn;
/**
*
* The language code of the input language. For a list of language codes, see what-is-languages.
*
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
*
*/
private String sourceLanguageCode;
/**
*
* The language code of the output language.
*
*/
private java.util.List targetLanguageCodes;
/**
*
* The name of the terminology to use in the batch translation job. For a list of available terminologies, use the
* ListTerminologies operation.
*
*/
private java.util.List terminologyNames;
/**
*
* The names of the parallel data resources to use in the batch translation job. For a list of available parallel
* data resources, use the ListParallelData operation.
*
*/
private java.util.List parallelDataNames;
/**
*
* A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
*
*/
private String clientToken;
/**
*
* The name of the batch translation job to be performed.
*
*
* @param jobName
* The name of the batch translation job to be performed.
*/
public void setJobName(String jobName) {
this.jobName = jobName;
}
/**
*
* The name of the batch translation job to be performed.
*
*
* @return The name of the batch translation job to be performed.
*/
public String getJobName() {
return this.jobName;
}
/**
*
* The name of the batch translation job to be performed.
*
*
* @param jobName
* The name of the batch translation job to be performed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withJobName(String jobName) {
setJobName(jobName);
return this;
}
/**
*
* Specifies the format and S3 location of the input documents for the translation job.
*
*
* @param inputDataConfig
* Specifies the format and S3 location of the input documents for the translation job.
*/
public void setInputDataConfig(InputDataConfig inputDataConfig) {
this.inputDataConfig = inputDataConfig;
}
/**
*
* Specifies the format and S3 location of the input documents for the translation job.
*
*
* @return Specifies the format and S3 location of the input documents for the translation job.
*/
public InputDataConfig getInputDataConfig() {
return this.inputDataConfig;
}
/**
*
* Specifies the format and S3 location of the input documents for the translation job.
*
*
* @param inputDataConfig
* Specifies the format and S3 location of the input documents for the translation job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withInputDataConfig(InputDataConfig inputDataConfig) {
setInputDataConfig(inputDataConfig);
return this;
}
/**
*
* Specifies the S3 folder to which your job output will be saved.
*
*
* @param outputDataConfig
* Specifies the S3 folder to which your job output will be saved.
*/
public void setOutputDataConfig(OutputDataConfig outputDataConfig) {
this.outputDataConfig = outputDataConfig;
}
/**
*
* Specifies the S3 folder to which your job output will be saved.
*
*
* @return Specifies the S3 folder to which your job output will be saved.
*/
public OutputDataConfig getOutputDataConfig() {
return this.outputDataConfig;
}
/**
*
* Specifies the S3 folder to which your job output will be saved.
*
*
* @param outputDataConfig
* Specifies the S3 folder to which your job output will be saved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withOutputDataConfig(OutputDataConfig outputDataConfig) {
setOutputDataConfig(outputDataConfig);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate
* read access to your input data. For more nformation, see identity-and-access-management.
*
*
* @param dataAccessRoleArn
* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon
* Translate read access to your input data. For more nformation, see identity-and-access-management.
*/
public void setDataAccessRoleArn(String dataAccessRoleArn) {
this.dataAccessRoleArn = dataAccessRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate
* read access to your input data. For more nformation, see identity-and-access-management.
*
*
* @return The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon
* Translate read access to your input data. For more nformation, see identity-and-access-management.
*/
public String getDataAccessRoleArn() {
return this.dataAccessRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate
* read access to your input data. For more nformation, see identity-and-access-management.
*
*
* @param dataAccessRoleArn
* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon
* Translate read access to your input data. For more nformation, see identity-and-access-management.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withDataAccessRoleArn(String dataAccessRoleArn) {
setDataAccessRoleArn(dataAccessRoleArn);
return this;
}
/**
*
* The language code of the input language. For a list of language codes, see what-is-languages.
*
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
*
*
* @param sourceLanguageCode
* The language code of the input language. For a list of language codes, see what-is-languages.
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
*/
public void setSourceLanguageCode(String sourceLanguageCode) {
this.sourceLanguageCode = sourceLanguageCode;
}
/**
*
* The language code of the input language. For a list of language codes, see what-is-languages.
*
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
*
*
* @return The language code of the input language. For a list of language codes, see what-is-languages.
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
*/
public String getSourceLanguageCode() {
return this.sourceLanguageCode;
}
/**
*
* The language code of the input language. For a list of language codes, see what-is-languages.
*
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
*
*
* @param sourceLanguageCode
* The language code of the input language. For a list of language codes, see what-is-languages.
*
* Amazon Translate does not automatically detect a source language during batch translation jobs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withSourceLanguageCode(String sourceLanguageCode) {
setSourceLanguageCode(sourceLanguageCode);
return this;
}
/**
*
* The language code of the output language.
*
*
* @return The language code of the output language.
*/
public java.util.List getTargetLanguageCodes() {
return targetLanguageCodes;
}
/**
*
* The language code of the output language.
*
*
* @param targetLanguageCodes
* The language code of the output language.
*/
public void setTargetLanguageCodes(java.util.Collection targetLanguageCodes) {
if (targetLanguageCodes == null) {
this.targetLanguageCodes = null;
return;
}
this.targetLanguageCodes = new java.util.ArrayList(targetLanguageCodes);
}
/**
*
* The language code of the output language.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTargetLanguageCodes(java.util.Collection)} or {@link #withTargetLanguageCodes(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param targetLanguageCodes
* The language code of the output language.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withTargetLanguageCodes(String... targetLanguageCodes) {
if (this.targetLanguageCodes == null) {
setTargetLanguageCodes(new java.util.ArrayList(targetLanguageCodes.length));
}
for (String ele : targetLanguageCodes) {
this.targetLanguageCodes.add(ele);
}
return this;
}
/**
*
* The language code of the output language.
*
*
* @param targetLanguageCodes
* The language code of the output language.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withTargetLanguageCodes(java.util.Collection targetLanguageCodes) {
setTargetLanguageCodes(targetLanguageCodes);
return this;
}
/**
*
* The name of the terminology to use in the batch translation job. For a list of available terminologies, use the
* ListTerminologies operation.
*
*
* @return The name of the terminology to use in the batch translation job. For a list of available terminologies,
* use the ListTerminologies operation.
*/
public java.util.List getTerminologyNames() {
return terminologyNames;
}
/**
*
* The name of the terminology to use in the batch translation job. For a list of available terminologies, use the
* ListTerminologies operation.
*
*
* @param terminologyNames
* The name of the terminology to use in the batch translation job. For a list of available terminologies,
* use the ListTerminologies operation.
*/
public void setTerminologyNames(java.util.Collection terminologyNames) {
if (terminologyNames == null) {
this.terminologyNames = null;
return;
}
this.terminologyNames = new java.util.ArrayList(terminologyNames);
}
/**
*
* The name of the terminology to use in the batch translation job. For a list of available terminologies, use the
* ListTerminologies operation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTerminologyNames(java.util.Collection)} or {@link #withTerminologyNames(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param terminologyNames
* The name of the terminology to use in the batch translation job. For a list of available terminologies,
* use the ListTerminologies operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withTerminologyNames(String... terminologyNames) {
if (this.terminologyNames == null) {
setTerminologyNames(new java.util.ArrayList(terminologyNames.length));
}
for (String ele : terminologyNames) {
this.terminologyNames.add(ele);
}
return this;
}
/**
*
* The name of the terminology to use in the batch translation job. For a list of available terminologies, use the
* ListTerminologies operation.
*
*
* @param terminologyNames
* The name of the terminology to use in the batch translation job. For a list of available terminologies,
* use the ListTerminologies operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withTerminologyNames(java.util.Collection terminologyNames) {
setTerminologyNames(terminologyNames);
return this;
}
/**
*
* The names of the parallel data resources to use in the batch translation job. For a list of available parallel
* data resources, use the ListParallelData operation.
*
*
* @return The names of the parallel data resources to use in the batch translation job. For a list of available
* parallel data resources, use the ListParallelData operation.
*/
public java.util.List getParallelDataNames() {
return parallelDataNames;
}
/**
*
* The names of the parallel data resources to use in the batch translation job. For a list of available parallel
* data resources, use the ListParallelData operation.
*
*
* @param parallelDataNames
* The names of the parallel data resources to use in the batch translation job. For a list of available
* parallel data resources, use the ListParallelData operation.
*/
public void setParallelDataNames(java.util.Collection parallelDataNames) {
if (parallelDataNames == null) {
this.parallelDataNames = null;
return;
}
this.parallelDataNames = new java.util.ArrayList(parallelDataNames);
}
/**
*
* The names of the parallel data resources to use in the batch translation job. For a list of available parallel
* data resources, use the ListParallelData operation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setParallelDataNames(java.util.Collection)} or {@link #withParallelDataNames(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param parallelDataNames
* The names of the parallel data resources to use in the batch translation job. For a list of available
* parallel data resources, use the ListParallelData operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withParallelDataNames(String... parallelDataNames) {
if (this.parallelDataNames == null) {
setParallelDataNames(new java.util.ArrayList(parallelDataNames.length));
}
for (String ele : parallelDataNames) {
this.parallelDataNames.add(ele);
}
return this;
}
/**
*
* The names of the parallel data resources to use in the batch translation job. For a list of available parallel
* data resources, use the ListParallelData operation.
*
*
* @param parallelDataNames
* The names of the parallel data resources to use in the batch translation job. For a list of available
* parallel data resources, use the ListParallelData operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withParallelDataNames(java.util.Collection parallelDataNames) {
setParallelDataNames(parallelDataNames);
return this;
}
/**
*
* A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
*
*
* @param clientToken
* A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
*
*
* @return A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
*
*
* @param clientToken
* A unique identifier for the request. This token is auto-generated when using the Amazon Translate SDK.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartTextTranslationJobRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getJobName() != null)
sb.append("JobName: ").append(getJobName()).append(",");
if (getInputDataConfig() != null)
sb.append("InputDataConfig: ").append(getInputDataConfig()).append(",");
if (getOutputDataConfig() != null)
sb.append("OutputDataConfig: ").append(getOutputDataConfig()).append(",");
if (getDataAccessRoleArn() != null)
sb.append("DataAccessRoleArn: ").append(getDataAccessRoleArn()).append(",");
if (getSourceLanguageCode() != null)
sb.append("SourceLanguageCode: ").append(getSourceLanguageCode()).append(",");
if (getTargetLanguageCodes() != null)
sb.append("TargetLanguageCodes: ").append(getTargetLanguageCodes()).append(",");
if (getTerminologyNames() != null)
sb.append("TerminologyNames: ").append(getTerminologyNames()).append(",");
if (getParallelDataNames() != null)
sb.append("ParallelDataNames: ").append(getParallelDataNames()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof StartTextTranslationJobRequest == false)
return false;
StartTextTranslationJobRequest other = (StartTextTranslationJobRequest) obj;
if (other.getJobName() == null ^ this.getJobName() == null)
return false;
if (other.getJobName() != null && other.getJobName().equals(this.getJobName()) == false)
return false;
if (other.getInputDataConfig() == null ^ this.getInputDataConfig() == null)
return false;
if (other.getInputDataConfig() != null && other.getInputDataConfig().equals(this.getInputDataConfig()) == false)
return false;
if (other.getOutputDataConfig() == null ^ this.getOutputDataConfig() == null)
return false;
if (other.getOutputDataConfig() != null && other.getOutputDataConfig().equals(this.getOutputDataConfig()) == false)
return false;
if (other.getDataAccessRoleArn() == null ^ this.getDataAccessRoleArn() == null)
return false;
if (other.getDataAccessRoleArn() != null && other.getDataAccessRoleArn().equals(this.getDataAccessRoleArn()) == false)
return false;
if (other.getSourceLanguageCode() == null ^ this.getSourceLanguageCode() == null)
return false;
if (other.getSourceLanguageCode() != null && other.getSourceLanguageCode().equals(this.getSourceLanguageCode()) == false)
return false;
if (other.getTargetLanguageCodes() == null ^ this.getTargetLanguageCodes() == null)
return false;
if (other.getTargetLanguageCodes() != null && other.getTargetLanguageCodes().equals(this.getTargetLanguageCodes()) == false)
return false;
if (other.getTerminologyNames() == null ^ this.getTerminologyNames() == null)
return false;
if (other.getTerminologyNames() != null && other.getTerminologyNames().equals(this.getTerminologyNames()) == false)
return false;
if (other.getParallelDataNames() == null ^ this.getParallelDataNames() == null)
return false;
if (other.getParallelDataNames() != null && other.getParallelDataNames().equals(this.getParallelDataNames()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getJobName() == null) ? 0 : getJobName().hashCode());
hashCode = prime * hashCode + ((getInputDataConfig() == null) ? 0 : getInputDataConfig().hashCode());
hashCode = prime * hashCode + ((getOutputDataConfig() == null) ? 0 : getOutputDataConfig().hashCode());
hashCode = prime * hashCode + ((getDataAccessRoleArn() == null) ? 0 : getDataAccessRoleArn().hashCode());
hashCode = prime * hashCode + ((getSourceLanguageCode() == null) ? 0 : getSourceLanguageCode().hashCode());
hashCode = prime * hashCode + ((getTargetLanguageCodes() == null) ? 0 : getTargetLanguageCodes().hashCode());
hashCode = prime * hashCode + ((getTerminologyNames() == null) ? 0 : getTerminologyNames().hashCode());
hashCode = prime * hashCode + ((getParallelDataNames() == null) ? 0 : getParallelDataNames().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
return hashCode;
}
@Override
public StartTextTranslationJobRequest clone() {
return (StartTextTranslationJobRequest) super.clone();
}
}