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

commonMain.aws.sdk.kotlin.services.lexruntimev2.model.Message.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lexruntimev2.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Container for text that is returned to the customer..
 */
public class Message private constructor(builder: Builder) {
    /**
     * The text of the message.
     */
    public val content: kotlin.String? = builder.content
    /**
     * Indicates the type of response.
     */
    public val contentType: aws.sdk.kotlin.services.lexruntimev2.model.MessageContentType = requireNotNull(builder.contentType) { "A non-null value must be provided for contentType" }
    /**
     * A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
     *
     * When you use a response card, the response from the user is constrained to the text associated with a button on the card.
     */
    public val imageResponseCard: aws.sdk.kotlin.services.lexruntimev2.model.ImageResponseCard? = builder.imageResponseCard

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

    override fun toString(): kotlin.String = buildString {
        append("Message(")
        append("content=*** Sensitive Data Redacted ***,")
        append("contentType=$contentType,")
        append("imageResponseCard=$imageResponseCard")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = content?.hashCode() ?: 0
        result = 31 * result + (contentType.hashCode())
        result = 31 * result + (imageResponseCard?.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 Message

        if (content != other.content) return false
        if (contentType != other.contentType) return false
        if (imageResponseCard != other.imageResponseCard) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The text of the message.
         */
        public var content: kotlin.String? = null
        /**
         * Indicates the type of response.
         */
        public var contentType: aws.sdk.kotlin.services.lexruntimev2.model.MessageContentType? = null
        /**
         * A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.
         *
         * When you use a response card, the response from the user is constrained to the text associated with a button on the card.
         */
        public var imageResponseCard: aws.sdk.kotlin.services.lexruntimev2.model.ImageResponseCard? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexruntimev2.model.Message) : this() {
            this.content = x.content
            this.contentType = x.contentType
            this.imageResponseCard = x.imageResponseCard
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.lexruntimev2.model.ImageResponseCard] inside the given [block]
         */
        public fun imageResponseCard(block: aws.sdk.kotlin.services.lexruntimev2.model.ImageResponseCard.Builder.() -> kotlin.Unit) {
            this.imageResponseCard = aws.sdk.kotlin.services.lexruntimev2.model.ImageResponseCard.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (contentType == null) contentType = MessageContentType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy