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

com.pulumi.googlenative.dialogflow.v2.kotlin.Intent.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.dialogflow.v2.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2ContextResponse
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentFollowupIntentInfoResponse
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentMessageResponse
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentParameterResponse
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentTrainingPhraseResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2ContextResponse.Companion.toKotlin as googleCloudDialogflowV2ContextResponseToKotlin
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentFollowupIntentInfoResponse.Companion.toKotlin as googleCloudDialogflowV2IntentFollowupIntentInfoResponseToKotlin
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentMessageResponse.Companion.toKotlin as googleCloudDialogflowV2IntentMessageResponseToKotlin
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentParameterResponse.Companion.toKotlin as googleCloudDialogflowV2IntentParameterResponseToKotlin
import com.pulumi.googlenative.dialogflow.v2.kotlin.outputs.GoogleCloudDialogflowV2IntentTrainingPhraseResponse.Companion.toKotlin as googleCloudDialogflowV2IntentTrainingPhraseResponseToKotlin

/**
 * Builder for [Intent].
 */
@PulumiTagMarker
public class IntentResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: IntentArgs = IntentArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend IntentArgsBuilder.() -> Unit) {
        val builder = IntentArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Intent {
        val builtJavaResource = com.pulumi.googlenative.dialogflow.v2.Intent(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Intent(builtJavaResource)
    }
}

/**
 * Creates an intent in the specified agent. Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
 * Auto-naming is currently not supported for this resource.
 */
public class Intent internal constructor(
    override val javaResource: com.pulumi.googlenative.dialogflow.v2.Intent,
) : KotlinCustomResource(javaResource, IntentMapper) {
    /**
     * Optional. The name of the action associated with the intent. Note: The action name must not contain whitespaces.
     */
    public val action: Output
        get() = javaResource.action().applyValue({ args0 -> args0 })

    /**
     * Optional. The list of platforms for which the first responses will be copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform).
     */
    public val defaultResponsePlatforms: Output>
        get() = javaResource.defaultResponsePlatforms().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            })
        })

    /**
     * The name of this intent.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Optional. Indicates that this intent ends an interaction. Some integrations (e.g., Actions on Google or Dialogflow phone gateway) use this information to close interaction with an end user. Default is false.
     */
    public val endInteraction: Output
        get() = javaResource.endInteraction().applyValue({ args0 -> args0 })

    /**
     * Optional. The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of the contexts must be present in the active user session for an event to trigger this intent. Event names are limited to 150 characters.
     */
    public val events: Output>
        get() = javaResource.events().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Read-only. Information about all followup intents that have this intent as a direct or indirect parent. We populate this field only in the output.
     */
    public val followupIntentInfo:
        Output>
        get() = javaResource.followupIntentInfo().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    googleCloudDialogflowV2IntentFollowupIntentInfoResponseToKotlin(args0)
                })
            })
        })

    /**
     * Optional. The list of context names required for this intent to be triggered. Format: `projects//agent/sessions/-/contexts/`.
     */
    public val inputContextNames: Output>
        get() = javaResource.inputContextNames().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Optional. The resource view to apply to the returned intent.
     */
    public val intentView: Output?
        get() = javaResource.intentView().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Optional. Indicates whether this is a fallback intent.
     */
    public val isFallback: Output
        get() = javaResource.isFallback().applyValue({ args0 -> args0 })

    /**
     * Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
     */
    public val languageCode: Output?
        get() = javaResource.languageCode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Optional. Indicates that a live agent should be brought in to handle the interaction with the user. In most cases, when you set this flag to true, you would also want to set end_interaction to true as well. Default is false.
     */
    public val liveAgentHandoff: Output
        get() = javaResource.liveAgentHandoff().applyValue({ args0 -> args0 })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Optional. The collection of rich messages corresponding to the `Response` field in the Dialogflow console.
     */
    public val messages: Output>
        get() = javaResource.messages().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    googleCloudDialogflowV2IntentMessageResponseToKotlin(args0)
                })
            })
        })

    /**
     * Optional. Indicates whether Machine Learning is disabled for the intent. Note: If `ml_disabled` setting is set to true, then this intent is not taken into account during inference in `ML ONLY` match mode. Also, auto-markup in the UI is turned off.
     */
    public val mlDisabled: Output
        get() = javaResource.mlDisabled().applyValue({ args0 -> args0 })

    /**
     * Optional. The unique identifier of this intent. Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: `projects//agent/intents/`.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Optional. The collection of contexts that are activated when the intent is matched. Context messages in this collection should not set the parameters field. Setting the `lifespan_count` to 0 will reset the context when the intent is matched. Format: `projects//agent/sessions/-/contexts/`.
     */
    public val outputContexts: Output>
        get() = javaResource.outputContexts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> googleCloudDialogflowV2ContextResponseToKotlin(args0) })
            })
        })

    /**
     * Optional. The collection of parameters associated with the intent.
     */
    public val parameters: Output>
        get() = javaResource.parameters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    googleCloudDialogflowV2IntentParameterResponseToKotlin(args0)
                })
            })
        })

    /**
     * Read-only after creation. The unique identifier of the parent intent in the chain of followup intents. You can set this field when creating an intent, for example with CreateIntent or BatchUpdateIntents, in order to make this intent a followup intent. It identifies the parent followup intent. Format: `projects//agent/intents/`.
     */
    public val parentFollowupIntentName: Output
        get() = javaResource.parentFollowupIntentName().applyValue({ args0 -> args0 })

    /**
     * Optional. The priority of this intent. Higher numbers represent higher priorities. - If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the `Normal` priority in the console. - If the supplied value is negative, the intent is ignored in runtime detect intent requests.
     */
    public val priority: Output
        get() = javaResource.priority().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Optional. Indicates whether to delete all contexts in the current session when this intent is matched.
     */
    public val resetContexts: Output
        get() = javaResource.resetContexts().applyValue({ args0 -> args0 })

    /**
     * Read-only. The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup intents chain for this intent. We populate this field only in the output. Format: `projects//agent/intents/`.
     */
    public val rootFollowupIntentName: Output
        get() = javaResource.rootFollowupIntentName().applyValue({ args0 -> args0 })

    /**
     * Optional. The collection of examples that the agent is trained on.
     */
    public val trainingPhrases: Output>
        get() = javaResource.trainingPhrases().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> googleCloudDialogflowV2IntentTrainingPhraseResponseToKotlin(args0) })
            })
        })

    /**
     * Optional. Indicates whether webhooks are enabled for the intent.
     */
    public val webhookState: Output
        get() = javaResource.webhookState().applyValue({ args0 -> args0 })
}

public object IntentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.dialogflow.v2.Intent::class == javaResource::class

    override fun map(javaResource: Resource): Intent = Intent(
        javaResource as
            com.pulumi.googlenative.dialogflow.v2.Intent,
    )
}

/**
 * @see [Intent].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Intent].
 */
public suspend fun intent(name: String, block: suspend IntentResourceBuilder.() -> Unit): Intent {
    val builder = IntentResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Intent].
 * @param name The _unique_ name of the resulting resource.
 */
public fun intent(name: String): Intent {
    val builder = IntentResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy