commonMain.aws.sdk.kotlin.services.lexmodelbuildingservice.model.Slot.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
/**
* Identifies the version of a specific slot.
*/
public class Slot private constructor(builder: Builder) {
/**
* A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.
*/
public val defaultValueSpec: aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotDefaultValueSpec? = builder.defaultValueSpec
/**
* A description of the slot.
*/
public val description: kotlin.String? = builder.description
/**
* The name of the slot.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see [ Slot Obfuscation ](https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html).
*/
public val obfuscationSetting: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ObfuscationSetting? = builder.obfuscationSetting
/**
* Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.
*
* If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.
*/
public val priority: kotlin.Int? = builder.priority
/**
* A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.
*/
public val responseCard: kotlin.String? = builder.responseCard
/**
* If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.
*/
public val sampleUtterances: List? = builder.sampleUtterances
/**
* Specifies whether the slot is required or optional.
*/
public val slotConstraint: aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotConstraint = requireNotNull(builder.slotConstraint) { "A non-null value must be provided for slotConstraint" }
/**
* The type of the slot, either a custom slot type that you defined or one of the built-in slot types.
*/
public val slotType: kotlin.String? = builder.slotType
/**
* The version of the slot type.
*/
public val slotTypeVersion: kotlin.String? = builder.slotTypeVersion
/**
* The prompt that Amazon Lex uses to elicit the slot value from the user.
*/
public val valueElicitationPrompt: aws.sdk.kotlin.services.lexmodelbuildingservice.model.Prompt? = builder.valueElicitationPrompt
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lexmodelbuildingservice.model.Slot = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Slot(")
append("defaultValueSpec=$defaultValueSpec,")
append("description=$description,")
append("name=$name,")
append("obfuscationSetting=$obfuscationSetting,")
append("priority=$priority,")
append("responseCard=$responseCard,")
append("sampleUtterances=$sampleUtterances,")
append("slotConstraint=$slotConstraint,")
append("slotType=$slotType,")
append("slotTypeVersion=$slotTypeVersion,")
append("valueElicitationPrompt=$valueElicitationPrompt")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = defaultValueSpec?.hashCode() ?: 0
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (name.hashCode())
result = 31 * result + (obfuscationSetting?.hashCode() ?: 0)
result = 31 * result + (priority ?: 0)
result = 31 * result + (responseCard?.hashCode() ?: 0)
result = 31 * result + (sampleUtterances?.hashCode() ?: 0)
result = 31 * result + (slotConstraint.hashCode())
result = 31 * result + (slotType?.hashCode() ?: 0)
result = 31 * result + (slotTypeVersion?.hashCode() ?: 0)
result = 31 * result + (valueElicitationPrompt?.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 Slot
if (defaultValueSpec != other.defaultValueSpec) return false
if (description != other.description) return false
if (name != other.name) return false
if (obfuscationSetting != other.obfuscationSetting) return false
if (priority != other.priority) return false
if (responseCard != other.responseCard) return false
if (sampleUtterances != other.sampleUtterances) return false
if (slotConstraint != other.slotConstraint) return false
if (slotType != other.slotType) return false
if (slotTypeVersion != other.slotTypeVersion) return false
if (valueElicitationPrompt != other.valueElicitationPrompt) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.lexmodelbuildingservice.model.Slot = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.
*/
public var defaultValueSpec: aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotDefaultValueSpec? = null
/**
* A description of the slot.
*/
public var description: kotlin.String? = null
/**
* The name of the slot.
*/
public var name: kotlin.String? = null
/**
* Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see [ Slot Obfuscation ](https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html).
*/
public var obfuscationSetting: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ObfuscationSetting? = null
/**
* Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.
*
* If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.
*/
public var priority: kotlin.Int? = null
/**
* A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.
*/
public var responseCard: kotlin.String? = null
/**
* If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.
*/
public var sampleUtterances: List? = null
/**
* Specifies whether the slot is required or optional.
*/
public var slotConstraint: aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotConstraint? = null
/**
* The type of the slot, either a custom slot type that you defined or one of the built-in slot types.
*/
public var slotType: kotlin.String? = null
/**
* The version of the slot type.
*/
public var slotTypeVersion: kotlin.String? = null
/**
* The prompt that Amazon Lex uses to elicit the slot value from the user.
*/
public var valueElicitationPrompt: aws.sdk.kotlin.services.lexmodelbuildingservice.model.Prompt? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.lexmodelbuildingservice.model.Slot) : this() {
this.defaultValueSpec = x.defaultValueSpec
this.description = x.description
this.name = x.name
this.obfuscationSetting = x.obfuscationSetting
this.priority = x.priority
this.responseCard = x.responseCard
this.sampleUtterances = x.sampleUtterances
this.slotConstraint = x.slotConstraint
this.slotType = x.slotType
this.slotTypeVersion = x.slotTypeVersion
this.valueElicitationPrompt = x.valueElicitationPrompt
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lexmodelbuildingservice.model.Slot = Slot(this)
/**
* construct an [aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotDefaultValueSpec] inside the given [block]
*/
public fun defaultValueSpec(block: aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotDefaultValueSpec.Builder.() -> kotlin.Unit) {
this.defaultValueSpec = aws.sdk.kotlin.services.lexmodelbuildingservice.model.SlotDefaultValueSpec.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.lexmodelbuildingservice.model.Prompt] inside the given [block]
*/
public fun valueElicitationPrompt(block: aws.sdk.kotlin.services.lexmodelbuildingservice.model.Prompt.Builder.() -> kotlin.Unit) {
this.valueElicitationPrompt = aws.sdk.kotlin.services.lexmodelbuildingservice.model.Prompt.invoke(block)
}
internal fun correctErrors(): Builder {
if (name == null) name = ""
if (slotConstraint == null) slotConstraint = SlotConstraint.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy