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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains the default values for a slot. Default values are used when Amazon Lex hasn't determined a value for a slot.
 */
public class SlotDefaultValueSpec private constructor(builder: Builder) {
    /**
     * The default values for a slot. You can specify more than one default. For example, you can specify a default value to use from a matching context variable, a session attribute, or a fixed value.
     *
     * The default value chosen is selected based on the order that you specify them in the list. For example, if you specify a context variable and a fixed value in that order, Amazon Lex uses the context variable if it is available, else it uses the fixed value.
     */
    public val defaultValueList: List = requireNotNull(builder.defaultValueList) { "A non-null value must be provided for defaultValueList" }

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

    override fun toString(): kotlin.String = buildString {
        append("SlotDefaultValueSpec(")
        append("defaultValueList=$defaultValueList")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = defaultValueList.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 SlotDefaultValueSpec

        if (defaultValueList != other.defaultValueList) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The default values for a slot. You can specify more than one default. For example, you can specify a default value to use from a matching context variable, a session attribute, or a fixed value.
         *
         * The default value chosen is selected based on the order that you specify them in the list. For example, if you specify a context variable and a fixed value in that order, Amazon Lex uses the context variable if it is available, else it uses the fixed value.
         */
        public var defaultValueList: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotDefaultValueSpec) : this() {
            this.defaultValueList = x.defaultValueList
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy