UNPKG

@pulumi/gcp

Version:

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

133 lines 6.3 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Agent = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A Dialogflow agent is a virtual agent that handles conversations with your end-users. It is a natural language * understanding module that understands the nuances of human language. Dialogflow translates end-user text or audio * during a conversation to structured data that your apps and services can understand. You design and build a Dialogflow * agent to handle the types of conversations required for your system. * * To get more information about Agent, see: * * * [API documentation](https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects/agent) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dialogflow/docs/) * * ## Example Usage * * ### Dialogflow Agent Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const fullAgent = new gcp.diagflow.Agent("full_agent", { * displayName: "dialogflow-agent", * 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", * enableLogging: true, * matchMode: "MATCH_MODE_ML_ONLY", * classificationThreshold: 0.3, * apiVersion: "API_VERSION_V2_BETA_1", * tier: "TIER_STANDARD", * }); * ``` * * ## Import * * Agent can be imported using any of these accepted formats: * * * `{{project}}` * * When using the `pulumi import` command, Agent can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:diagflow/agent:Agent default {{project}} * ``` */ class Agent extends pulumi.CustomResource { /** * Get an existing Agent 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 Agent(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Agent. 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'] === Agent.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiVersion"] = state ? state.apiVersion : undefined; resourceInputs["avatarUri"] = state ? state.avatarUri : undefined; resourceInputs["avatarUriBackend"] = state ? state.avatarUriBackend : undefined; resourceInputs["classificationThreshold"] = state ? state.classificationThreshold : undefined; resourceInputs["defaultLanguageCode"] = state ? state.defaultLanguageCode : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["enableLogging"] = state ? state.enableLogging : undefined; resourceInputs["matchMode"] = state ? state.matchMode : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["supportedLanguageCodes"] = state ? state.supportedLanguageCodes : undefined; resourceInputs["tier"] = state ? state.tier : undefined; resourceInputs["timeZone"] = state ? state.timeZone : undefined; } else { const args = argsOrState; if ((!args || args.defaultLanguageCode === undefined) && !opts.urn) { throw new Error("Missing required property 'defaultLanguageCode'"); } if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.timeZone === undefined) && !opts.urn) { throw new Error("Missing required property 'timeZone'"); } resourceInputs["apiVersion"] = args ? args.apiVersion : undefined; resourceInputs["avatarUri"] = args ? args.avatarUri : undefined; resourceInputs["classificationThreshold"] = args ? args.classificationThreshold : undefined; resourceInputs["defaultLanguageCode"] = args ? args.defaultLanguageCode : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["enableLogging"] = args ? args.enableLogging : undefined; resourceInputs["matchMode"] = args ? args.matchMode : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["supportedLanguageCodes"] = args ? args.supportedLanguageCodes : undefined; resourceInputs["tier"] = args ? args.tier : undefined; resourceInputs["timeZone"] = args ? args.timeZone : undefined; resourceInputs["avatarUriBackend"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Agent.__pulumiType, name, resourceInputs, opts); } } exports.Agent = Agent; /** @internal */ Agent.__pulumiType = 'gcp:diagflow/agent:Agent'; //# sourceMappingURL=agent.js.map