@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
156 lines • 6.41 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.V2modelsSlotType = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS Lex V2 Models Slot Type.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lex.V2modelsBot("example", {
* name: "example",
* idleSessionTtlInSeconds: 60,
* roleArn: exampleAwsIamRole.arn,
* dataPrivacies: [{
* childDirected: true,
* }],
* });
* const exampleV2modelsBotLocale = new aws.lex.V2modelsBotLocale("example", {
* localeId: "en_US",
* botId: example.id,
* botVersion: "DRAFT",
* nLuIntentConfidenceThreshold: 0.7,
* });
* const exampleV2modelsBotVersion = new aws.lex.V2modelsBotVersion("example", {
* botId: example.id,
* localeSpecification: exampleV2modelsBotLocale.localeId.apply(localeId => {
* [localeId]: {
* sourceBotVersion: "DRAFT",
* },
* }),
* });
* const exampleV2modelsSlotType = new aws.lex.V2modelsSlotType("example", {
* botId: example.id,
* botVersion: exampleV2modelsBotLocale.botVersion,
* name: "example",
* localeId: exampleV2modelsBotLocale.localeId,
* });
* ```
*
* ### valueSelectionSetting Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lex.V2modelsSlotType("example", {
* botId: exampleAwsLexv2modelsBot.id,
* botVersion: exampleAwsLexv2modelsBotLocale.botVersion,
* name: "example",
* localeId: exampleAwsLexv2modelsBotLocale.localeId,
* valueSelectionSetting: {
* resolutionStrategy: "OriginalValue",
* advancedRecognitionSettings: [{
* audioRecognitionStrategy: "UseSlotValuesAsCustomVocabulary",
* }],
* },
* slotTypeValues: [{
* sampleValues: [{
* value: "exampleValue",
* }],
* }],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Lex V2 Models Slot Type using using a comma-delimited string concatenating `bot_id`, `bot_version`, `locale_id`, and `slot_type_id`. For example:
*
* ```sh
* $ pulumi import aws:lex/v2modelsSlotType:V2modelsSlotType example bot-1234,DRAFT,en_US,slot_type-id-12345678
* ```
*/
class V2modelsSlotType extends pulumi.CustomResource {
/**
* Get an existing V2modelsSlotType 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 V2modelsSlotType(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of V2modelsSlotType. 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'] === V2modelsSlotType.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["botId"] = state?.botId;
resourceInputs["botVersion"] = state?.botVersion;
resourceInputs["compositeSlotTypeSettings"] = state?.compositeSlotTypeSettings;
resourceInputs["description"] = state?.description;
resourceInputs["externalSourceSettings"] = state?.externalSourceSettings;
resourceInputs["localeId"] = state?.localeId;
resourceInputs["name"] = state?.name;
resourceInputs["parentSlotTypeSignature"] = state?.parentSlotTypeSignature;
resourceInputs["region"] = state?.region;
resourceInputs["slotTypeId"] = state?.slotTypeId;
resourceInputs["slotTypeValues"] = state?.slotTypeValues;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["valueSelectionSetting"] = state?.valueSelectionSetting;
}
else {
const args = argsOrState;
if (args?.botId === undefined && !opts.urn) {
throw new Error("Missing required property 'botId'");
}
if (args?.botVersion === undefined && !opts.urn) {
throw new Error("Missing required property 'botVersion'");
}
if (args?.localeId === undefined && !opts.urn) {
throw new Error("Missing required property 'localeId'");
}
resourceInputs["botId"] = args?.botId;
resourceInputs["botVersion"] = args?.botVersion;
resourceInputs["compositeSlotTypeSettings"] = args?.compositeSlotTypeSettings;
resourceInputs["description"] = args?.description;
resourceInputs["externalSourceSettings"] = args?.externalSourceSettings;
resourceInputs["localeId"] = args?.localeId;
resourceInputs["name"] = args?.name;
resourceInputs["parentSlotTypeSignature"] = args?.parentSlotTypeSignature;
resourceInputs["region"] = args?.region;
resourceInputs["slotTypeValues"] = args?.slotTypeValues;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["valueSelectionSetting"] = args?.valueSelectionSetting;
resourceInputs["slotTypeId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(V2modelsSlotType.__pulumiType, name, resourceInputs, opts);
}
}
exports.V2modelsSlotType = V2modelsSlotType;
/** @internal */
V2modelsSlotType.__pulumiType = 'aws:lex/v2modelsSlotType:V2modelsSlotType';
//# sourceMappingURL=v2modelsSlotType.js.map
;