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

com.pulumi.gcp.diagflow.kotlin.CxWebhookArgs.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.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.diagflow.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.diagflow.CxWebhookArgs.builder
import com.pulumi.gcp.diagflow.kotlin.inputs.CxWebhookGenericWebServiceArgs
import com.pulumi.gcp.diagflow.kotlin.inputs.CxWebhookGenericWebServiceArgsBuilder
import com.pulumi.gcp.diagflow.kotlin.inputs.CxWebhookServiceDirectoryArgs
import com.pulumi.gcp.diagflow.kotlin.inputs.CxWebhookServiceDirectoryArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Webhooks host the developer's business logic. During a session, webhooks allow the developer to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend.
 * To get more information about Webhook, see:
 * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.webhooks)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
 * ## Example Usage
 * ### Dialogflowcx Webhook Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const agent = new gcp.diagflow.CxAgent("agent", {
 *     displayName: "dialogflowcx-agent",
 *     location: "global",
 *     defaultLanguageCode: "en",
 *     supportedLanguageCodes: [
 *         "it",
 *         "de",
 *         "es",
 *     ],
 *     timeZone: "America/New_York",
 *     description: "Example description.",
 *     avatarUri: "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *     enableStackdriverLogging: true,
 *     enableSpellCorrection: true,
 *     speechToTextSettings: {
 *         enableSpeechAdaptation: true,
 *     },
 * });
 * const basicWebhook = new gcp.diagflow.CxWebhook("basic_webhook", {
 *     parent: agent.id,
 *     displayName: "MyFlow",
 *     genericWebService: {
 *         uri: "https://example.com",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * agent = gcp.diagflow.CxAgent("agent",
 *     display_name="dialogflowcx-agent",
 *     location="global",
 *     default_language_code="en",
 *     supported_language_codes=[
 *         "it",
 *         "de",
 *         "es",
 *     ],
 *     time_zone="America/New_York",
 *     description="Example description.",
 *     avatar_uri="https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *     enable_stackdriver_logging=True,
 *     enable_spell_correction=True,
 *     speech_to_text_settings=gcp.diagflow.CxAgentSpeechToTextSettingsArgs(
 *         enable_speech_adaptation=True,
 *     ))
 * basic_webhook = gcp.diagflow.CxWebhook("basic_webhook",
 *     parent=agent.id,
 *     display_name="MyFlow",
 *     generic_web_service=gcp.diagflow.CxWebhookGenericWebServiceArgs(
 *         uri="https://example.com",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var agent = new Gcp.Diagflow.CxAgent("agent", new()
 *     {
 *         DisplayName = "dialogflowcx-agent",
 *         Location = "global",
 *         DefaultLanguageCode = "en",
 *         SupportedLanguageCodes = new[]
 *         {
 *             "it",
 *             "de",
 *             "es",
 *         },
 *         TimeZone = "America/New_York",
 *         Description = "Example description.",
 *         AvatarUri = "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *         EnableStackdriverLogging = true,
 *         EnableSpellCorrection = true,
 *         SpeechToTextSettings = new Gcp.Diagflow.Inputs.CxAgentSpeechToTextSettingsArgs
 *         {
 *             EnableSpeechAdaptation = true,
 *         },
 *     });
 *     var basicWebhook = new Gcp.Diagflow.CxWebhook("basic_webhook", new()
 *     {
 *         Parent = agent.Id,
 *         DisplayName = "MyFlow",
 *         GenericWebService = new Gcp.Diagflow.Inputs.CxWebhookGenericWebServiceArgs
 *         {
 *             Uri = "https://example.com",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/diagflow"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		agent, err := diagflow.NewCxAgent(ctx, "agent", &diagflow.CxAgentArgs{
 * 			DisplayName:         pulumi.String("dialogflowcx-agent"),
 * 			Location:            pulumi.String("global"),
 * 			DefaultLanguageCode: pulumi.String("en"),
 * 			SupportedLanguageCodes: pulumi.StringArray{
 * 				pulumi.String("it"),
 * 				pulumi.String("de"),
 * 				pulumi.String("es"),
 * 			},
 * 			TimeZone:                 pulumi.String("America/New_York"),
 * 			Description:              pulumi.String("Example description."),
 * 			AvatarUri:                pulumi.String("https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png"),
 * 			EnableStackdriverLogging: pulumi.Bool(true),
 * 			EnableSpellCorrection:    pulumi.Bool(true),
 * 			SpeechToTextSettings: &diagflow.CxAgentSpeechToTextSettingsArgs{
 * 				EnableSpeechAdaptation: pulumi.Bool(true),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = diagflow.NewCxWebhook(ctx, "basic_webhook", &diagflow.CxWebhookArgs{
 * 			Parent:      agent.ID(),
 * 			DisplayName: pulumi.String("MyFlow"),
 * 			GenericWebService: &diagflow.CxWebhookGenericWebServiceArgs{
 * 				Uri: pulumi.String("https://example.com"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.diagflow.CxAgent;
 * import com.pulumi.gcp.diagflow.CxAgentArgs;
 * import com.pulumi.gcp.diagflow.inputs.CxAgentSpeechToTextSettingsArgs;
 * import com.pulumi.gcp.diagflow.CxWebhook;
 * import com.pulumi.gcp.diagflow.CxWebhookArgs;
 * import com.pulumi.gcp.diagflow.inputs.CxWebhookGenericWebServiceArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var agent = new CxAgent("agent", CxAgentArgs.builder()
 *             .displayName("dialogflowcx-agent")
 *             .location("global")
 *             .defaultLanguageCode("en")
 *             .supportedLanguageCodes(
 *                 "it",
 *                 "de",
 *                 "es")
 *             .timeZone("America/New_York")
 *             .description("Example description.")
 *             .avatarUri("https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png")
 *             .enableStackdriverLogging(true)
 *             .enableSpellCorrection(true)
 *             .speechToTextSettings(CxAgentSpeechToTextSettingsArgs.builder()
 *                 .enableSpeechAdaptation(true)
 *                 .build())
 *             .build());
 *         var basicWebhook = new CxWebhook("basicWebhook", CxWebhookArgs.builder()
 *             .parent(agent.id())
 *             .displayName("MyFlow")
 *             .genericWebService(CxWebhookGenericWebServiceArgs.builder()
 *                 .uri("https://example.com")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   agent:
 *     type: gcp:diagflow:CxAgent
 *     properties:
 *       displayName: dialogflowcx-agent
 *       location: global
 *       defaultLanguageCode: en
 *       supportedLanguageCodes:
 *         - it
 *         - de
 *         - es
 *       timeZone: America/New_York
 *       description: Example description.
 *       avatarUri: https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png
 *       enableStackdriverLogging: true
 *       enableSpellCorrection: true
 *       speechToTextSettings:
 *         enableSpeechAdaptation: true
 *   basicWebhook:
 *     type: gcp:diagflow:CxWebhook
 *     name: basic_webhook
 *     properties:
 *       parent: ${agent.id}
 *       displayName: MyFlow
 *       genericWebService:
 *         uri: https://example.com
 * ```
 * 
 * ## Import
 * Webhook can be imported using any of these accepted formats:
 * * `{{parent}}/webhooks/{{name}}`
 * * `{{parent}}/{{name}}`
 * When using the `pulumi import` command, Webhook can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:diagflow/cxWebhook:CxWebhook default {{parent}}/webhooks/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:diagflow/cxWebhook:CxWebhook default {{parent}}/{{name}}
 * ```
 * @property disabled Indicates whether the webhook is disabled.
 * @property displayName The human-readable name of the webhook, unique within the agent.
 * - - -
 * @property enableSpellCorrection Indicates if automatic spell correction is enabled in detect intent requests.
 * @property enableStackdriverLogging Determines whether this agent should log conversation queries.
 * @property genericWebService Configuration for a generic web service.
 * Structure is documented below.
 * @property parent The agent to create a webhook for.
 * Format: projects//locations//agents/.
 * @property securitySettings Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/.
 * @property serviceDirectory Configuration for a Service Directory service.
 * Structure is documented below.
 * @property timeout Webhook execution timeout.
 */
public data class CxWebhookArgs(
    public val disabled: Output? = null,
    public val displayName: Output? = null,
    public val enableSpellCorrection: Output? = null,
    public val enableStackdriverLogging: Output? = null,
    public val genericWebService: Output? = null,
    public val parent: Output? = null,
    public val securitySettings: Output? = null,
    public val serviceDirectory: Output? = null,
    public val timeout: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.diagflow.CxWebhookArgs =
        com.pulumi.gcp.diagflow.CxWebhookArgs.builder()
            .disabled(disabled?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .enableSpellCorrection(enableSpellCorrection?.applyValue({ args0 -> args0 }))
            .enableStackdriverLogging(enableStackdriverLogging?.applyValue({ args0 -> args0 }))
            .genericWebService(genericWebService?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .parent(parent?.applyValue({ args0 -> args0 }))
            .securitySettings(securitySettings?.applyValue({ args0 -> args0 }))
            .serviceDirectory(serviceDirectory?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .timeout(timeout?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CxWebhookArgs].
 */
@PulumiTagMarker
public class CxWebhookArgsBuilder internal constructor() {
    private var disabled: Output? = null

    private var displayName: Output? = null

    private var enableSpellCorrection: Output? = null

    private var enableStackdriverLogging: Output? = null

    private var genericWebService: Output? = null

    private var parent: Output? = null

    private var securitySettings: Output? = null

    private var serviceDirectory: Output? = null

    private var timeout: Output? = null

    /**
     * @param value Indicates whether the webhook is disabled.
     */
    @JvmName("pxyxtlvghohiikmg")
    public suspend fun disabled(`value`: Output) {
        this.disabled = value
    }

    /**
     * @param value The human-readable name of the webhook, unique within the agent.
     * - - -
     */
    @JvmName("mvtyecxsmiktkfta")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Indicates if automatic spell correction is enabled in detect intent requests.
     */
    @JvmName("riqucnwbrsisvofe")
    public suspend fun enableSpellCorrection(`value`: Output) {
        this.enableSpellCorrection = value
    }

    /**
     * @param value Determines whether this agent should log conversation queries.
     */
    @JvmName("ckiartjrboblthus")
    public suspend fun enableStackdriverLogging(`value`: Output) {
        this.enableStackdriverLogging = value
    }

    /**
     * @param value Configuration for a generic web service.
     * Structure is documented below.
     */
    @JvmName("xkeuldecrqosyipe")
    public suspend fun genericWebService(`value`: Output) {
        this.genericWebService = value
    }

    /**
     * @param value The agent to create a webhook for.
     * Format: projects//locations//agents/.
     */
    @JvmName("daqsibpatopeeots")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/.
     */
    @JvmName("bqqxrnogjcapeskb")
    public suspend fun securitySettings(`value`: Output) {
        this.securitySettings = value
    }

    /**
     * @param value Configuration for a Service Directory service.
     * Structure is documented below.
     */
    @JvmName("tkolkpsqybnktbem")
    public suspend fun serviceDirectory(`value`: Output) {
        this.serviceDirectory = value
    }

    /**
     * @param value Webhook execution timeout.
     */
    @JvmName("wuxhbapkjcgjcjtk")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value Indicates whether the webhook is disabled.
     */
    @JvmName("eeuqfgqbmbpscekv")
    public suspend fun disabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disabled = mapped
    }

    /**
     * @param value The human-readable name of the webhook, unique within the agent.
     * - - -
     */
    @JvmName("hacjpcbiplffdjyx")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Indicates if automatic spell correction is enabled in detect intent requests.
     */
    @JvmName("yebjytorxxokxttn")
    public suspend fun enableSpellCorrection(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableSpellCorrection = mapped
    }

    /**
     * @param value Determines whether this agent should log conversation queries.
     */
    @JvmName("oljoepuimokydymj")
    public suspend fun enableStackdriverLogging(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableStackdriverLogging = mapped
    }

    /**
     * @param value Configuration for a generic web service.
     * Structure is documented below.
     */
    @JvmName("uvncxyyrqxipqrlf")
    public suspend fun genericWebService(`value`: CxWebhookGenericWebServiceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.genericWebService = mapped
    }

    /**
     * @param argument Configuration for a generic web service.
     * Structure is documented below.
     */
    @JvmName("coghbrceaxidamnv")
    public suspend fun genericWebService(argument: suspend CxWebhookGenericWebServiceArgsBuilder.() -> Unit) {
        val toBeMapped = CxWebhookGenericWebServiceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.genericWebService = mapped
    }

    /**
     * @param value The agent to create a webhook for.
     * Format: projects//locations//agents/.
     */
    @JvmName("xkbgjrjtnmlhyaba")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    /**
     * @param value Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/.
     */
    @JvmName("kfmkcnqfcvfmtpbe")
    public suspend fun securitySettings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.securitySettings = mapped
    }

    /**
     * @param value Configuration for a Service Directory service.
     * Structure is documented below.
     */
    @JvmName("jqwlrujptpclxnyn")
    public suspend fun serviceDirectory(`value`: CxWebhookServiceDirectoryArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceDirectory = mapped
    }

    /**
     * @param argument Configuration for a Service Directory service.
     * Structure is documented below.
     */
    @JvmName("pocrpwhrnydjvhao")
    public suspend fun serviceDirectory(argument: suspend CxWebhookServiceDirectoryArgsBuilder.() -> Unit) {
        val toBeMapped = CxWebhookServiceDirectoryArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.serviceDirectory = mapped
    }

    /**
     * @param value Webhook execution timeout.
     */
    @JvmName("sbhqfjvqefkstctj")
    public suspend fun timeout(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    internal fun build(): CxWebhookArgs = CxWebhookArgs(
        disabled = disabled,
        displayName = displayName,
        enableSpellCorrection = enableSpellCorrection,
        enableStackdriverLogging = enableStackdriverLogging,
        genericWebService = genericWebService,
        parent = parent,
        securitySettings = securitySettings,
        serviceDirectory = serviceDirectory,
        timeout = timeout,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy