"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bucket = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage tos bucket
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * // create tos bucket
 * const fooBucket = new volcengine.tos.Bucket("fooBucket", {
 *     bucketName: "tflyb7",
 *     publicAcl: "private",
 *     azRedundancy: "multi-az",
 *     enableVersion: true,
 *     bucketAclDelivered: true,
 *     accountAcls: [
 *         {
 *             accountId: "1",
 *             permission: "READ",
 *         },
 *         {
 *             accountId: "2001",
 *             permission: "WRITE_ACP",
 *         },
 *     ],
 *     projectName: "default",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * // create tos bucket policy
 * const fooBucketPolicy = new volcengine.tos.BucketPolicy("fooBucketPolicy", {
 *     bucketName: fooBucket.id,
 *     policy: pulumi.jsonStringify({
 *         Statement: [{
 *             Sid: "test",
 *             Effect: "Allow",
 *             Principal: ["AccountId/subUserName"],
 *             Action: ["tos:List*"],
 *             Resource: [pulumi.interpolate`trn:tos:::${fooBucket.id}`],
 *         }],
 *     }),
 * });
 * ```
 *
 * ## Import
 *
 * Tos Bucket can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:tos/bucket:Bucket default bucketName
 * ```
 */
class Bucket extends pulumi.CustomResource {
    /**
     * Get an existing Bucket 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 Bucket(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Bucket.  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'] === Bucket.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accountAcls"] = state ? state.accountAcls : undefined;
            resourceInputs["azRedundancy"] = state ? state.azRedundancy : undefined;
            resourceInputs["bucketAclDelivered"] = state ? state.bucketAclDelivered : undefined;
            resourceInputs["bucketName"] = state ? state.bucketName : undefined;
            resourceInputs["bucketType"] = state ? state.bucketType : undefined;
            resourceInputs["creationDate"] = state ? state.creationDate : undefined;
            resourceInputs["enableVersion"] = state ? state.enableVersion : undefined;
            resourceInputs["extranetEndpoint"] = state ? state.extranetEndpoint : undefined;
            resourceInputs["intranetEndpoint"] = state ? state.intranetEndpoint : undefined;
            resourceInputs["location"] = state ? state.location : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["publicAcl"] = state ? state.publicAcl : undefined;
            resourceInputs["storageClass"] = state ? state.storageClass : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.bucketName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'bucketName'");
            }
            resourceInputs["accountAcls"] = args ? args.accountAcls : undefined;
            resourceInputs["azRedundancy"] = args ? args.azRedundancy : undefined;
            resourceInputs["bucketAclDelivered"] = args ? args.bucketAclDelivered : undefined;
            resourceInputs["bucketName"] = args ? args.bucketName : undefined;
            resourceInputs["bucketType"] = args ? args.bucketType : undefined;
            resourceInputs["enableVersion"] = args ? args.enableVersion : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["publicAcl"] = args ? args.publicAcl : undefined;
            resourceInputs["storageClass"] = args ? args.storageClass : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["creationDate"] = undefined /*out*/;
            resourceInputs["extranetEndpoint"] = undefined /*out*/;
            resourceInputs["intranetEndpoint"] = undefined /*out*/;
            resourceInputs["location"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Bucket.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Bucket = Bucket;
/** @internal */
Bucket.__pulumiType = 'volcengine:tos/bucket:Bucket';
//# sourceMappingURL=bucket.js.map