UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

181 lines 7.69 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Intent = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Amazon Lex Intent resource. For more information see * [Amazon Lex: How It Works](https://docs.aws.amazon.com/lex/latest/dg/how-it-works.html) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const orderFlowersIntent = new aws.lex.Intent("order_flowers_intent", { * confirmationPrompt: { * maxAttempts: 2, * messages: [{ * content: "Okay, your {FlowerType} will be ready for pickup by {PickupTime} on {PickupDate}. Does this sound okay?", * contentType: "PlainText", * }], * }, * createVersion: false, * name: "OrderFlowers", * description: "Intent to order a bouquet of flowers for pick up", * fulfillmentActivity: { * type: "ReturnIntent", * }, * rejectionStatement: { * messages: [{ * content: "Okay, I will not place your order.", * contentType: "PlainText", * }], * }, * sampleUtterances: [ * "I would like to order some flowers", * "I would like to pick up flowers", * ], * slots: [ * { * description: "The type of flowers to pick up", * name: "FlowerType", * priority: 1, * sampleUtterances: ["I would like to order {FlowerType}"], * slotConstraint: "Required", * slotType: "FlowerTypes", * slotTypeVersion: "$$LATEST", * valueElicitationPrompt: { * maxAttempts: 2, * messages: [{ * content: "What type of flowers would you like to order?", * contentType: "PlainText", * }], * }, * }, * { * description: "The date to pick up the flowers", * name: "PickupDate", * priority: 2, * sampleUtterances: ["I would like to order {FlowerType}"], * slotConstraint: "Required", * slotType: "AMAZON.DATE", * slotTypeVersion: "$$LATEST", * valueElicitationPrompt: { * maxAttempts: 2, * messages: [{ * content: "What day do you want the {FlowerType} to be picked up?", * contentType: "PlainText", * }], * }, * }, * { * description: "The time to pick up the flowers", * name: "PickupTime", * priority: 3, * sampleUtterances: ["I would like to order {FlowerType}"], * slotConstraint: "Required", * slotType: "AMAZON.TIME", * slotTypeVersion: "$$LATEST", * valueElicitationPrompt: { * maxAttempts: 2, * messages: [{ * content: "Pick up the {FlowerType} at what time on {PickupDate}?", * contentType: "PlainText", * }], * }, * }, * ], * }); * ``` * * ## Import * * Using `pulumi import`, import intents using their name. For example: * * ```sh * $ pulumi import aws:lex/intent:Intent order_flowers_intent OrderFlowers * ``` */ class Intent extends pulumi.CustomResource { /** * Get an existing Intent 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 Intent(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Intent. 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'] === Intent.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["checksum"] = state?.checksum; resourceInputs["conclusionStatement"] = state?.conclusionStatement; resourceInputs["confirmationPrompt"] = state?.confirmationPrompt; resourceInputs["createVersion"] = state?.createVersion; resourceInputs["createdDate"] = state?.createdDate; resourceInputs["description"] = state?.description; resourceInputs["dialogCodeHook"] = state?.dialogCodeHook; resourceInputs["followUpPrompt"] = state?.followUpPrompt; resourceInputs["fulfillmentActivity"] = state?.fulfillmentActivity; resourceInputs["lastUpdatedDate"] = state?.lastUpdatedDate; resourceInputs["name"] = state?.name; resourceInputs["parentIntentSignature"] = state?.parentIntentSignature; resourceInputs["region"] = state?.region; resourceInputs["rejectionStatement"] = state?.rejectionStatement; resourceInputs["sampleUtterances"] = state?.sampleUtterances; resourceInputs["slots"] = state?.slots; resourceInputs["version"] = state?.version; } else { const args = argsOrState; if (args?.fulfillmentActivity === undefined && !opts.urn) { throw new Error("Missing required property 'fulfillmentActivity'"); } resourceInputs["conclusionStatement"] = args?.conclusionStatement; resourceInputs["confirmationPrompt"] = args?.confirmationPrompt; resourceInputs["createVersion"] = args?.createVersion; resourceInputs["description"] = args?.description; resourceInputs["dialogCodeHook"] = args?.dialogCodeHook; resourceInputs["followUpPrompt"] = args?.followUpPrompt; resourceInputs["fulfillmentActivity"] = args?.fulfillmentActivity; resourceInputs["name"] = args?.name; resourceInputs["parentIntentSignature"] = args?.parentIntentSignature; resourceInputs["region"] = args?.region; resourceInputs["rejectionStatement"] = args?.rejectionStatement; resourceInputs["sampleUtterances"] = args?.sampleUtterances; resourceInputs["slots"] = args?.slots; resourceInputs["arn"] = undefined /*out*/; resourceInputs["checksum"] = undefined /*out*/; resourceInputs["createdDate"] = undefined /*out*/; resourceInputs["lastUpdatedDate"] = undefined /*out*/; resourceInputs["version"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Intent.__pulumiType, name, resourceInputs, opts); } } exports.Intent = Intent; /** @internal */ Intent.__pulumiType = 'aws:lex/intent:Intent'; //# sourceMappingURL=intent.js.map