"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Volume = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Elastic SAN Volume resource.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleElasticSan = new azure.elasticsan.ElasticSan("example", {
 *     name: "example-es",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     baseSizeInTib: 1,
 *     sku: {
 *         name: "Premium_LRS",
 *     },
 * });
 * const exampleVolumeGroup = new azure.elasticsan.VolumeGroup("example", {
 *     name: "example-esvg",
 *     elasticSanId: exampleElasticSan.id,
 * });
 * const exampleVolume = new azure.elasticsan.Volume("example", {
 *     name: "example-esv",
 *     volumeGroupId: exampleVolumeGroup.id,
 *     sizeInGib: 1,
 * });
 * export const targetIqn = exampleVolume.targetIqn;
 * ```
 *
 * ## Example of creating an Elastic SAN Volume from a Disk Snapshot
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleElasticSan = new azure.elasticsan.ElasticSan("example", {
 *     name: "example-es",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     baseSizeInTib: 1,
 *     sku: {
 *         name: "Premium_LRS",
 *     },
 * });
 * const exampleVolumeGroup = new azure.elasticsan.VolumeGroup("example", {
 *     name: "example-esvg",
 *     elasticSanId: exampleElasticSan.id,
 * });
 * const exampleManagedDisk = new azure.compute.ManagedDisk("example", {
 *     name: "example-disk",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     createOption: "Empty",
 *     storageAccountType: "Standard_LRS",
 *     diskSizeGb: 2,
 * });
 * const exampleSnapshot = new azure.compute.Snapshot("example", {
 *     name: "example-ss",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     createOption: "Copy",
 *     sourceUri: exampleManagedDisk.id,
 * });
 * const example2 = new azure.elasticsan.Volume("example2", {
 *     name: "example-esv2",
 *     volumeGroupId: exampleVolumeGroup.id,
 *     sizeInGib: 2,
 *     createSource: {
 *         sourceType: "DiskSnapshot",
 *         sourceId: exampleSnapshot.id,
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.ElasticSan` - 2023-01-01
 *
 * ## Import
 *
 * An existing Elastic SAN Volume can be imported into Pulumi using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:elasticsan/volume:Volume example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ElasticSan/elasticSans/esan1/volumeGroups/vg1/volumes/vol1
 * ```
 */
class Volume extends pulumi.CustomResource {
    /**
     * Get an existing Volume 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 Volume(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:elasticsan/volume:Volume';
    /**
     * Returns true if the given object is an instance of Volume.  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'] === Volume.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createSource"] = state?.createSource;
            resourceInputs["name"] = state?.name;
            resourceInputs["sizeInGib"] = state?.sizeInGib;
            resourceInputs["targetIqn"] = state?.targetIqn;
            resourceInputs["targetPortalHostname"] = state?.targetPortalHostname;
            resourceInputs["targetPortalPort"] = state?.targetPortalPort;
            resourceInputs["volumeGroupId"] = state?.volumeGroupId;
            resourceInputs["volumeId"] = state?.volumeId;
        }
        else {
            const args = argsOrState;
            if (args?.sizeInGib === undefined && !opts.urn) {
                throw new Error("Missing required property 'sizeInGib'");
            }
            if (args?.volumeGroupId === undefined && !opts.urn) {
                throw new Error("Missing required property 'volumeGroupId'");
            }
            resourceInputs["createSource"] = args?.createSource;
            resourceInputs["name"] = args?.name;
            resourceInputs["sizeInGib"] = args?.sizeInGib;
            resourceInputs["volumeGroupId"] = args?.volumeGroupId;
            resourceInputs["targetIqn"] = undefined /*out*/;
            resourceInputs["targetPortalHostname"] = undefined /*out*/;
            resourceInputs["targetPortalPort"] = undefined /*out*/;
            resourceInputs["volumeId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Volume.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Volume = Volume;
//# sourceMappingURL=volume.js.map