UNPKG

@pulumi/aws

Version:

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

181 lines • 8.3 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["checksum"] = state ? state.checksum : undefined; resourceInputs["conclusionStatement"] = state ? state.conclusionStatement : undefined; resourceInputs["confirmationPrompt"] = state ? state.confirmationPrompt : undefined; resourceInputs["createVersion"] = state ? state.createVersion : undefined; resourceInputs["createdDate"] = state ? state.createdDate : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["dialogCodeHook"] = state ? state.dialogCodeHook : undefined; resourceInputs["followUpPrompt"] = state ? state.followUpPrompt : undefined; resourceInputs["fulfillmentActivity"] = state ? state.fulfillmentActivity : undefined; resourceInputs["lastUpdatedDate"] = state ? state.lastUpdatedDate : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["parentIntentSignature"] = state ? state.parentIntentSignature : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["rejectionStatement"] = state ? state.rejectionStatement : undefined; resourceInputs["sampleUtterances"] = state ? state.sampleUtterances : undefined; resourceInputs["slots"] = state ? state.slots : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.fulfillmentActivity === undefined) && !opts.urn) { throw new Error("Missing required property 'fulfillmentActivity'"); } resourceInputs["conclusionStatement"] = args ? args.conclusionStatement : undefined; resourceInputs["confirmationPrompt"] = args ? args.confirmationPrompt : undefined; resourceInputs["createVersion"] = args ? args.createVersion : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["dialogCodeHook"] = args ? args.dialogCodeHook : undefined; resourceInputs["followUpPrompt"] = args ? args.followUpPrompt : undefined; resourceInputs["fulfillmentActivity"] = args ? args.fulfillmentActivity : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["parentIntentSignature"] = args ? args.parentIntentSignature : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["rejectionStatement"] = args ? args.rejectionStatement : undefined; resourceInputs["sampleUtterances"] = args ? args.sampleUtterances : undefined; resourceInputs["slots"] = args ? args.slots : undefined; 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