commonMain.aws.sdk.kotlin.services.translate.model.TerminologyData.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
/**
* The data associated with the custom terminology. For information about the custom terminology file, see [ Creating a Custom Terminology](https://docs.aws.amazon.com/translate/latest/dg/creating-custom-terminology.html).
*/
public class TerminologyData private constructor(builder: Builder) {
/**
* The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional).
*
* ## UNI
* The terminology resource has one source language (for example, the first column in a CSV file), and all of its other languages are target languages.
*
* ## MULTI
* Any language in the terminology resource can be the source language or a target language. A single multi-directional terminology resource can be used for jobs that translate different language pairs. For example, if the terminology contains English and Spanish terms, it can be used for jobs that translate English to Spanish and Spanish to English.
*
* When you create a custom terminology resource without specifying the directionality, it behaves as uni-directional terminology, although this parameter will have a null value.
*/
public val directionality: aws.sdk.kotlin.services.translate.model.Directionality? = builder.directionality
/**
* The file containing the custom terminology data. Your version of the AWS SDK performs a Base64-encoding on this field before sending a request to the AWS service. Users of the SDK should not perform Base64-encoding themselves.
*/
public val file: kotlin.ByteArray = requireNotNull(builder.file) { "A non-null value must be provided for file" }
/**
* The data format of the custom terminology.
*/
public val format: aws.sdk.kotlin.services.translate.model.TerminologyDataFormat = requireNotNull(builder.format) { "A non-null value must be provided for format" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.translate.model.TerminologyData = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("TerminologyData(")
append("directionality=$directionality,")
append("file=*** Sensitive Data Redacted ***,")
append("format=$format")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = directionality?.hashCode() ?: 0
result = 31 * result + (file.contentHashCode())
result = 31 * result + (format.hashCode())
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 TerminologyData
if (directionality != other.directionality) return false
if (file != null) {
if (other.file == null) return false
if (!file.contentEquals(other.file)) return false
} else if (other.file != null) return false
if (format != other.format) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.translate.model.TerminologyData = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The directionality of your terminology resource indicates whether it has one source language (uni-directional) or multiple (multi-directional).
*
* ## UNI
* The terminology resource has one source language (for example, the first column in a CSV file), and all of its other languages are target languages.
*
* ## MULTI
* Any language in the terminology resource can be the source language or a target language. A single multi-directional terminology resource can be used for jobs that translate different language pairs. For example, if the terminology contains English and Spanish terms, it can be used for jobs that translate English to Spanish and Spanish to English.
*
* When you create a custom terminology resource without specifying the directionality, it behaves as uni-directional terminology, although this parameter will have a null value.
*/
public var directionality: aws.sdk.kotlin.services.translate.model.Directionality? = null
/**
* The file containing the custom terminology data. Your version of the AWS SDK performs a Base64-encoding on this field before sending a request to the AWS service. Users of the SDK should not perform Base64-encoding themselves.
*/
public var file: kotlin.ByteArray? = null
/**
* The data format of the custom terminology.
*/
public var format: aws.sdk.kotlin.services.translate.model.TerminologyDataFormat? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.translate.model.TerminologyData) : this() {
this.directionality = x.directionality
this.file = x.file
this.format = x.format
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.translate.model.TerminologyData = TerminologyData(this)
internal fun correctErrors(): Builder {
if (file == null) file = ByteArray(0)
if (format == null) format = TerminologyDataFormat.SdkUnknown("no value provided")
return this
}
}
}