"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");
/**
 * A Google Cloud Storage Folder.
 *
 * The Folder resource represents a folder in a Cloud Storage bucket with hierarchical namespace enabled
 *
 * To get more information about Folder, see:
 *
 * * [API documentation](https://cloud.google.com/storage/docs/json_api/v1/folders)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/storage/docs/folders-overview)
 *
 * ## Example Usage
 *
 * ### Storage 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,
 *     hierarchicalNamespace: {
 *         enabled: true,
 *     },
 * });
 * const folder = new gcp.storage.Folder("folder", {
 *     bucket: bucket.name,
 *     name: "parent-folder/",
 * });
 * const subfolder = new gcp.storage.Folder("subfolder", {
 *     bucket: bucket.name,
 *     name: pulumi.interpolate`${folder.name}subfolder/`,
 * });
 * ```
 *
 * ## Import
 *
 * Folder can be imported using any of these accepted formats:
 *
 * * `{{bucket}}/folders/{{name}}`
 *
 * * `{{bucket}}/{{name}}`
 *
 * When using the `pulumi import` command, Folder can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:storage/folder:Folder default {{bucket}}/folders/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:storage/folder:Folder default {{bucket}}/{{name}}
 * ```
 */
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["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(Folder.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Folder = Folder;
/** @internal */
Folder.__pulumiType = 'gcp:storage/folder:Folder';
//# sourceMappingURL=folder.js.map