"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.SharedImageVersion = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Version of a Shared Image within a Shared Image Gallery.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const existing = azure.compute.getImage({
 *     name: "search-api",
 *     resourceGroupName: "packerimages",
 * });
 * const existingGetSharedImage = azure.compute.getSharedImage({
 *     name: "existing-image",
 *     galleryName: "existing_gallery",
 *     resourceGroupName: "existing-resources",
 * });
 * const example = new azure.compute.SharedImageVersion("example", {
 *     name: "0.0.1",
 *     galleryName: existingGetSharedImage.then(existingGetSharedImage => existingGetSharedImage.galleryName),
 *     imageName: existingGetSharedImage.then(existingGetSharedImage => existingGetSharedImage.name),
 *     resourceGroupName: existingGetSharedImage.then(existingGetSharedImage => existingGetSharedImage.resourceGroupName),
 *     location: existingGetSharedImage.then(existingGetSharedImage => existingGetSharedImage.location),
 *     managedImageId: existing.then(existing => existing.id),
 *     targetRegions: [{
 *         name: existingGetSharedImage.then(existingGetSharedImage => existingGetSharedImage.location),
 *         regionalReplicaCount: 5,
 *         storageAccountType: "Standard_LRS",
 *     }],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Compute` - 2023-07-03
 *
 * ## Import
 *
 * Shared Image Versions can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:compute/sharedImageVersion:SharedImageVersion version /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/images/image1/versions/1.2.3
 * ```
 */
class SharedImageVersion extends pulumi.CustomResource {
    /**
     * Get an existing SharedImageVersion 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 SharedImageVersion(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:compute/sharedImageVersion:SharedImageVersion';
    /**
     * Returns true if the given object is an instance of SharedImageVersion.  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'] === SharedImageVersion.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["blobUri"] = state?.blobUri;
            resourceInputs["deletionOfReplicatedLocationsEnabled"] = state?.deletionOfReplicatedLocationsEnabled;
            resourceInputs["endOfLifeDate"] = state?.endOfLifeDate;
            resourceInputs["excludeFromLatest"] = state?.excludeFromLatest;
            resourceInputs["galleryName"] = state?.galleryName;
            resourceInputs["imageName"] = state?.imageName;
            resourceInputs["location"] = state?.location;
            resourceInputs["managedImageId"] = state?.managedImageId;
            resourceInputs["name"] = state?.name;
            resourceInputs["osDiskSnapshotId"] = state?.osDiskSnapshotId;
            resourceInputs["replicationMode"] = state?.replicationMode;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["storageAccountId"] = state?.storageAccountId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["targetRegions"] = state?.targetRegions;
        }
        else {
            const args = argsOrState;
            if (args?.galleryName === undefined && !opts.urn) {
                throw new Error("Missing required property 'galleryName'");
            }
            if (args?.imageName === undefined && !opts.urn) {
                throw new Error("Missing required property 'imageName'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.targetRegions === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetRegions'");
            }
            resourceInputs["blobUri"] = args?.blobUri;
            resourceInputs["deletionOfReplicatedLocationsEnabled"] = args?.deletionOfReplicatedLocationsEnabled;
            resourceInputs["endOfLifeDate"] = args?.endOfLifeDate;
            resourceInputs["excludeFromLatest"] = args?.excludeFromLatest;
            resourceInputs["galleryName"] = args?.galleryName;
            resourceInputs["imageName"] = args?.imageName;
            resourceInputs["location"] = args?.location;
            resourceInputs["managedImageId"] = args?.managedImageId;
            resourceInputs["name"] = args?.name;
            resourceInputs["osDiskSnapshotId"] = args?.osDiskSnapshotId;
            resourceInputs["replicationMode"] = args?.replicationMode;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["storageAccountId"] = args?.storageAccountId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["targetRegions"] = args?.targetRegions;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(SharedImageVersion.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SharedImageVersion = SharedImageVersion;
//# sourceMappingURL=sharedImageVersion.js.map