"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.TagBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A TagBinding represents a connection between a TagValue and a cloud resource (currently project, folder, or organization). Once a TagBinding is created, the TagValue is applied to all the descendants of the cloud resource.
 *
 * To get more information about TagBinding, see:
 *
 * * [API documentation](https://cloud.google.com/resource-manager/reference/rest/v3/tagBindings)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing)
 *
 * ## Example Usage
 *
 * ### Tag Binding Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = new gcp.organizations.Project("project", {
 *     projectId: "project_id",
 *     name: "project_id",
 *     orgId: "123456789",
 *     deletionPolicy: "DELETE",
 * });
 * const key = new gcp.tags.TagKey("key", {
 *     parent: "organizations/123456789",
 *     shortName: "keyname",
 *     description: "For keyname resources.",
 * });
 * const value = new gcp.tags.TagValue("value", {
 *     parent: key.id,
 *     shortName: "valuename",
 *     description: "For valuename resources.",
 * });
 * const binding = new gcp.tags.TagBinding("binding", {
 *     parent: pulumi.interpolate`//cloudresourcemanager.googleapis.com/projects/${project.number}`,
 *     tagValue: value.id,
 * });
 * ```
 *
 * ## Import
 *
 * TagBinding can be imported using any of these accepted formats:
 *
 * * `tagBindings/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, TagBinding can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:tags/tagBinding:TagBinding default tagBindings/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:tags/tagBinding:TagBinding default {{name}}
 * ```
 */
class TagBinding extends pulumi.CustomResource {
    /**
     * Get an existing TagBinding 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 TagBinding(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TagBinding.  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'] === TagBinding.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["name"] = state?.name;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["tagValue"] = state?.tagValue;
        }
        else {
            const args = argsOrState;
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            if (args?.tagValue === undefined && !opts.urn) {
                throw new Error("Missing required property 'tagValue'");
            }
            resourceInputs["parent"] = args?.parent;
            resourceInputs["tagValue"] = args?.tagValue;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TagBinding.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TagBinding = TagBinding;
/** @internal */
TagBinding.__pulumiType = 'gcp:tags/tagBinding:TagBinding';
//# sourceMappingURL=tagBinding.js.map