commonMain.aws.sdk.kotlin.services.translate.model.InputDataConfig.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 input configuration properties for requesting a batch translation job.
*/
public class InputDataConfig private constructor(builder: Builder) {
/**
* Describes the format of the data that you submit to Amazon Translate as input. You can specify one of the following multipurpose internet mail extension (MIME) types:
* + `text/html`: The input data consists of one or more HTML files. Amazon Translate translates only the text that resides in the `html` element in each file.
* + `text/plain`: The input data consists of one or more unformatted text files. Amazon Translate translates every character in this type of input.
* + `application/vnd.openxmlformats-officedocument.wordprocessingml.document`: The input data consists of one or more Word documents (.docx).
* + `application/vnd.openxmlformats-officedocument.presentationml.presentation`: The input data consists of one or more PowerPoint Presentation files (.pptx).
* + `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`: The input data consists of one or more Excel Workbook files (.xlsx).
* + `application/x-xliff+xml`: The input data consists of one or more XML Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate supports only XLIFF version 1.2.
*
* If you structure your input data as HTML, ensure that you set this parameter to `text/html`. By doing so, you cut costs by limiting the translation to the contents of the `html` element in each file. Otherwise, if you set this parameter to `text/plain`, your costs will cover the translation of every character.
*/
public val contentType: kotlin.String = requireNotNull(builder.contentType) { "A non-null value must be provided for contentType" }
/**
* The URI of the AWS S3 folder that contains the input files. Amazon Translate translates all the files in the folder and all its sub-folders. The folder must be in the same Region as the API endpoint you are calling.
*/
public val s3Uri: kotlin.String = requireNotNull(builder.s3Uri) { "A non-null value must be provided for s3Uri" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.translate.model.InputDataConfig = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("InputDataConfig(")
append("contentType=$contentType,")
append("s3Uri=$s3Uri")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = contentType.hashCode()
result = 31 * result + (s3Uri.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 InputDataConfig
if (contentType != other.contentType) return false
if (s3Uri != other.s3Uri) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.translate.model.InputDataConfig = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Describes the format of the data that you submit to Amazon Translate as input. You can specify one of the following multipurpose internet mail extension (MIME) types:
* + `text/html`: The input data consists of one or more HTML files. Amazon Translate translates only the text that resides in the `html` element in each file.
* + `text/plain`: The input data consists of one or more unformatted text files. Amazon Translate translates every character in this type of input.
* + `application/vnd.openxmlformats-officedocument.wordprocessingml.document`: The input data consists of one or more Word documents (.docx).
* + `application/vnd.openxmlformats-officedocument.presentationml.presentation`: The input data consists of one or more PowerPoint Presentation files (.pptx).
* + `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`: The input data consists of one or more Excel Workbook files (.xlsx).
* + `application/x-xliff+xml`: The input data consists of one or more XML Localization Interchange File Format (XLIFF) files (.xlf). Amazon Translate supports only XLIFF version 1.2.
*
* If you structure your input data as HTML, ensure that you set this parameter to `text/html`. By doing so, you cut costs by limiting the translation to the contents of the `html` element in each file. Otherwise, if you set this parameter to `text/plain`, your costs will cover the translation of every character.
*/
public var contentType: kotlin.String? = null
/**
* The URI of the AWS S3 folder that contains the input files. Amazon Translate translates all the files in the folder and all its sub-folders. The folder must be in the same Region as the API endpoint you are calling.
*/
public var s3Uri: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.translate.model.InputDataConfig) : this() {
this.contentType = x.contentType
this.s3Uri = x.s3Uri
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.translate.model.InputDataConfig = InputDataConfig(this)
internal fun correctErrors(): Builder {
if (contentType == null) contentType = ""
if (s3Uri == null) s3Uri = ""
return this
}
}
}