import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 Standard * * ```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 standardWebhook = new gcp.diagflow.CxWebhook("standard_webhook", { * parent: agent.id, * displayName: "MyFlow", * genericWebService: { * allowedCaCerts: ["BQA="], * uri: "https://example.com", * requestHeaders: { * "example-key": "example-value", * }, * webhookType: "STANDARD", * oauthConfig: { * clientId: "example-client-id", * secretVersionForClientSecret: "projects/example-proj/secrets/example-secret/versions/example-version", * tokenEndpoint: "https://example.com", * scopes: ["example-scope"], * }, * serviceAgentAuth: "NONE", * secretVersionForUsernamePassword: "projects/example-proj/secrets/example-secret/versions/example-version", * secretVersionsForRequestHeaders: [ * { * key: "example-key-1", * secretVersion: "projects/example-proj/secrets/example-secret/versions/example-version", * }, * { * key: "example-key-2", * secretVersion: "projects/example-proj/secrets/example-secret/versions/example-version-2", * }, * ], * }, * }); * ``` * ### Dialogflowcx Webhook Flexible * * ```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 flexibleWebhook = new gcp.diagflow.CxWebhook("flexible_webhook", { * parent: agent.id, * displayName: "MyFlow", * genericWebService: { * uri: "https://example.com", * requestHeaders: { * "example-key": "example-value", * }, * webhookType: "FLEXIBLE", * oauthConfig: { * clientId: "example-client-id", * clientSecret: "projects/example-proj/secrets/example-secret/versions/example-version", * tokenEndpoint: "https://example.com", * }, * serviceAgentAuth: "NONE", * httpMethod: "POST", * requestBody: "{\"example-key\": \"example-value\"}", * parameterMapping: { * "example-parameter": "examplePath", * }, * }, * }); * ``` * ### Dialogflowcx Webhook Service Directory Standard * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const agent = new gcp.diagflow.CxAgent("agent", { * displayName: "dialogflowcx-agent", * location: "us-central1", * 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 standardWebhook = new gcp.diagflow.CxWebhook("standard_webhook", { * parent: agent.id, * displayName: "MyFlow", * serviceDirectory: { * service: "projects/example-proj/locations/us-central1/namespaces/example-namespace/services/example-service", * genericWebService: { * allowedCaCerts: ["BQA="], * uri: "https://example.com", * requestHeaders: { * "example-key": "example-value", * }, * webhookType: "STANDARD", * oauthConfig: { * clientId: "example-client-id", * secretVersionForClientSecret: "projects/example-proj/secrets/example-secret/versions/example-version", * tokenEndpoint: "https://example.com", * scopes: ["example-scope"], * }, * serviceAgentAuth: "NONE", * secretVersionForUsernamePassword: "projects/example-proj/secrets/example-secret/versions/example-version", * secretVersionsForRequestHeaders: [ * { * key: "example-key-1", * secretVersion: "projects/example-proj/secrets/example-secret/versions/example-version", * }, * { * key: "example-key-2", * secretVersion: "projects/example-proj/secrets/example-secret/versions/example-version-2", * }, * ], * }, * }, * }); * ``` * ### Dialogflowcx Webhook Service Directory Flexible * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const agent = new gcp.diagflow.CxAgent("agent", { * displayName: "dialogflowcx-agent", * location: "us-central1", * 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 flexibleWebhook = new gcp.diagflow.CxWebhook("flexible_webhook", { * parent: agent.id, * displayName: "MyFlow", * serviceDirectory: { * service: "projects/example-proj/locations/us-central1/namespaces/example-namespace/services/example-service", * genericWebService: { * uri: "https://example.com", * requestHeaders: { * "example-key": "example-value", * }, * webhookType: "FLEXIBLE", * oauthConfig: { * clientId: "example-client-id", * clientSecret: "projects/example-proj/secrets/example-secret/versions/example-version", * tokenEndpoint: "https://example.com", * }, * serviceAgentAuth: "NONE", * httpMethod: "POST", * requestBody: "{\"example-key\": \"example-value\"}", * parameterMapping: { * "example-parameter": "examplePath", * }, * }, * }, * }); * ``` * * ## 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}} * ``` */ export declare class CxWebhook extends pulumi.CustomResource { /** * Get an existing CxWebhook resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: CxWebhookState, opts?: pulumi.CustomResourceOptions): CxWebhook; /** * Returns true if the given object is an instance of CxWebhook. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is CxWebhook; /** * Indicates whether the webhook is disabled. */ readonly disabled: pulumi.Output; /** * The human-readable name of the webhook, unique within the agent. */ readonly displayName: pulumi.Output; /** * Deprecated. Indicates if automatic spell correction is enabled in detect intent requests. */ readonly enableSpellCorrection: pulumi.Output; /** * Deprecated. Determines whether this agent should log conversation queries. */ readonly enableStackdriverLogging: pulumi.Output; /** * Represents configuration for a generic web service. * Structure is documented below. */ readonly genericWebService: pulumi.Output; /** * The unique identifier of the webhook. * Format: projects//locations//agents//webhooks/. */ readonly name: pulumi.Output; /** * The agent to create a webhook for. * Format: projects//locations//agents/. */ readonly parent: pulumi.Output; /** * Deprecated. Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/. */ readonly securitySettings: pulumi.Output; /** * Configuration for a Service Directory service. * Structure is documented below. */ readonly serviceDirectory: pulumi.Output; /** * Deprecated. Name of the start flow in this agent. A start flow will be automatically created when the agent is created, and can only be deleted by deleting the agent. Format: projects//locations//agents//flows/. */ readonly startFlow: pulumi.Output; /** * Webhook execution timeout. */ readonly timeout: pulumi.Output; /** * Create a CxWebhook resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CxWebhookArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CxWebhook resources. */ export interface CxWebhookState { /** * Indicates whether the webhook is disabled. */ disabled?: pulumi.Input; /** * The human-readable name of the webhook, unique within the agent. */ displayName?: pulumi.Input; /** * Deprecated. Indicates if automatic spell correction is enabled in detect intent requests. */ enableSpellCorrection?: pulumi.Input; /** * Deprecated. Determines whether this agent should log conversation queries. */ enableStackdriverLogging?: pulumi.Input; /** * Represents configuration for a generic web service. * Structure is documented below. */ genericWebService?: pulumi.Input; /** * The unique identifier of the webhook. * Format: projects//locations//agents//webhooks/. */ name?: pulumi.Input; /** * The agent to create a webhook for. * Format: projects//locations//agents/. */ parent?: pulumi.Input; /** * Deprecated. Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/. */ securitySettings?: pulumi.Input; /** * Configuration for a Service Directory service. * Structure is documented below. */ serviceDirectory?: pulumi.Input; /** * Deprecated. Name of the start flow in this agent. A start flow will be automatically created when the agent is created, and can only be deleted by deleting the agent. Format: projects//locations//agents//flows/. */ startFlow?: pulumi.Input; /** * Webhook execution timeout. */ timeout?: pulumi.Input; } /** * The set of arguments for constructing a CxWebhook resource. */ export interface CxWebhookArgs { /** * Indicates whether the webhook is disabled. */ disabled?: pulumi.Input; /** * The human-readable name of the webhook, unique within the agent. */ displayName: pulumi.Input; /** * Deprecated. Indicates if automatic spell correction is enabled in detect intent requests. */ enableSpellCorrection?: pulumi.Input; /** * Deprecated. Determines whether this agent should log conversation queries. */ enableStackdriverLogging?: pulumi.Input; /** * Represents configuration for a generic web service. * Structure is documented below. */ genericWebService?: pulumi.Input; /** * The agent to create a webhook for. * Format: projects//locations//agents/. */ parent?: pulumi.Input; /** * Deprecated. Name of the SecuritySettings reference for the agent. Format: projects//locations//securitySettings/. */ securitySettings?: pulumi.Input; /** * Configuration for a Service Directory service. * Structure is documented below. */ serviceDirectory?: pulumi.Input; /** * Webhook execution timeout. */ timeout?: pulumi.Input; }