@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
135 lines • 5.51 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.CxEnvironment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Represents an environment for an agent. You can create multiple versions of your agent and publish them to separate environments.
* When you edit an agent, you are editing the draft agent. At any point, you can save the draft agent as an agent version, which is an immutable snapshot of your agent.
* When you save the draft agent, it is published to the default environment. When you create agent versions, you can publish them to custom environments. You can create a variety of custom environments for testing, development, production, etc.
*
* To get more information about Environment, see:
*
* * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.environments)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
*
* ## Example Usage
*
* ### Dialogflowcx Environment 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 version1 = new gcp.diagflow.CxVersion("version_1", {
* parent: agent.startFlow,
* displayName: "1.0.0",
* description: "version 1.0.0",
* });
* const development = new gcp.diagflow.CxEnvironment("development", {
* parent: agent.id,
* displayName: "Development",
* description: "Development Environment",
* versionConfigs: [{
* version: version1.id,
* }],
* });
* ```
*
* ## Import
*
* Environment can be imported using any of these accepted formats:
*
* * `{{parent}}/environments/{{name}}`
*
* * `{{parent}}/{{name}}`
*
* When using the `pulumi import` command, Environment can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/environments/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/{{name}}
* ```
*/
class CxEnvironment extends pulumi.CustomResource {
/**
* Get an existing CxEnvironment 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 CxEnvironment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CxEnvironment. 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'] === CxEnvironment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state?.description;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["name"] = state?.name;
resourceInputs["parent"] = state?.parent;
resourceInputs["updateTime"] = state?.updateTime;
resourceInputs["versionConfigs"] = state?.versionConfigs;
}
else {
const args = argsOrState;
if (args?.displayName === undefined && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if (args?.versionConfigs === undefined && !opts.urn) {
throw new Error("Missing required property 'versionConfigs'");
}
resourceInputs["description"] = args?.description;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["parent"] = args?.parent;
resourceInputs["versionConfigs"] = args?.versionConfigs;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CxEnvironment.__pulumiType, name, resourceInputs, opts);
}
}
exports.CxEnvironment = CxEnvironment;
/** @internal */
CxEnvironment.__pulumiType = 'gcp:diagflow/cxEnvironment:CxEnvironment';
//# sourceMappingURL=cxEnvironment.js.map
;