UNPKG

@pulumi/gcp

Version:

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

112 lines 4.88 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.Fulfillment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * By default, your agent responds to a matched intent with a static response. If you're using one of the integration options, you can provide a more dynamic response by using fulfillment. When you enable fulfillment for an intent, Dialogflow responds to that intent by calling a service that you define. For example, if an end-user wants to schedule a haircut on Friday, your service can check your database and respond to the end-user with availability information for Friday. * * To get more information about Fulfillment, see: * * * [API documentation](https://cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.agent/getFulfillment) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dialogflow/es/docs/fulfillment-overview) * * ## Example Usage * * ### Dialogflow Fulfillment Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basicAgent = new gcp.diagflow.Agent("basic_agent", { * displayName: "example_agent", * defaultLanguageCode: "en", * timeZone: "America/New_York", * }); * const basicFulfillment = new gcp.diagflow.Fulfillment("basic_fulfillment", { * displayName: "basic-fulfillment", * enabled: true, * genericWebService: { * uri: "https://google.com", * username: "admin", * password: "password", * requestHeaders: { * name: "wrench", * }, * }, * }, { * dependsOn: [basicAgent], * }); * ``` * * ## Import * * Fulfillment can be imported using any of these accepted formats: * * * `{{name}}` * * When using the `pulumi import` command, Fulfillment can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:diagflow/fulfillment:Fulfillment default {{name}} * ``` */ class Fulfillment extends pulumi.CustomResource { /** * Get an existing Fulfillment 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 Fulfillment(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Fulfillment. 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'] === Fulfillment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["features"] = state ? state.features : undefined; resourceInputs["genericWebService"] = state ? state.genericWebService : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["features"] = args ? args.features : undefined; resourceInputs["genericWebService"] = args ? args.genericWebService : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Fulfillment.__pulumiType, name, resourceInputs, opts); } } exports.Fulfillment = Fulfillment; /** @internal */ Fulfillment.__pulumiType = 'gcp:diagflow/fulfillment:Fulfillment'; //# sourceMappingURL=fulfillment.js.map