CxWebhookArgs

data class CxWebhookArgs(val disabled: Output<Boolean>? = null, val displayName: Output<String>? = null, val enableSpellCorrection: Output<Boolean>? = null, val enableStackdriverLogging: Output<Boolean>? = null, val genericWebService: Output<CxWebhookGenericWebServiceArgs>? = null, val parent: Output<String>? = null, val securitySettings: Output<String>? = null, val serviceDirectory: Output<CxWebhookServiceDirectoryArgs>? = null, val timeout: Output<String>? = null) : ConvertibleToJava<CxWebhookArgs>

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:

Example Usage

Dialogflowcx Webhook Full

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",
},
});
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={
"enable_speech_adaptation": True,
})
basic_webhook = gcp.diagflow.CxWebhook("basic_webhook",
parent=agent.id,
display_name="MyFlow",
generic_web_service={
"uri": "https://example.com",
})
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",
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
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());
}
}
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:

$ pulumi import gcp:diagflow/cxWebhook:CxWebhook default {{parent}}/webhooks/{{name}}
$ pulumi import gcp:diagflow/cxWebhook:CxWebhook default {{parent}}/{{name}}

Constructors

Link copied to clipboard
constructor(disabled: Output<Boolean>? = null, displayName: Output<String>? = null, enableSpellCorrection: Output<Boolean>? = null, enableStackdriverLogging: Output<Boolean>? = null, genericWebService: Output<CxWebhookGenericWebServiceArgs>? = null, parent: Output<String>? = null, securitySettings: Output<String>? = null, serviceDirectory: Output<CxWebhookServiceDirectoryArgs>? = null, timeout: Output<String>? = null)

Properties

Link copied to clipboard
val disabled: Output<Boolean>? = null

Indicates whether the webhook is disabled.

Link copied to clipboard
val displayName: Output<String>? = null

The human-readable name of the webhook, unique within the agent.

Link copied to clipboard
val enableSpellCorrection: Output<Boolean>? = null

Indicates if automatic spell correction is enabled in detect intent requests.

Link copied to clipboard
val enableStackdriverLogging: Output<Boolean>? = null

Determines whether this agent should log conversation queries.

Link copied to clipboard

Configuration for a generic web service. Structure is documented below.

Link copied to clipboard
val parent: Output<String>? = null

The agent to create a webhook for. Format: projects//locations//agents/.

Link copied to clipboard
val securitySettings: Output<String>? = null

Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/.

Link copied to clipboard

Configuration for a Service Directory service. Structure is documented below.

Link copied to clipboard
val timeout: Output<String>? = null

Webhook execution timeout.

Functions

Link copied to clipboard
open override fun toJava(): CxWebhookArgs