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

commonMain.aws.sdk.kotlin.services.lexruntimev2.model.Value.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

/**
 * Information about the value provided for a slot and Amazon Lex V2's interpretation.
 */
public class Value private constructor(builder: Builder) {
    /**
     * The value that Amazon Lex V2 determines for the slot, given the user input. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the `resolvedValues` list.
     */
    public val interpretedValue: kotlin.String = requireNotNull(builder.interpretedValue) { "A non-null value must be provided for interpretedValue" }
    /**
     * The part of the user's response to the slot elicitation that Amazon Lex V2 determines is relevant to the slot value.
     */
    public val originalValue: kotlin.String? = builder.originalValue
    /**
     * A list of values that Amazon Lex V2 determines are possible resolutions for the user input. The first value matches the `interpretedValue`.
     */
    public val resolvedValues: List? = builder.resolvedValues

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

    override fun toString(): kotlin.String = buildString {
        append("Value(")
        append("interpretedValue=$interpretedValue,")
        append("originalValue=$originalValue,")
        append("resolvedValues=$resolvedValues")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = interpretedValue.hashCode()
        result = 31 * result + (originalValue?.hashCode() ?: 0)
        result = 31 * result + (resolvedValues?.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 Value

        if (interpretedValue != other.interpretedValue) return false
        if (originalValue != other.originalValue) return false
        if (resolvedValues != other.resolvedValues) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The value that Amazon Lex V2 determines for the slot, given the user input. The actual value depends on the setting of the value selection strategy for the bot. You can choose to use the value entered by the user, or you can have Amazon Lex V2 choose the first value in the `resolvedValues` list.
         */
        public var interpretedValue: kotlin.String? = null
        /**
         * The part of the user's response to the slot elicitation that Amazon Lex V2 determines is relevant to the slot value.
         */
        public var originalValue: kotlin.String? = null
        /**
         * A list of values that Amazon Lex V2 determines are possible resolutions for the user input. The first value matches the `interpretedValue`.
         */
        public var resolvedValues: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexruntimev2.model.Value) : this() {
            this.interpretedValue = x.interpretedValue
            this.originalValue = x.originalValue
            this.resolvedValues = x.resolvedValues
        }

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

        internal fun correctErrors(): Builder {
            if (interpretedValue == null) interpretedValue = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy