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

software.amazon.awssdk.services.translate.model.TextTranslationJobProperties Maven / Gradle / Ivy

/*
 * Copyright 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 software.amazon.awssdk.services.translate.model;

import java.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Provides information about a translation job. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TextTranslationJobProperties implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("JobId") .getter(getter(TextTranslationJobProperties::jobId)).setter(setter(Builder::jobId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobId").build()).build(); private static final SdkField JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("JobName").getter(getter(TextTranslationJobProperties::jobName)).setter(setter(Builder::jobName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobName").build()).build(); private static final SdkField JOB_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("JobStatus").getter(getter(TextTranslationJobProperties::jobStatusAsString)) .setter(setter(Builder::jobStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobStatus").build()).build(); private static final SdkField JOB_DETAILS_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("JobDetails").getter(getter(TextTranslationJobProperties::jobDetails)) .setter(setter(Builder::jobDetails)).constructor(JobDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobDetails").build()).build(); private static final SdkField SOURCE_LANGUAGE_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceLanguageCode").getter(getter(TextTranslationJobProperties::sourceLanguageCode)) .setter(setter(Builder::sourceLanguageCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceLanguageCode").build()) .build(); private static final SdkField> TARGET_LANGUAGE_CODES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("TargetLanguageCodes") .getter(getter(TextTranslationJobProperties::targetLanguageCodes)) .setter(setter(Builder::targetLanguageCodes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetLanguageCodes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> TERMINOLOGY_NAMES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("TerminologyNames") .getter(getter(TextTranslationJobProperties::terminologyNames)) .setter(setter(Builder::terminologyNames)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TerminologyNames").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> PARALLEL_DATA_NAMES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ParallelDataNames") .getter(getter(TextTranslationJobProperties::parallelDataNames)) .setter(setter(Builder::parallelDataNames)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParallelDataNames").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Message") .getter(getter(TextTranslationJobProperties::message)).setter(setter(Builder::message)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Message").build()).build(); private static final SdkField SUBMITTED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("SubmittedTime").getter(getter(TextTranslationJobProperties::submittedTime)) .setter(setter(Builder::submittedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubmittedTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EndTime").getter(getter(TextTranslationJobProperties::endTime)).setter(setter(Builder::endTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final SdkField INPUT_DATA_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("InputDataConfig") .getter(getter(TextTranslationJobProperties::inputDataConfig)).setter(setter(Builder::inputDataConfig)) .constructor(InputDataConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputDataConfig").build()).build(); private static final SdkField OUTPUT_DATA_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("OutputDataConfig") .getter(getter(TextTranslationJobProperties::outputDataConfig)).setter(setter(Builder::outputDataConfig)) .constructor(OutputDataConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputDataConfig").build()).build(); private static final SdkField DATA_ACCESS_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DataAccessRoleArn").getter(getter(TextTranslationJobProperties::dataAccessRoleArn)) .setter(setter(Builder::dataAccessRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataAccessRoleArn").build()).build(); private static final SdkField SETTINGS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Settings") .getter(getter(TextTranslationJobProperties::settings)).setter(setter(Builder::settings)) .constructor(TranslationSettings::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Settings").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_ID_FIELD, JOB_NAME_FIELD, JOB_STATUS_FIELD, JOB_DETAILS_FIELD, SOURCE_LANGUAGE_CODE_FIELD, TARGET_LANGUAGE_CODES_FIELD, TERMINOLOGY_NAMES_FIELD, PARALLEL_DATA_NAMES_FIELD, MESSAGE_FIELD, SUBMITTED_TIME_FIELD, END_TIME_FIELD, INPUT_DATA_CONFIG_FIELD, OUTPUT_DATA_CONFIG_FIELD, DATA_ACCESS_ROLE_ARN_FIELD, SETTINGS_FIELD)); private static final long serialVersionUID = 1L; private final String jobId; private final String jobName; private final String jobStatus; private final JobDetails jobDetails; private final String sourceLanguageCode; private final List targetLanguageCodes; private final List terminologyNames; private final List parallelDataNames; private final String message; private final Instant submittedTime; private final Instant endTime; private final InputDataConfig inputDataConfig; private final OutputDataConfig outputDataConfig; private final String dataAccessRoleArn; private final TranslationSettings settings; private TextTranslationJobProperties(BuilderImpl builder) { this.jobId = builder.jobId; this.jobName = builder.jobName; this.jobStatus = builder.jobStatus; this.jobDetails = builder.jobDetails; this.sourceLanguageCode = builder.sourceLanguageCode; this.targetLanguageCodes = builder.targetLanguageCodes; this.terminologyNames = builder.terminologyNames; this.parallelDataNames = builder.parallelDataNames; this.message = builder.message; this.submittedTime = builder.submittedTime; this.endTime = builder.endTime; this.inputDataConfig = builder.inputDataConfig; this.outputDataConfig = builder.outputDataConfig; this.dataAccessRoleArn = builder.dataAccessRoleArn; this.settings = builder.settings; } /** *

* The ID of the translation job. *

* * @return The ID of the translation job. */ public final String jobId() { return jobId; } /** *

* The user-defined name of the translation job. *

* * @return The user-defined name of the translation job. */ public final String jobName() { return jobName; } /** *

* The status of the translation job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #jobStatus} will * return {@link JobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #jobStatusAsString}. *

* * @return The status of the translation job. * @see JobStatus */ public final JobStatus jobStatus() { return JobStatus.fromValue(jobStatus); } /** *

* The status of the translation job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #jobStatus} will * return {@link JobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #jobStatusAsString}. *

* * @return The status of the translation job. * @see JobStatus */ public final String jobStatusAsString() { return jobStatus; } /** *

* The number of documents successfully and unsuccessfully processed during the translation job. *

* * @return The number of documents successfully and unsuccessfully processed during the translation job. */ public final JobDetails jobDetails() { return jobDetails; } /** *

* The language code of the language of the source text. The language must be a language supported by Amazon * Translate. *

* * @return The language code of the language of the source text. The language must be a language supported by Amazon * Translate. */ public final String sourceLanguageCode() { return sourceLanguageCode; } /** * For responses, this returns true if the service returned a value for the TargetLanguageCodes property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasTargetLanguageCodes() { return targetLanguageCodes != null && !(targetLanguageCodes instanceof SdkAutoConstructList); } /** *

* The language code of the language of the target text. The language must be a language supported by Amazon * Translate. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTargetLanguageCodes} method. *

* * @return The language code of the language of the target text. The language must be a language supported by Amazon * Translate. */ public final List targetLanguageCodes() { return targetLanguageCodes; } /** * For responses, this returns true if the service returned a value for the TerminologyNames property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasTerminologyNames() { return terminologyNames != null && !(terminologyNames instanceof SdkAutoConstructList); } /** *

* A list containing the names of the terminologies applied to a translation job. Only one terminology can be * applied per StartTextTranslationJob request at this time. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTerminologyNames} method. *

* * @return A list containing the names of the terminologies applied to a translation job. Only one terminology can * be applied per StartTextTranslationJob request at this time. */ public final List terminologyNames() { return terminologyNames; } /** * For responses, this returns true if the service returned a value for the ParallelDataNames property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasParallelDataNames() { return parallelDataNames != null && !(parallelDataNames instanceof SdkAutoConstructList); } /** *

* A list containing the names of the parallel data resources applied to the translation job. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasParallelDataNames} method. *

* * @return A list containing the names of the parallel data resources applied to the translation job. */ public final List parallelDataNames() { return parallelDataNames; } /** *

* An explanation of any errors that may have occurred during the translation job. *

* * @return An explanation of any errors that may have occurred during the translation job. */ public final String message() { return message; } /** *

* The time at which the translation job was submitted. *

* * @return The time at which the translation job was submitted. */ public final Instant submittedTime() { return submittedTime; } /** *

* The time at which the translation job ended. *

* * @return The time at which the translation job ended. */ public final Instant endTime() { return endTime; } /** *

* The input configuration properties that were specified when the job was requested. *

* * @return The input configuration properties that were specified when the job was requested. */ public final InputDataConfig inputDataConfig() { return inputDataConfig; } /** *

* The output configuration properties that were specified when the job was requested. *

* * @return The output configuration properties that were specified when the job was requested. */ public final OutputDataConfig outputDataConfig() { return outputDataConfig; } /** *

* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon Translate * read access to the job's input data. *

* * @return The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon * Translate read access to the job's input data. */ public final String dataAccessRoleArn() { return dataAccessRoleArn; } /** *

* Settings that modify the translation output. *

* * @return Settings that modify the translation output. */ public final TranslationSettings settings() { return settings; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(jobId()); hashCode = 31 * hashCode + Objects.hashCode(jobName()); hashCode = 31 * hashCode + Objects.hashCode(jobStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(jobDetails()); hashCode = 31 * hashCode + Objects.hashCode(sourceLanguageCode()); hashCode = 31 * hashCode + Objects.hashCode(hasTargetLanguageCodes() ? targetLanguageCodes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTerminologyNames() ? terminologyNames() : null); hashCode = 31 * hashCode + Objects.hashCode(hasParallelDataNames() ? parallelDataNames() : null); hashCode = 31 * hashCode + Objects.hashCode(message()); hashCode = 31 * hashCode + Objects.hashCode(submittedTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(inputDataConfig()); hashCode = 31 * hashCode + Objects.hashCode(outputDataConfig()); hashCode = 31 * hashCode + Objects.hashCode(dataAccessRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(settings()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof TextTranslationJobProperties)) { return false; } TextTranslationJobProperties other = (TextTranslationJobProperties) obj; return Objects.equals(jobId(), other.jobId()) && Objects.equals(jobName(), other.jobName()) && Objects.equals(jobStatusAsString(), other.jobStatusAsString()) && Objects.equals(jobDetails(), other.jobDetails()) && Objects.equals(sourceLanguageCode(), other.sourceLanguageCode()) && hasTargetLanguageCodes() == other.hasTargetLanguageCodes() && Objects.equals(targetLanguageCodes(), other.targetLanguageCodes()) && hasTerminologyNames() == other.hasTerminologyNames() && Objects.equals(terminologyNames(), other.terminologyNames()) && hasParallelDataNames() == other.hasParallelDataNames() && Objects.equals(parallelDataNames(), other.parallelDataNames()) && Objects.equals(message(), other.message()) && Objects.equals(submittedTime(), other.submittedTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(inputDataConfig(), other.inputDataConfig()) && Objects.equals(outputDataConfig(), other.outputDataConfig()) && Objects.equals(dataAccessRoleArn(), other.dataAccessRoleArn()) && Objects.equals(settings(), other.settings()); } /** * 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. */ @Override public final String toString() { return ToString.builder("TextTranslationJobProperties").add("JobId", jobId()).add("JobName", jobName()) .add("JobStatus", jobStatusAsString()).add("JobDetails", jobDetails()) .add("SourceLanguageCode", sourceLanguageCode()) .add("TargetLanguageCodes", hasTargetLanguageCodes() ? targetLanguageCodes() : null) .add("TerminologyNames", hasTerminologyNames() ? terminologyNames() : null) .add("ParallelDataNames", hasParallelDataNames() ? parallelDataNames() : null).add("Message", message()) .add("SubmittedTime", submittedTime()).add("EndTime", endTime()).add("InputDataConfig", inputDataConfig()) .add("OutputDataConfig", outputDataConfig()).add("DataAccessRoleArn", dataAccessRoleArn()) .add("Settings", settings()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "JobId": return Optional.ofNullable(clazz.cast(jobId())); case "JobName": return Optional.ofNullable(clazz.cast(jobName())); case "JobStatus": return Optional.ofNullable(clazz.cast(jobStatusAsString())); case "JobDetails": return Optional.ofNullable(clazz.cast(jobDetails())); case "SourceLanguageCode": return Optional.ofNullable(clazz.cast(sourceLanguageCode())); case "TargetLanguageCodes": return Optional.ofNullable(clazz.cast(targetLanguageCodes())); case "TerminologyNames": return Optional.ofNullable(clazz.cast(terminologyNames())); case "ParallelDataNames": return Optional.ofNullable(clazz.cast(parallelDataNames())); case "Message": return Optional.ofNullable(clazz.cast(message())); case "SubmittedTime": return Optional.ofNullable(clazz.cast(submittedTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "InputDataConfig": return Optional.ofNullable(clazz.cast(inputDataConfig())); case "OutputDataConfig": return Optional.ofNullable(clazz.cast(outputDataConfig())); case "DataAccessRoleArn": return Optional.ofNullable(clazz.cast(dataAccessRoleArn())); case "Settings": return Optional.ofNullable(clazz.cast(settings())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TextTranslationJobProperties) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the translation job. *

* * @param jobId * The ID of the translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobId(String jobId); /** *

* The user-defined name of the translation job. *

* * @param jobName * The user-defined name of the translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobName(String jobName); /** *

* The status of the translation job. *

* * @param jobStatus * The status of the translation job. * @see JobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see JobStatus */ Builder jobStatus(String jobStatus); /** *

* The status of the translation job. *

* * @param jobStatus * The status of the translation job. * @see JobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see JobStatus */ Builder jobStatus(JobStatus jobStatus); /** *

* The number of documents successfully and unsuccessfully processed during the translation job. *

* * @param jobDetails * The number of documents successfully and unsuccessfully processed during the translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobDetails(JobDetails jobDetails); /** *

* The number of documents successfully and unsuccessfully processed during the translation job. *

* This is a convenience method that creates an instance of the {@link JobDetails.Builder} avoiding the need to * create one manually via {@link JobDetails#builder()}. * *

* When the {@link Consumer} completes, {@link JobDetails.Builder#build()} is called immediately and its result * is passed to {@link #jobDetails(JobDetails)}. * * @param jobDetails * a consumer that will call methods on {@link JobDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #jobDetails(JobDetails) */ default Builder jobDetails(Consumer jobDetails) { return jobDetails(JobDetails.builder().applyMutation(jobDetails).build()); } /** *

* The language code of the language of the source text. The language must be a language supported by Amazon * Translate. *

* * @param sourceLanguageCode * The language code of the language of the source text. The language must be a language supported by * Amazon Translate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceLanguageCode(String sourceLanguageCode); /** *

* The language code of the language of the target text. The language must be a language supported by Amazon * Translate. *

* * @param targetLanguageCodes * The language code of the language of the target text. The language must be a language supported by * Amazon Translate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetLanguageCodes(Collection targetLanguageCodes); /** *

* The language code of the language of the target text. The language must be a language supported by Amazon * Translate. *

* * @param targetLanguageCodes * The language code of the language of the target text. The language must be a language supported by * Amazon Translate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetLanguageCodes(String... targetLanguageCodes); /** *

* A list containing the names of the terminologies applied to a translation job. Only one terminology can be * applied per StartTextTranslationJob request at this time. *

* * @param terminologyNames * A list containing the names of the terminologies applied to a translation job. Only one terminology * can be applied per StartTextTranslationJob request at this time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder terminologyNames(Collection terminologyNames); /** *

* A list containing the names of the terminologies applied to a translation job. Only one terminology can be * applied per StartTextTranslationJob request at this time. *

* * @param terminologyNames * A list containing the names of the terminologies applied to a translation job. Only one terminology * can be applied per StartTextTranslationJob request at this time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder terminologyNames(String... terminologyNames); /** *

* A list containing the names of the parallel data resources applied to the translation job. *

* * @param parallelDataNames * A list containing the names of the parallel data resources applied to the translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parallelDataNames(Collection parallelDataNames); /** *

* A list containing the names of the parallel data resources applied to the translation job. *

* * @param parallelDataNames * A list containing the names of the parallel data resources applied to the translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parallelDataNames(String... parallelDataNames); /** *

* An explanation of any errors that may have occurred during the translation job. *

* * @param message * An explanation of any errors that may have occurred during the translation job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder message(String message); /** *

* The time at which the translation job was submitted. *

* * @param submittedTime * The time at which the translation job was submitted. * @return Returns a reference to this object so that method calls can be chained together. */ Builder submittedTime(Instant submittedTime); /** *

* The time at which the translation job ended. *

* * @param endTime * The time at which the translation job ended. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* The input configuration properties that were specified when the job was requested. *

* * @param inputDataConfig * The input configuration properties that were specified when the job was requested. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputDataConfig(InputDataConfig inputDataConfig); /** *

* The input configuration properties that were specified when the job was requested. *

* This is a convenience method that creates an instance of the {@link InputDataConfig.Builder} avoiding the * need to create one manually via {@link InputDataConfig#builder()}. * *

* When the {@link Consumer} completes, {@link InputDataConfig.Builder#build()} is called immediately and its * result is passed to {@link #inputDataConfig(InputDataConfig)}. * * @param inputDataConfig * a consumer that will call methods on {@link InputDataConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #inputDataConfig(InputDataConfig) */ default Builder inputDataConfig(Consumer inputDataConfig) { return inputDataConfig(InputDataConfig.builder().applyMutation(inputDataConfig).build()); } /** *

* The output configuration properties that were specified when the job was requested. *

* * @param outputDataConfig * The output configuration properties that were specified when the job was requested. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputDataConfig(OutputDataConfig outputDataConfig); /** *

* The output configuration properties that were specified when the job was requested. *

* This is a convenience method that creates an instance of the {@link OutputDataConfig.Builder} avoiding the * need to create one manually via {@link OutputDataConfig#builder()}. * *

* When the {@link Consumer} completes, {@link OutputDataConfig.Builder#build()} is called immediately and its * result is passed to {@link #outputDataConfig(OutputDataConfig)}. * * @param outputDataConfig * a consumer that will call methods on {@link OutputDataConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputDataConfig(OutputDataConfig) */ default Builder outputDataConfig(Consumer outputDataConfig) { return outputDataConfig(OutputDataConfig.builder().applyMutation(outputDataConfig).build()); } /** *

* The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon * Translate read access to the job's input data. *

* * @param dataAccessRoleArn * The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that granted Amazon * Translate read access to the job's input data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataAccessRoleArn(String dataAccessRoleArn); /** *

* Settings that modify the translation output. *

* * @param settings * Settings that modify the translation output. * @return Returns a reference to this object so that method calls can be chained together. */ Builder settings(TranslationSettings settings); /** *

* Settings that modify the translation output. *

* This is a convenience method that creates an instance of the {@link TranslationSettings.Builder} avoiding the * need to create one manually via {@link TranslationSettings#builder()}. * *

* When the {@link Consumer} completes, {@link TranslationSettings.Builder#build()} is called immediately and * its result is passed to {@link #settings(TranslationSettings)}. * * @param settings * a consumer that will call methods on {@link TranslationSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #settings(TranslationSettings) */ default Builder settings(Consumer settings) { return settings(TranslationSettings.builder().applyMutation(settings).build()); } } static final class BuilderImpl implements Builder { private String jobId; private String jobName; private String jobStatus; private JobDetails jobDetails; private String sourceLanguageCode; private List targetLanguageCodes = DefaultSdkAutoConstructList.getInstance(); private List terminologyNames = DefaultSdkAutoConstructList.getInstance(); private List parallelDataNames = DefaultSdkAutoConstructList.getInstance(); private String message; private Instant submittedTime; private Instant endTime; private InputDataConfig inputDataConfig; private OutputDataConfig outputDataConfig; private String dataAccessRoleArn; private TranslationSettings settings; private BuilderImpl() { } private BuilderImpl(TextTranslationJobProperties model) { jobId(model.jobId); jobName(model.jobName); jobStatus(model.jobStatus); jobDetails(model.jobDetails); sourceLanguageCode(model.sourceLanguageCode); targetLanguageCodes(model.targetLanguageCodes); terminologyNames(model.terminologyNames); parallelDataNames(model.parallelDataNames); message(model.message); submittedTime(model.submittedTime); endTime(model.endTime); inputDataConfig(model.inputDataConfig); outputDataConfig(model.outputDataConfig); dataAccessRoleArn(model.dataAccessRoleArn); settings(model.settings); } public final String getJobId() { return jobId; } public final void setJobId(String jobId) { this.jobId = jobId; } @Override public final Builder jobId(String jobId) { this.jobId = jobId; return this; } public final String getJobName() { return jobName; } public final void setJobName(String jobName) { this.jobName = jobName; } @Override public final Builder jobName(String jobName) { this.jobName = jobName; return this; } public final String getJobStatus() { return jobStatus; } public final void setJobStatus(String jobStatus) { this.jobStatus = jobStatus; } @Override public final Builder jobStatus(String jobStatus) { this.jobStatus = jobStatus; return this; } @Override public final Builder jobStatus(JobStatus jobStatus) { this.jobStatus(jobStatus == null ? null : jobStatus.toString()); return this; } public final JobDetails.Builder getJobDetails() { return jobDetails != null ? jobDetails.toBuilder() : null; } public final void setJobDetails(JobDetails.BuilderImpl jobDetails) { this.jobDetails = jobDetails != null ? jobDetails.build() : null; } @Override public final Builder jobDetails(JobDetails jobDetails) { this.jobDetails = jobDetails; return this; } public final String getSourceLanguageCode() { return sourceLanguageCode; } public final void setSourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; } @Override public final Builder sourceLanguageCode(String sourceLanguageCode) { this.sourceLanguageCode = sourceLanguageCode; return this; } public final Collection getTargetLanguageCodes() { if (targetLanguageCodes instanceof SdkAutoConstructList) { return null; } return targetLanguageCodes; } public final void setTargetLanguageCodes(Collection targetLanguageCodes) { this.targetLanguageCodes = TargetLanguageCodeStringListCopier.copy(targetLanguageCodes); } @Override public final Builder targetLanguageCodes(Collection targetLanguageCodes) { this.targetLanguageCodes = TargetLanguageCodeStringListCopier.copy(targetLanguageCodes); return this; } @Override @SafeVarargs public final Builder targetLanguageCodes(String... targetLanguageCodes) { targetLanguageCodes(Arrays.asList(targetLanguageCodes)); return this; } public final Collection getTerminologyNames() { if (terminologyNames instanceof SdkAutoConstructList) { return null; } return terminologyNames; } public final void setTerminologyNames(Collection terminologyNames) { this.terminologyNames = ResourceNameListCopier.copy(terminologyNames); } @Override public final Builder terminologyNames(Collection terminologyNames) { this.terminologyNames = ResourceNameListCopier.copy(terminologyNames); return this; } @Override @SafeVarargs public final Builder terminologyNames(String... terminologyNames) { terminologyNames(Arrays.asList(terminologyNames)); return this; } public final Collection getParallelDataNames() { if (parallelDataNames instanceof SdkAutoConstructList) { return null; } return parallelDataNames; } public final void setParallelDataNames(Collection parallelDataNames) { this.parallelDataNames = ResourceNameListCopier.copy(parallelDataNames); } @Override public final Builder parallelDataNames(Collection parallelDataNames) { this.parallelDataNames = ResourceNameListCopier.copy(parallelDataNames); return this; } @Override @SafeVarargs public final Builder parallelDataNames(String... parallelDataNames) { parallelDataNames(Arrays.asList(parallelDataNames)); return this; } public final String getMessage() { return message; } public final void setMessage(String message) { this.message = message; } @Override public final Builder message(String message) { this.message = message; return this; } public final Instant getSubmittedTime() { return submittedTime; } public final void setSubmittedTime(Instant submittedTime) { this.submittedTime = submittedTime; } @Override public final Builder submittedTime(Instant submittedTime) { this.submittedTime = submittedTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final InputDataConfig.Builder getInputDataConfig() { return inputDataConfig != null ? inputDataConfig.toBuilder() : null; } public final void setInputDataConfig(InputDataConfig.BuilderImpl inputDataConfig) { this.inputDataConfig = inputDataConfig != null ? inputDataConfig.build() : null; } @Override public final Builder inputDataConfig(InputDataConfig inputDataConfig) { this.inputDataConfig = inputDataConfig; return this; } public final OutputDataConfig.Builder getOutputDataConfig() { return outputDataConfig != null ? outputDataConfig.toBuilder() : null; } public final void setOutputDataConfig(OutputDataConfig.BuilderImpl outputDataConfig) { this.outputDataConfig = outputDataConfig != null ? outputDataConfig.build() : null; } @Override public final Builder outputDataConfig(OutputDataConfig outputDataConfig) { this.outputDataConfig = outputDataConfig; return this; } public final String getDataAccessRoleArn() { return dataAccessRoleArn; } public final void setDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; } @Override public final Builder dataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; return this; } public final TranslationSettings.Builder getSettings() { return settings != null ? settings.toBuilder() : null; } public final void setSettings(TranslationSettings.BuilderImpl settings) { this.settings = settings != null ? settings.build() : null; } @Override @Transient public final Builder settings(TranslationSettings settings) { this.settings = settings; return this; } @Override public TextTranslationJobProperties build() { return new TextTranslationJobProperties(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy