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

com.pulumi.googlenative.dialogflow.v3.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.v3.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.dialogflow.v3.kotlin.outputs.GoogleCloudDialogflowCxV3IntentParameterResponse
import com.pulumi.googlenative.dialogflow.v3.kotlin.outputs.GoogleCloudDialogflowCxV3IntentTrainingPhraseResponse
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 kotlin.collections.Map
import com.pulumi.googlenative.dialogflow.v3.kotlin.outputs.GoogleCloudDialogflowCxV3IntentParameterResponse.Companion.toKotlin as googleCloudDialogflowCxV3IntentParameterResponseToKotlin
import com.pulumi.googlenative.dialogflow.v3.kotlin.outputs.GoogleCloudDialogflowCxV3IntentTrainingPhraseResponse.Companion.toKotlin as googleCloudDialogflowCxV3IntentTrainingPhraseResponseToKotlin

/**
 * 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.v3.Intent(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Intent(builtJavaResource)
    }
}

/**
 * Creates an intent in the specified agent. Note: You should always train a flow prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
 */
public class Intent internal constructor(
    override val javaResource: com.pulumi.googlenative.dialogflow.v3.Intent,
) : KotlinCustomResource(javaResource, IntentMapper) {
    public val agentId: Output
        get() = javaResource.agentId().applyValue({ args0 -> args0 })

    /**
     * Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * The human-readable name of the intent, unique within the agent.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Indicates whether this is a fallback intent. Currently only default fallback intent is allowed in the agent, which is added upon agent creation. Adding training phrases to fallback intent is useful in the case of requests that are mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event.
     */
    public val isFallback: Output
        get() = javaResource.isFallback().applyValue({ args0 -> args0 })

    /**
     * The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include: * sys-head * sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys.contextual" means the intent is a contextual intent.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The language of the following fields in `intent`: * `Intent.training_phrases.parts.text` If not specified, the agent's default language is used. [Many languages](https://cloud.google.com/dialogflow/cx/docs/reference/language) are supported. Note: languages must be enabled in the agent before they can be used.
     */
    public val languageCode: Output?
        get() = javaResource.languageCode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: `projects//locations//agents//intents/`.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

    /**
     * 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 })

    /**
     * The collection of training phrases the agent is trained on to identify the intent.
     */
    public val trainingPhrases: Output>
        get() = javaResource.trainingPhrases().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    googleCloudDialogflowCxV3IntentTrainingPhraseResponseToKotlin(args0)
                })
            })
        })
}

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

    override fun map(javaResource: Resource): Intent = Intent(
        javaResource as
            com.pulumi.googlenative.dialogflow.v3.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