"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.Folder = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Allows management of a Google Cloud Platform folder. For more information see
 * [the official documentation](https://docs.cloud.google.com/resource-manager/docs/creating-managing-folders)
 * and
 * [API](https://docs.cloud.google.com/resource-manager/reference/rest/v2/folders).
 *
 * A folder can contain projects, other folders, or a combination of both. You can use folders to group projects under an organization in a hierarchy. For example, your organization might contain multiple departments, each with its own set of Cloud Platform resources. Folders allows you to group these resources on a per-department basis. Folders are used to group resources that share common IAM policies.
 *
 * Folders created live inside an Organization. See the [Organization documentation](https://docs.cloud.google.com/resource-manager/docs/quickstarts) for more details.
 *
 * The service account used to run the provider when creating a `gcp.organizations.Folder`
 * resource must have `roles/resourcemanager.folderCreator`. See the
 * [Access Control for Folders Using IAM](https://docs.cloud.google.com/resource-manager/docs/access-control-folders)
 * doc for more information.
 *
 * > It may take a while for the attached tag bindings to be deleted after the folder is scheduled to be deleted.
 *
 * ## Import
 *
 * Folders can be imported using the folder's id, e.g.
 *
 * * `folders/{{folder_id}}`
 *
 * * `{{folder_id}}`
 *
 * When using the `pulumi import` command, Folders can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:organizations/folder:Folder default {{folder_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:organizations/folder:Folder default folders/{{folder_id}}
 * ```
 */
class Folder extends pulumi.CustomResource {
    /**
     * Get an existing Folder 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 Folder(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Folder.  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'] === Folder.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["configuredCapabilities"] = state?.configuredCapabilities;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["deletionProtection"] = state?.deletionProtection;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["folderId"] = state?.folderId;
            resourceInputs["lifecycleState"] = state?.lifecycleState;
            resourceInputs["managementProject"] = state?.managementProject;
            resourceInputs["name"] = state?.name;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["tags"] = state?.tags;
        }
        else {
            const args = argsOrState;
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            resourceInputs["deletionProtection"] = args?.deletionProtection;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["configuredCapabilities"] = undefined /*out*/;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["folderId"] = undefined /*out*/;
            resourceInputs["lifecycleState"] = undefined /*out*/;
            resourceInputs["managementProject"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Folder.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Folder = Folder;
/** @internal */
Folder.__pulumiType = 'gcp:organizations/folder:Folder';
//# sourceMappingURL=folder.js.map