"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.CxVersion = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * You can create multiple versions of your agent flows and deploy them to separate serving environments.
 * When you edit a flow, you are editing a draft flow. At any point, you can save a draft flow as a flow version. A flow version is an immutable snapshot of your flow data and associated agent data like intents, entities, webhooks, pages, route groups, etc.
 *
 * To get more information about Version, see:
 *
 * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.flows.versions)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
 *
 * ## Example Usage
 *
 * ### Dialogflowcx Version 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",
 * });
 * ```
 *
 * ## Import
 *
 * Version can be imported using any of these accepted formats:
 *
 * * `{{parent}}/versions/{{name}}`
 *
 * * `{{parent}}/{{name}}`
 *
 * When using the `pulumi import` command, Version can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxVersion:CxVersion default {{parent}}/versions/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:diagflow/cxVersion:CxVersion default {{parent}}/{{name}}
 * ```
 */
class CxVersion extends pulumi.CustomResource {
    /**
     * Get an existing CxVersion 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 CxVersion(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of CxVersion.  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'] === CxVersion.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["name"] = state?.name;
            resourceInputs["nluSettings"] = state?.nluSettings;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["state"] = state?.state;
        }
        else {
            const args = argsOrState;
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["nluSettings"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CxVersion.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CxVersion = CxVersion;
/** @internal */
CxVersion.__pulumiType = 'gcp:diagflow/cxVersion:CxVersion';
//# sourceMappingURL=cxVersion.js.map