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

com.pulumi.awsnative.lex.kotlin.inputs.BotPromptSpecificationArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.lex.kotlin.inputs

import com.pulumi.awsnative.lex.inputs.BotPromptSpecificationArgs.builder
import com.pulumi.awsnative.lex.kotlin.enums.BotMessageSelectionStrategy
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Prompts the user to confirm the intent.
 * @property allowInterrupt Indicates whether the user can interrupt a speech prompt from the bot.
 * @property maxRetries The maximum number of times the bot tries to elicit a response from the user using this prompt.
 * @property messageGroupsList A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
 * @property messageSelectionStrategy Indicates how a message is selected from a message group among retries.
 * @property promptAttemptsSpecification Specifies the advanced settings on each attempt of the prompt.
 */
public data class BotPromptSpecificationArgs(
    public val allowInterrupt: Output? = null,
    public val maxRetries: Output,
    public val messageGroupsList: Output>,
    public val messageSelectionStrategy: Output? = null,
    public val promptAttemptsSpecification: Output>? =
        null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.lex.inputs.BotPromptSpecificationArgs =
        com.pulumi.awsnative.lex.inputs.BotPromptSpecificationArgs.builder()
            .allowInterrupt(allowInterrupt?.applyValue({ args0 -> args0 }))
            .maxRetries(maxRetries.applyValue({ args0 -> args0 }))
            .messageGroupsList(
                messageGroupsList.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .messageSelectionStrategy(
                messageSelectionStrategy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .promptAttemptsSpecification(
                promptAttemptsSpecification?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value.let({ args0 -> args0.toJava() }))
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [BotPromptSpecificationArgs].
 */
@PulumiTagMarker
public class BotPromptSpecificationArgsBuilder internal constructor() {
    private var allowInterrupt: Output? = null

    private var maxRetries: Output? = null

    private var messageGroupsList: Output>? = null

    private var messageSelectionStrategy: Output? = null

    private var promptAttemptsSpecification: Output>? =
        null

    /**
     * @param value Indicates whether the user can interrupt a speech prompt from the bot.
     */
    @JvmName("nmnlyeulwxkotatr")
    public suspend fun allowInterrupt(`value`: Output) {
        this.allowInterrupt = value
    }

    /**
     * @param value The maximum number of times the bot tries to elicit a response from the user using this prompt.
     */
    @JvmName("craroiehsmkcdxgj")
    public suspend fun maxRetries(`value`: Output) {
        this.maxRetries = value
    }

    /**
     * @param value A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("qxjjjetdbwpixsct")
    public suspend fun messageGroupsList(`value`: Output>) {
        this.messageGroupsList = value
    }

    @JvmName("ejvywdtqhgsrdjrb")
    public suspend fun messageGroupsList(vararg values: Output) {
        this.messageGroupsList = Output.all(values.asList())
    }

    /**
     * @param values A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("elmrvoycdehlucje")
    public suspend fun messageGroupsList(values: List>) {
        this.messageGroupsList = Output.all(values)
    }

    /**
     * @param value Indicates how a message is selected from a message group among retries.
     */
    @JvmName("rxqibfsxqvegemlu")
    public suspend fun messageSelectionStrategy(`value`: Output) {
        this.messageSelectionStrategy = value
    }

    /**
     * @param value Specifies the advanced settings on each attempt of the prompt.
     */
    @JvmName("tkvrgjlerpyknmsl")
    public suspend fun promptAttemptsSpecification(`value`: Output>) {
        this.promptAttemptsSpecification = value
    }

    /**
     * @param value Indicates whether the user can interrupt a speech prompt from the bot.
     */
    @JvmName("puuqoamraosfmsie")
    public suspend fun allowInterrupt(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowInterrupt = mapped
    }

    /**
     * @param value The maximum number of times the bot tries to elicit a response from the user using this prompt.
     */
    @JvmName("qetxflswoufwkkwx")
    public suspend fun maxRetries(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxRetries = mapped
    }

    /**
     * @param value A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("wusjmwbfjmngylmg")
    public suspend fun messageGroupsList(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.messageGroupsList = mapped
    }

    /**
     * @param argument A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("pmsybjlnwxeffytt")
    public suspend fun messageGroupsList(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BotMessageGroupArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.messageGroupsList = mapped
    }

    /**
     * @param argument A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("ltbxptfuxttryqdv")
    public suspend fun messageGroupsList(vararg argument: suspend BotMessageGroupArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BotMessageGroupArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.messageGroupsList = mapped
    }

    /**
     * @param argument A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("rhvtmmxwbmsuelvs")
    public suspend fun messageGroupsList(argument: suspend BotMessageGroupArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(BotMessageGroupArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.messageGroupsList = mapped
    }

    /**
     * @param values A collection of messages that Amazon Lex can send to the user. Amazon Lex chooses the actual message to send at runtime.
     */
    @JvmName("dolrhodortxnhewn")
    public suspend fun messageGroupsList(vararg values: BotMessageGroupArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.messageGroupsList = mapped
    }

    /**
     * @param value Indicates how a message is selected from a message group among retries.
     */
    @JvmName("ouyxnpaydwhhuqlu")
    public suspend fun messageSelectionStrategy(`value`: BotMessageSelectionStrategy?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.messageSelectionStrategy = mapped
    }

    /**
     * @param value Specifies the advanced settings on each attempt of the prompt.
     */
    @JvmName("gniavpppcwstpwrl")
    public suspend fun promptAttemptsSpecification(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.promptAttemptsSpecification = mapped
    }

    /**
     * @param argument Specifies the advanced settings on each attempt of the prompt.
     */
    @JvmName("qptxamajlaiyxrft")
    public suspend fun promptAttemptsSpecification(vararg argument: Pair Unit>) {
        val toBeMapped = argument.toList().map { (left, right) ->
            left to
                BotPromptAttemptSpecificationArgsBuilder().applySuspend { right() }.build()
        }.toMap()
        val mapped = of(toBeMapped)
        this.promptAttemptsSpecification = mapped
    }

    /**
     * @param values Specifies the advanced settings on each attempt of the prompt.
     */
    @JvmName("hkfsweclboxibfpd")
    public fun promptAttemptsSpecification(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.promptAttemptsSpecification = mapped
    }

    internal fun build(): BotPromptSpecificationArgs = BotPromptSpecificationArgs(
        allowInterrupt = allowInterrupt,
        maxRetries = maxRetries ?: throw PulumiNullFieldException("maxRetries"),
        messageGroupsList = messageGroupsList ?: throw PulumiNullFieldException("messageGroupsList"),
        messageSelectionStrategy = messageSelectionStrategy,
        promptAttemptsSpecification = promptAttemptsSpecification,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy