"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.ManagedFolder = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Google Cloud Storage Managed Folder.
 *
 * You can apply Identity and Access Management (IAM) policies to
 * managed folders to grant principals access only to the objects
 * within the managed folder, which lets you more finely control access
 * for specific data sets and tables within a bucket. You can nest
 * managed folders up to 15 levels deep, including the parent managed
 * folder.
 *
 * Managed folders can only be created in buckets that have uniform
 * bucket-level access enabled.
 *
 * To get more information about ManagedFolder, see:
 *
 * * [API documentation](https://cloud.google.com/storage/docs/json_api/v1/managedFolder)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/storage/docs/managed-folders)
 *
 * ## Example Usage
 *
 * ### Storage Managed Folder Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "my-bucket",
 *     location: "EU",
 *     uniformBucketLevelAccess: true,
 * });
 * const folder = new gcp.storage.ManagedFolder("folder", {
 *     bucket: bucket.name,
 *     name: "managed/folder/name/",
 *     forceDestroy: true,
 * });
 * ```
 *
 * ## Import
 *
 * ManagedFolder can be imported using any of these accepted formats:
 *
 * * `{{bucket}}/managedFolders/{{name}}`
 *
 * * `{{bucket}}/{{name}}`
 *
 * When using the `pulumi import` command, ManagedFolder can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:storage/managedFolder:ManagedFolder default {{bucket}}/managedFolders/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:storage/managedFolder:ManagedFolder default {{bucket}}/{{name}}
 * ```
 */
class ManagedFolder extends pulumi.CustomResource {
    /**
     * Get an existing ManagedFolder 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 ManagedFolder(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ManagedFolder.  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'] === ManagedFolder.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["bucket"] = state?.bucket;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["forceDestroy"] = state?.forceDestroy;
            resourceInputs["metageneration"] = state?.metageneration;
            resourceInputs["name"] = state?.name;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.bucket === undefined && !opts.urn) {
                throw new Error("Missing required property 'bucket'");
            }
            resourceInputs["bucket"] = args?.bucket;
            resourceInputs["forceDestroy"] = args?.forceDestroy;
            resourceInputs["name"] = args?.name;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["metageneration"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ManagedFolder.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedFolder = ManagedFolder;
/** @internal */
ManagedFolder.__pulumiType = 'gcp:storage/managedFolder:ManagedFolder';
//# sourceMappingURL=managedFolder.js.map