@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
154 lines • 5.99 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.CxEntityType = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Entities are extracted from user input and represent parameters that are meaningful to your application.
* For example, a date range, a proper name such as a geographic location or landmark, and so on. Entities represent actionable data for your application.
*
* To get more information about EntityType, see:
*
* * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.entityTypes)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
*
* ## Example Usage
*
* ### Dialogflowcx Entity Type Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const agent = new gcp.diagflow.CxAgent("agent", {
* displayName: "dialogflowcx-agent",
* location: "global",
* defaultLanguageCode: "en",
* supportedLanguageCodes: [
* "fr",
* "de",
* "es",
* ],
* timeZone: "America/New_York",
* description: "Example description.",
* avatarUri: "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
* enableStackdriverLogging: true,
* enableSpellCorrection: true,
* speechToTextSettings: {
* enableSpeechAdaptation: true,
* },
* });
* const basicEntityType = new gcp.diagflow.CxEntityType("basic_entity_type", {
* parent: agent.id,
* displayName: "MyEntity",
* kind: "KIND_MAP",
* entities: [
* {
* value: "value1",
* synonyms: [
* "synonym1",
* "synonym2",
* ],
* },
* {
* value: "value2",
* synonyms: [
* "synonym3",
* "synonym4",
* ],
* },
* ],
* enableFuzzyExtraction: false,
* });
* ```
*
* ## Import
*
* EntityType can be imported using any of these accepted formats:
*
* * `{{parent}}/entityTypes/{{name}}`
*
* * `{{parent}}/{{name}}`
*
* When using the `pulumi import` command, EntityType can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:diagflow/cxEntityType:CxEntityType default {{parent}}/entityTypes/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:diagflow/cxEntityType:CxEntityType default {{parent}}/{{name}}
* ```
*/
class CxEntityType extends pulumi.CustomResource {
/**
* Get an existing CxEntityType 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 CxEntityType(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CxEntityType. 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'] === CxEntityType.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoExpansionMode"] = state?.autoExpansionMode;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["enableFuzzyExtraction"] = state?.enableFuzzyExtraction;
resourceInputs["entities"] = state?.entities;
resourceInputs["excludedPhrases"] = state?.excludedPhrases;
resourceInputs["kind"] = state?.kind;
resourceInputs["languageCode"] = state?.languageCode;
resourceInputs["name"] = state?.name;
resourceInputs["parent"] = state?.parent;
resourceInputs["redact"] = state?.redact;
}
else {
const args = argsOrState;
if (args?.displayName === undefined && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if (args?.entities === undefined && !opts.urn) {
throw new Error("Missing required property 'entities'");
}
if (args?.kind === undefined && !opts.urn) {
throw new Error("Missing required property 'kind'");
}
resourceInputs["autoExpansionMode"] = args?.autoExpansionMode;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["enableFuzzyExtraction"] = args?.enableFuzzyExtraction;
resourceInputs["entities"] = args?.entities;
resourceInputs["excludedPhrases"] = args?.excludedPhrases;
resourceInputs["kind"] = args?.kind;
resourceInputs["languageCode"] = args?.languageCode;
resourceInputs["parent"] = args?.parent;
resourceInputs["redact"] = args?.redact;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CxEntityType.__pulumiType, name, resourceInputs, opts);
}
}
exports.CxEntityType = CxEntityType;
/** @internal */
CxEntityType.__pulumiType = 'gcp:diagflow/cxEntityType:CxEntityType';
//# sourceMappingURL=cxEntityType.js.map
;