"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.TagKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A TagKey, used to group a set of TagValues.
 *
 * To get more information about TagKey, see:
 *
 * * [API documentation](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing)
 *
 * ## Example Usage
 *
 * ### Tag Key Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const key = new gcp.tags.TagKey("key", {
 *     parent: "organizations/123456789",
 *     shortName: "keyname",
 *     description: "For keyname resources.",
 * });
 * ```
 *
 * ## Import
 *
 * TagKey can be imported using any of these accepted formats:
 *
 * * `tagKeys/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, TagKey can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:tags/tagKey:TagKey default tagKeys/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:tags/tagKey:TagKey default {{name}}
 * ```
 */
class TagKey extends pulumi.CustomResource {
    /**
     * Get an existing TagKey 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 TagKey(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TagKey.  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'] === TagKey.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["name"] = state?.name;
            resourceInputs["namespacedName"] = state?.namespacedName;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["purpose"] = state?.purpose;
            resourceInputs["purposeData"] = state?.purposeData;
            resourceInputs["shortName"] = state?.shortName;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            if (args?.shortName === undefined && !opts.urn) {
                throw new Error("Missing required property 'shortName'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["purpose"] = args?.purpose;
            resourceInputs["purposeData"] = args?.purposeData;
            resourceInputs["shortName"] = args?.shortName;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["namespacedName"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TagKey.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TagKey = TagKey;
/** @internal */
TagKey.__pulumiType = 'gcp:tags/tagKey:TagKey';
//# sourceMappingURL=tagKey.js.map