All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.lexmodelbuildingservice.model.Statement.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.lexmodelbuildingservice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A collection of messages that convey information to the user. At runtime, Amazon Lex selects the message to convey.
 */
public class Statement private constructor(builder: Builder) {
    /**
     * A collection of message objects.
     */
    public val messages: List = requireNotNull(builder.messages) { "A non-null value must be provided for messages" }
    /**
     * At runtime, if the client is using the [PostText](http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html) API, Amazon Lex includes the response card in the response. It substitutes all of the session attributes and slot values for placeholders in the response card.
     */
    public val responseCard: kotlin.String? = builder.responseCard

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lexmodelbuildingservice.model.Statement = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("Statement(")
        append("messages=$messages,")
        append("responseCard=$responseCard")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = messages.hashCode()
        result = 31 * result + (responseCard?.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 Statement

        if (messages != other.messages) return false
        if (responseCard != other.responseCard) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.lexmodelbuildingservice.model.Statement = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * A collection of message objects.
         */
        public var messages: List? = null
        /**
         * At runtime, if the client is using the [PostText](http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html) API, Amazon Lex includes the response card in the response. It substitutes all of the session attributes and slot values for placeholders in the response card.
         */
        public var responseCard: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexmodelbuildingservice.model.Statement) : this() {
            this.messages = x.messages
            this.responseCard = x.responseCard
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.lexmodelbuildingservice.model.Statement = Statement(this)

        internal fun correctErrors(): Builder {
            if (messages == null) messages = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy