commonMain.aws.sdk.kotlin.services.translate.model.Language.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
/**
* A supported language.
*/
public class Language private constructor(builder: Builder) {
/**
* Language code for the supported language.
*/
public val languageCode: kotlin.String = requireNotNull(builder.languageCode) { "A non-null value must be provided for languageCode" }
/**
* Language name of the supported language.
*/
public val languageName: kotlin.String = requireNotNull(builder.languageName) { "A non-null value must be provided for languageName" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.translate.model.Language = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Language(")
append("languageCode=$languageCode,")
append("languageName=$languageName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = languageCode.hashCode()
result = 31 * result + (languageName.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 Language
if (languageCode != other.languageCode) return false
if (languageName != other.languageName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.translate.model.Language = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Language code for the supported language.
*/
public var languageCode: kotlin.String? = null
/**
* Language name of the supported language.
*/
public var languageName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.translate.model.Language) : this() {
this.languageCode = x.languageCode
this.languageName = x.languageName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.translate.model.Language = Language(this)
internal fun correctErrors(): Builder {
if (languageCode == null) languageCode = ""
if (languageName == null) languageName = ""
return this
}
}
}