@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
147 lines • 7.24 kB
JavaScript
;
// *** 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.Bot = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Amazon Lex Bot 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 orderFlowersBot = new aws.lex.Bot("order_flowers_bot", {
* abortStatement: {
* messages: [{
* content: "Sorry, I am not able to assist at this time",
* contentType: "PlainText",
* }],
* },
* childDirected: false,
* clarificationPrompt: {
* maxAttempts: 2,
* messages: [{
* content: "I didn't understand you, what would you like to do?",
* contentType: "PlainText",
* }],
* },
* createVersion: false,
* description: "Bot to order flowers on the behalf of a user",
* idleSessionTtlInSeconds: 600,
* intents: [{
* intentName: "OrderFlowers",
* intentVersion: "1",
* }],
* locale: "en-US",
* name: "OrderFlowers",
* processBehavior: "BUILD",
* voiceId: "Salli",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import bots using their name. For example:
*
* ```sh
* $ pulumi import aws:lex/bot:Bot order_flowers_bot OrderFlowers
* ```
*/
class Bot extends pulumi.CustomResource {
/**
* Get an existing Bot 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 Bot(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Bot. 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'] === Bot.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["abortStatement"] = state ? state.abortStatement : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["checksum"] = state ? state.checksum : undefined;
resourceInputs["childDirected"] = state ? state.childDirected : undefined;
resourceInputs["clarificationPrompt"] = state ? state.clarificationPrompt : undefined;
resourceInputs["createVersion"] = state ? state.createVersion : undefined;
resourceInputs["createdDate"] = state ? state.createdDate : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["detectSentiment"] = state ? state.detectSentiment : undefined;
resourceInputs["enableModelImprovements"] = state ? state.enableModelImprovements : undefined;
resourceInputs["failureReason"] = state ? state.failureReason : undefined;
resourceInputs["idleSessionTtlInSeconds"] = state ? state.idleSessionTtlInSeconds : undefined;
resourceInputs["intents"] = state ? state.intents : undefined;
resourceInputs["lastUpdatedDate"] = state ? state.lastUpdatedDate : undefined;
resourceInputs["locale"] = state ? state.locale : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nluIntentConfidenceThreshold"] = state ? state.nluIntentConfidenceThreshold : undefined;
resourceInputs["processBehavior"] = state ? state.processBehavior : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["version"] = state ? state.version : undefined;
resourceInputs["voiceId"] = state ? state.voiceId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.abortStatement === undefined) && !opts.urn) {
throw new Error("Missing required property 'abortStatement'");
}
if ((!args || args.childDirected === undefined) && !opts.urn) {
throw new Error("Missing required property 'childDirected'");
}
if ((!args || args.intents === undefined) && !opts.urn) {
throw new Error("Missing required property 'intents'");
}
resourceInputs["abortStatement"] = args ? args.abortStatement : undefined;
resourceInputs["childDirected"] = args ? args.childDirected : undefined;
resourceInputs["clarificationPrompt"] = args ? args.clarificationPrompt : undefined;
resourceInputs["createVersion"] = args ? args.createVersion : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["detectSentiment"] = args ? args.detectSentiment : undefined;
resourceInputs["enableModelImprovements"] = args ? args.enableModelImprovements : undefined;
resourceInputs["idleSessionTtlInSeconds"] = args ? args.idleSessionTtlInSeconds : undefined;
resourceInputs["intents"] = args ? args.intents : undefined;
resourceInputs["locale"] = args ? args.locale : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nluIntentConfidenceThreshold"] = args ? args.nluIntentConfidenceThreshold : undefined;
resourceInputs["processBehavior"] = args ? args.processBehavior : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["voiceId"] = args ? args.voiceId : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["checksum"] = undefined /*out*/;
resourceInputs["createdDate"] = undefined /*out*/;
resourceInputs["failureReason"] = undefined /*out*/;
resourceInputs["lastUpdatedDate"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Bot.__pulumiType, name, resourceInputs, opts);
}
}
exports.Bot = Bot;
/** @internal */
Bot.__pulumiType = 'aws:lex/bot:Bot';
//# sourceMappingURL=bot.js.map