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

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

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The message object that provides the message text and its type.
 */
public class Message private constructor(builder: Builder) {
    /**
     * The text of the message.
     */
    public val content: kotlin.String = requireNotNull(builder.content) { "A non-null value must be provided for content" }
    /**
     * The content type of the message string.
     */
    public val contentType: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ContentType = requireNotNull(builder.contentType) { "A non-null value must be provided for contentType" }
    /**
     * Identifies the message group that the message belongs to. When a group is assigned to a message, Amazon Lex returns one message from each group in the response.
     */
    public val groupNumber: kotlin.Int? = builder.groupNumber

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

    override fun toString(): kotlin.String = buildString {
        append("Message(")
        append("content=$content,")
        append("contentType=$contentType,")
        append("groupNumber=$groupNumber")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = content.hashCode()
        result = 31 * result + (contentType.hashCode())
        result = 31 * result + (groupNumber ?: 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 (groupNumber != other.groupNumber) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The text of the message.
         */
        public var content: kotlin.String? = null
        /**
         * The content type of the message string.
         */
        public var contentType: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ContentType? = null
        /**
         * Identifies the message group that the message belongs to. When a group is assigned to a message, Amazon Lex returns one message from each group in the response.
         */
        public var groupNumber: kotlin.Int? = null

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy