UNPKG

@pulumi/gcp

Version:

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

123 lines 4.51 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.EntityType = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Represents an entity type. Entity types serve as a tool for extracting parameter values from natural language queries. * * To get more information about EntityType, see: * * * [API documentation](https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects.agent.entityTypes) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dialogflow/docs/) * * ## Example Usage * * ### Dialogflow Entity Type Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basicAgent = new gcp.diagflow.Agent("basic_agent", { * displayName: "example_agent", * defaultLanguageCode: "en", * timeZone: "America/New_York", * }); * const basicEntityType = new gcp.diagflow.EntityType("basic_entity_type", { * displayName: "basic-entity-type", * kind: "KIND_MAP", * entities: [ * { * value: "value1", * synonyms: [ * "synonym1", * "synonym2", * ], * }, * { * value: "value2", * synonyms: [ * "synonym3", * "synonym4", * ], * }, * ], * }, { * dependsOn: [basicAgent], * }); * ``` * * ## Import * * EntityType can be imported using any of these accepted formats: * * * `{{name}}` * * When using the `pulumi import` command, EntityType can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:diagflow/entityType:EntityType default {{name}} * ``` */ class EntityType extends pulumi.CustomResource { /** * Get an existing EntityType 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 EntityType(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EntityType. 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'] === EntityType.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["displayName"] = state?.displayName; resourceInputs["enableFuzzyExtraction"] = state?.enableFuzzyExtraction; resourceInputs["entities"] = state?.entities; resourceInputs["kind"] = state?.kind; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; } else { const args = argsOrState; if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.kind === undefined && !opts.urn) { throw new Error("Missing required property 'kind'"); } resourceInputs["displayName"] = args?.displayName; resourceInputs["enableFuzzyExtraction"] = args?.enableFuzzyExtraction; resourceInputs["entities"] = args?.entities; resourceInputs["kind"] = args?.kind; resourceInputs["project"] = args?.project; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EntityType.__pulumiType, name, resourceInputs, opts); } } exports.EntityType = EntityType; /** @internal */ EntityType.__pulumiType = 'gcp:diagflow/entityType:EntityType'; //# sourceMappingURL=entityType.js.map