commonMain.aws.sdk.kotlin.services.translate.model.UnsupportedLanguagePairException.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
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* Amazon Translate does not support translation from the language of the source text into the requested target language. For more information, see [Supported languages](https://docs.aws.amazon.com/translate/latest/dg/what-is-languages.html).
*/
public class UnsupportedLanguagePairException private constructor(builder: Builder) : TranslateException(builder.message) {
/**
* The language code for the language of the input text.
*/
public val sourceLanguageCode: kotlin.String? = builder.sourceLanguageCode
/**
* The language code for the language of the translated text.
*/
public val targetLanguageCode: kotlin.String? = builder.targetLanguageCode
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.translate.model.UnsupportedLanguagePairException = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("UnsupportedLanguagePairException(")
append("message=$message,")
append("sourceLanguageCode=$sourceLanguageCode,")
append("targetLanguageCode=$targetLanguageCode")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = message?.hashCode() ?: 0
result = 31 * result + (sourceLanguageCode?.hashCode() ?: 0)
result = 31 * result + (targetLanguageCode?.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 UnsupportedLanguagePairException
if (message != other.message) return false
if (sourceLanguageCode != other.sourceLanguageCode) return false
if (targetLanguageCode != other.targetLanguageCode) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.translate.model.UnsupportedLanguagePairException = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
public var message: kotlin.String? = null
/**
* The language code for the language of the input text.
*/
public var sourceLanguageCode: kotlin.String? = null
/**
* The language code for the language of the translated text.
*/
public var targetLanguageCode: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.translate.model.UnsupportedLanguagePairException) : this() {
this.message = x.message
this.sourceLanguageCode = x.sourceLanguageCode
this.targetLanguageCode = x.targetLanguageCode
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.translate.model.UnsupportedLanguagePairException = UnsupportedLanguagePairException(this)
internal fun correctErrors(): Builder {
return this
}
}
}