"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.Snapshot = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage ebs snapshot
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooZones = volcengine.ecs.getZones({});
 * const fooVolume = new volcengine.ebs.Volume("fooVolume", {
 *     volumeName: "acc-test-volume",
 *     volumeType: "ESSD_PL0",
 *     description: "acc-test",
 *     kind: "data",
 *     size: 500,
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     volumeChargeType: "PostPaid",
 *     projectName: "default",
 * });
 * const fooSnapshot = new volcengine.ebs.Snapshot("fooSnapshot", {
 *     volumeId: fooVolume.id,
 *     snapshotName: "acc-test-snapshot",
 *     description: "acc-test",
 *     retentionDays: 3,
 *     projectName: "default",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * EbsSnapshot can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:ebs/snapshot:Snapshot default resource_id
 * ```
 */
class Snapshot extends pulumi.CustomResource {
    /**
     * Get an existing Snapshot 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 Snapshot(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Snapshot.  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'] === Snapshot.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["creationTime"] = state ? state.creationTime : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["retentionDays"] = state ? state.retentionDays : undefined;
            resourceInputs["snapshotName"] = state ? state.snapshotName : undefined;
            resourceInputs["snapshotType"] = state ? state.snapshotType : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
            resourceInputs["volumeId"] = state ? state.volumeId : undefined;
            resourceInputs["volumeKind"] = state ? state.volumeKind : undefined;
            resourceInputs["volumeName"] = state ? state.volumeName : undefined;
            resourceInputs["volumeSize"] = state ? state.volumeSize : undefined;
            resourceInputs["volumeStatus"] = state ? state.volumeStatus : undefined;
            resourceInputs["volumeType"] = state ? state.volumeType : undefined;
            resourceInputs["zoneId"] = state ? state.zoneId : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.snapshotName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'snapshotName'");
            }
            if ((!args || args.volumeId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'volumeId'");
            }
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["retentionDays"] = args ? args.retentionDays : undefined;
            resourceInputs["snapshotName"] = args ? args.snapshotName : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["volumeId"] = args ? args.volumeId : undefined;
            resourceInputs["creationTime"] = undefined /*out*/;
            resourceInputs["snapshotType"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
            resourceInputs["volumeKind"] = undefined /*out*/;
            resourceInputs["volumeName"] = undefined /*out*/;
            resourceInputs["volumeSize"] = undefined /*out*/;
            resourceInputs["volumeStatus"] = undefined /*out*/;
            resourceInputs["volumeType"] = undefined /*out*/;
            resourceInputs["zoneId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Snapshot.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Snapshot = Snapshot;
/** @internal */
Snapshot.__pulumiType = 'volcengine:ebs/snapshot:Snapshot';
//# sourceMappingURL=snapshot.js.map