commonMain.aws.sdk.kotlin.services.translate.model.StartTextTranslationJobRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of translate-jvm Show documentation
Show all versions of translate-jvm Show documentation
The AWS SDK for Kotlin client for Translate
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.translate.model
import aws.smithy.kotlin.runtime.SdkDsl
public class StartTextTranslationJobRequest private constructor(builder: Builder) {
/**
* A unique identifier for the request. This token is generated for you when using the Amazon Translate SDK.
*/
public val clientToken: kotlin.String? = builder.clientToken
/**
* 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 information, see [Identity and access management ](https://docs.aws.amazon.com/translate/latest/dg/identity-and-access-management.html).
*/
public val dataAccessRoleArn: kotlin.String? = builder.dataAccessRoleArn
/**
* Specifies the format and location of the input documents for the translation job.
*/
public val inputDataConfig: aws.sdk.kotlin.services.translate.model.InputDataConfig? = builder.inputDataConfig
/**
* The name of the batch translation job to be performed.
*/
public val jobName: kotlin.String? = builder.jobName
/**
* Specifies the S3 folder to which your job output will be saved.
*/
public val outputDataConfig: aws.sdk.kotlin.services.translate.model.OutputDataConfig? = builder.outputDataConfig
/**
* The name of a parallel data resource to add to the translation job. This resource consists of examples that show how you want segments of text to be translated. If you specify multiple target languages for the job, the parallel data file must include translations for all the target languages.
*
* When you add parallel data to a translation job, you create an *Active Custom Translation* job.
*
* This parameter accepts only one parallel data resource.
*
* Active Custom Translation jobs are priced at a higher rate than other jobs that don't use parallel data. For more information, see [Amazon Translate pricing](http://aws.amazon.com/translate/pricing/).
*
* For a list of available parallel data resources, use the ListParallelData operation.
*
* For more information, see [ Customizing your translations with parallel data](https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-parallel-data.html).
*/
public val parallelDataNames: List? = builder.parallelDataNames
/**
* Settings to configure your translation output. You can configure the following options:
* + Brevity: not supported.
* + Formality: sets the formality level of the output text.
* + Profanity: masks profane words and phrases in your translation output.
*/
public val settings: aws.sdk.kotlin.services.translate.model.TranslationSettings? = builder.settings
/**
* The language code of the input language. Specify the language if all input documents share the same language. If you don't know the language of the source files, or your input documents contains different source languages, select `auto`. Amazon Translate auto detects the source language for each input document. For a list of supported language codes, see [Supported languages](https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html).
*/
public val sourceLanguageCode: kotlin.String? = builder.sourceLanguageCode
/**
* The target languages of the translation job. Enter up to 10 language codes. Each input file is translated into each target language.
*
* Each language code is 2 or 5 characters long. For a list of language codes, see [Supported languages](https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html).
*/
public val targetLanguageCodes: List? = builder.targetLanguageCodes
/**
* The name of a custom terminology resource to add to the translation job. This resource lists examples source terms and the desired translation for each term.
*
* This parameter accepts only one custom terminology resource.
*
* If you specify multiple target languages for the job, translate uses the designated terminology for each requested target language that has an entry for the source term in the terminology file.
*
* For a list of available custom terminology resources, use the ListTerminologies operation.
*
* For more information, see [Custom terminology](https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html).
*/
public val terminologyNames: List? = builder.terminologyNames
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.translate.model.StartTextTranslationJobRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("StartTextTranslationJobRequest(")
append("clientToken=$clientToken,")
append("dataAccessRoleArn=$dataAccessRoleArn,")
append("inputDataConfig=$inputDataConfig,")
append("jobName=$jobName,")
append("outputDataConfig=$outputDataConfig,")
append("parallelDataNames=$parallelDataNames,")
append("settings=$settings,")
append("sourceLanguageCode=$sourceLanguageCode,")
append("targetLanguageCodes=$targetLanguageCodes,")
append("terminologyNames=$terminologyNames")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = clientToken?.hashCode() ?: 0
result = 31 * result + (dataAccessRoleArn?.hashCode() ?: 0)
result = 31 * result + (inputDataConfig?.hashCode() ?: 0)
result = 31 * result + (jobName?.hashCode() ?: 0)
result = 31 * result + (outputDataConfig?.hashCode() ?: 0)
result = 31 * result + (parallelDataNames?.hashCode() ?: 0)
result = 31 * result + (settings?.hashCode() ?: 0)
result = 31 * result + (sourceLanguageCode?.hashCode() ?: 0)
result = 31 * result + (targetLanguageCodes?.hashCode() ?: 0)
result = 31 * result + (terminologyNames?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as StartTextTranslationJobRequest
if (clientToken != other.clientToken) return false
if (dataAccessRoleArn != other.dataAccessRoleArn) return false
if (inputDataConfig != other.inputDataConfig) return false
if (jobName != other.jobName) return false
if (outputDataConfig != other.outputDataConfig) return false
if (parallelDataNames != other.parallelDataNames) return false
if (settings != other.settings) return false
if (sourceLanguageCode != other.sourceLanguageCode) return false
if (targetLanguageCodes != other.targetLanguageCodes) return false
if (terminologyNames != other.terminologyNames) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.translate.model.StartTextTranslationJobRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A unique identifier for the request. This token is generated for you when using the Amazon Translate SDK.
*/
public var clientToken: kotlin.String? = null
/**
* 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 information, see [Identity and access management ](https://docs.aws.amazon.com/translate/latest/dg/identity-and-access-management.html).
*/
public var dataAccessRoleArn: kotlin.String? = null
/**
* Specifies the format and location of the input documents for the translation job.
*/
public var inputDataConfig: aws.sdk.kotlin.services.translate.model.InputDataConfig? = null
/**
* The name of the batch translation job to be performed.
*/
public var jobName: kotlin.String? = null
/**
* Specifies the S3 folder to which your job output will be saved.
*/
public var outputDataConfig: aws.sdk.kotlin.services.translate.model.OutputDataConfig? = null
/**
* The name of a parallel data resource to add to the translation job. This resource consists of examples that show how you want segments of text to be translated. If you specify multiple target languages for the job, the parallel data file must include translations for all the target languages.
*
* When you add parallel data to a translation job, you create an *Active Custom Translation* job.
*
* This parameter accepts only one parallel data resource.
*
* Active Custom Translation jobs are priced at a higher rate than other jobs that don't use parallel data. For more information, see [Amazon Translate pricing](http://aws.amazon.com/translate/pricing/).
*
* For a list of available parallel data resources, use the ListParallelData operation.
*
* For more information, see [ Customizing your translations with parallel data](https://docs.aws.amazon.com/translate/latest/dg/customizing-translations-parallel-data.html).
*/
public var parallelDataNames: List? = null
/**
* Settings to configure your translation output. You can configure the following options:
* + Brevity: not supported.
* + Formality: sets the formality level of the output text.
* + Profanity: masks profane words and phrases in your translation output.
*/
public var settings: aws.sdk.kotlin.services.translate.model.TranslationSettings? = null
/**
* The language code of the input language. Specify the language if all input documents share the same language. If you don't know the language of the source files, or your input documents contains different source languages, select `auto`. Amazon Translate auto detects the source language for each input document. For a list of supported language codes, see [Supported languages](https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html).
*/
public var sourceLanguageCode: kotlin.String? = null
/**
* The target languages of the translation job. Enter up to 10 language codes. Each input file is translated into each target language.
*
* Each language code is 2 or 5 characters long. For a list of language codes, see [Supported languages](https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html).
*/
public var targetLanguageCodes: List? = null
/**
* The name of a custom terminology resource to add to the translation job. This resource lists examples source terms and the desired translation for each term.
*
* This parameter accepts only one custom terminology resource.
*
* If you specify multiple target languages for the job, translate uses the designated terminology for each requested target language that has an entry for the source term in the terminology file.
*
* For a list of available custom terminology resources, use the ListTerminologies operation.
*
* For more information, see [Custom terminology](https://docs.aws.amazon.com/translate/latest/dg/how-custom-terminology.html).
*/
public var terminologyNames: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.translate.model.StartTextTranslationJobRequest) : this() {
this.clientToken = x.clientToken
this.dataAccessRoleArn = x.dataAccessRoleArn
this.inputDataConfig = x.inputDataConfig
this.jobName = x.jobName
this.outputDataConfig = x.outputDataConfig
this.parallelDataNames = x.parallelDataNames
this.settings = x.settings
this.sourceLanguageCode = x.sourceLanguageCode
this.targetLanguageCodes = x.targetLanguageCodes
this.terminologyNames = x.terminologyNames
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.translate.model.StartTextTranslationJobRequest = StartTextTranslationJobRequest(this)
/**
* construct an [aws.sdk.kotlin.services.translate.model.InputDataConfig] inside the given [block]
*/
public fun inputDataConfig(block: aws.sdk.kotlin.services.translate.model.InputDataConfig.Builder.() -> kotlin.Unit) {
this.inputDataConfig = aws.sdk.kotlin.services.translate.model.InputDataConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.translate.model.OutputDataConfig] inside the given [block]
*/
public fun outputDataConfig(block: aws.sdk.kotlin.services.translate.model.OutputDataConfig.Builder.() -> kotlin.Unit) {
this.outputDataConfig = aws.sdk.kotlin.services.translate.model.OutputDataConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.translate.model.TranslationSettings] inside the given [block]
*/
public fun settings(block: aws.sdk.kotlin.services.translate.model.TranslationSettings.Builder.() -> kotlin.Unit) {
this.settings = aws.sdk.kotlin.services.translate.model.TranslationSettings.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}