UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

134 lines 5.92 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.CxWebhook = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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", * }, * }); * ``` * * ## 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}} * ``` */ 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, id, state, opts) { return new CxWebhook(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === CxWebhook.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["enableSpellCorrection"] = state ? state.enableSpellCorrection : undefined; resourceInputs["enableStackdriverLogging"] = state ? state.enableStackdriverLogging : undefined; resourceInputs["genericWebService"] = state ? state.genericWebService : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["parent"] = state ? state.parent : undefined; resourceInputs["securitySettings"] = state ? state.securitySettings : undefined; resourceInputs["serviceDirectory"] = state ? state.serviceDirectory : undefined; resourceInputs["startFlow"] = state ? state.startFlow : undefined; resourceInputs["timeout"] = state ? state.timeout : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["enableSpellCorrection"] = args ? args.enableSpellCorrection : undefined; resourceInputs["enableStackdriverLogging"] = args ? args.enableStackdriverLogging : undefined; resourceInputs["genericWebService"] = args ? args.genericWebService : undefined; resourceInputs["parent"] = args ? args.parent : undefined; resourceInputs["securitySettings"] = args ? args.securitySettings : undefined; resourceInputs["serviceDirectory"] = args ? args.serviceDirectory : undefined; resourceInputs["timeout"] = args ? args.timeout : undefined; resourceInputs["name"] = undefined /*out*/; resourceInputs["startFlow"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CxWebhook.__pulumiType, name, resourceInputs, opts); } } exports.CxWebhook = CxWebhook; /** @internal */ CxWebhook.__pulumiType = 'gcp:diagflow/cxWebhook:CxWebhook'; //# sourceMappingURL=cxWebhook.js.map