UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

175 lines 7.17 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CxEntityType = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(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}} * $ 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 }); } /** @internal */ static __pulumiType = 'gcp:diagflow/cxEntityType:CxEntityType'; /** * 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["deletionPolicy"] = state?.deletionPolicy; 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["deletionPolicy"] = args?.deletionPolicy; 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; //# sourceMappingURL=cxEntityType.js.map