commonMain.aws.sdk.kotlin.services.lexruntimeservice.model.Button.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lexruntimeservice-jvm Show documentation
Show all versions of lexruntimeservice-jvm Show documentation
The AWS Kotlin client for Lex Runtime Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.lexruntimeservice.model
/**
* Represents an option to be shown on the client platform (Facebook, Slack, etc.)
*/
public class Button private constructor(builder: Builder) {
/**
* Text that is visible to the user on the button.
*/
public val text: kotlin.String = requireNotNull(builder.text) { "A non-null value must be provided for text" }
/**
* The value sent to Amazon Lex when a user chooses the button. For example, consider button text "NYC." When the user chooses the button, the value sent can be "New York City."
*/
public val value: kotlin.String = requireNotNull(builder.value) { "A non-null value must be provided for value" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lexruntimeservice.model.Button = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Button(")
append("text=$text,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = text.hashCode()
result = 31 * result + (value.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 Button
if (text != other.text) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.lexruntimeservice.model.Button = Builder(this).apply(block).build()
public class Builder {
/**
* Text that is visible to the user on the button.
*/
public var text: kotlin.String? = null
/**
* The value sent to Amazon Lex when a user chooses the button. For example, consider button text "NYC." When the user chooses the button, the value sent can be "New York City."
*/
public var value: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.lexruntimeservice.model.Button) : this() {
this.text = x.text
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lexruntimeservice.model.Button = Button(this)
internal fun correctErrors(): Builder {
if (text == null) text = ""
if (value == null) value = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy