"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.BucketInventory = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage tos bucket inventory
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.tos.BucketInventory("foo", {
 *     bucketName: "terraform-demo",
 *     destination: {
 *         tosBucketDestination: {
 *             accountId: "21000*****",
 *             bucket: "terraform-demo",
 *             format: "CSV",
 *             prefix: "tf-test-prefix",
 *             role: "TosArchiveTOSInventory",
 *         },
 *     },
 *     filter: {
 *         prefix: "test-tf",
 *     },
 *     includedObjectVersions: "All",
 *     inventoryId: "acc-test-inventory",
 *     isEnabled: true,
 *     optionalFields: {
 *         fields: [
 *             "Size",
 *             "StorageClass",
 *             "CRC64",
 *         ],
 *     },
 *     schedule: {
 *         frequency: "Weekly",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * TosBucketInventory can be imported using the bucket_name:inventory_id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:tos/bucketInventory:BucketInventory default resource_id
 * ```
 */
class BucketInventory extends pulumi.CustomResource {
    /**
     * Get an existing BucketInventory 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 BucketInventory(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of BucketInventory.  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'] === BucketInventory.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["bucketName"] = state ? state.bucketName : undefined;
            resourceInputs["destination"] = state ? state.destination : undefined;
            resourceInputs["filter"] = state ? state.filter : undefined;
            resourceInputs["includedObjectVersions"] = state ? state.includedObjectVersions : undefined;
            resourceInputs["inventoryId"] = state ? state.inventoryId : undefined;
            resourceInputs["isEnabled"] = state ? state.isEnabled : undefined;
            resourceInputs["optionalFields"] = state ? state.optionalFields : undefined;
            resourceInputs["schedule"] = state ? state.schedule : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.bucketName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'bucketName'");
            }
            if ((!args || args.destination === undefined) && !opts.urn) {
                throw new Error("Missing required property 'destination'");
            }
            if ((!args || args.includedObjectVersions === undefined) && !opts.urn) {
                throw new Error("Missing required property 'includedObjectVersions'");
            }
            if ((!args || args.inventoryId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'inventoryId'");
            }
            if ((!args || args.isEnabled === undefined) && !opts.urn) {
                throw new Error("Missing required property 'isEnabled'");
            }
            if ((!args || args.schedule === undefined) && !opts.urn) {
                throw new Error("Missing required property 'schedule'");
            }
            resourceInputs["bucketName"] = args ? args.bucketName : undefined;
            resourceInputs["destination"] = args ? args.destination : undefined;
            resourceInputs["filter"] = args ? args.filter : undefined;
            resourceInputs["includedObjectVersions"] = args ? args.includedObjectVersions : undefined;
            resourceInputs["inventoryId"] = args ? args.inventoryId : undefined;
            resourceInputs["isEnabled"] = args ? args.isEnabled : undefined;
            resourceInputs["optionalFields"] = args ? args.optionalFields : undefined;
            resourceInputs["schedule"] = args ? args.schedule : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(BucketInventory.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BucketInventory = BucketInventory;
/** @internal */
BucketInventory.__pulumiType = 'volcengine:tos/bucketInventory:BucketInventory';
//# sourceMappingURL=bucketInventory.js.map