"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.Image = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Image resource in Oracle Cloud Infrastructure Core service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/iaas/latest/Image
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/
 *
 * Creates a boot disk image for the specified instance or imports an exported image from the Oracle Cloud Infrastructure Object Storage service.
 *
 * When creating a new image, you must provide the OCID of the instance you want to use as the basis for the image, and
 * the OCID of the compartment containing that instance. For more information about images,
 * see [Managing Custom Images](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/managingcustomimages.htm).
 *
 * When importing an exported image from Object Storage, you specify the source information
 * in [ImageSourceDetails](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/requests/ImageSourceDetails).
 *
 * When importing an image based on the namespace, bucket name, and object name,
 * use [ImageSourceViaObjectStorageTupleDetails](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/requests/ImageSourceViaObjectStorageTupleDetails).
 *
 * When importing an image based on the Object Storage URL, use
 * [ImageSourceViaObjectStorageUriDetails](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/requests/ImageSourceViaObjectStorageUriDetails).
 * See [Object Storage URLs](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/imageimportexport.htm#URLs) and [Using Pre-Authenticated Requests](https://docs.cloud.oracle.com/iaas/Content/Object/Tasks/usingpreauthenticatedrequests.htm)
 * for constructing URLs for image import/export.
 *
 * For more information about importing exported images, see
 * [Image Import/Export](https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/imageimportexport.htm).
 *
 * You may optionally specify a *display name* for the image, which is simply a friendly name or description.
 * It does not have to be unique, and you can change it. See [UpdateImage](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/Image/UpdateImage).
 * Avoid entering confidential information.
 *
 * ## Example Usage
 *
 * ### Create image from instance in tenancy
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testImage = new oci.core.Image("test_image", {
 *     compartmentId: compartmentId,
 *     instanceId: testInstance.id,
 *     definedTags: {
 *         "Operations.CostCenter": "42",
 *     },
 *     displayName: imageDisplayName,
 *     launchMode: imageLaunchMode,
 *     freeformTags: {
 *         Department: "Finance",
 *     },
 * });
 * ```
 *
 * ### Create image from exported image via direct access to object store
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testImage = new oci.core.Image("test_image", {
 *     compartmentId: compartmentId,
 *     displayName: imageDisplayName,
 *     launchMode: imageLaunchMode,
 *     imageSourceDetails: {
 *         sourceType: "objectStorageTuple",
 *         bucketName: bucketName,
 *         namespaceName: namespace,
 *         objectName: objectName,
 *         operatingSystem: imageImageSourceDetailsOperatingSystem,
 *         operatingSystemVersion: imageImageSourceDetailsOperatingSystemVersion,
 *         sourceImageType: sourceImageType,
 *     },
 * });
 * ```
 *
 * ### Create image from exported image at publicly accessible uri
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testImage = new oci.core.Image("test_image", {
 *     compartmentId: compartmentId,
 *     displayName: imageDisplayName,
 *     launchMode: imageLaunchMode,
 *     imageSourceDetails: {
 *         sourceType: "objectStorageUri",
 *         sourceUri: sourceUri,
 *         operatingSystem: imageImageSourceDetailsOperatingSystem,
 *         operatingSystemVersion: imageImageSourceDetailsOperatingSystemVersion,
 *         sourceImageType: sourceImageType,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Images can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Core/image:Image test_image "id"
 * ```
 */
class Image extends pulumi.CustomResource {
    /**
     * Get an existing Image 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 Image(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Core/image:Image';
    /**
     * Returns true if the given object is an instance of Image.  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'] === Image.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["agentFeatures"] = state?.agentFeatures;
            resourceInputs["baseImageId"] = state?.baseImageId;
            resourceInputs["billableSizeInGbs"] = state?.billableSizeInGbs;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["createImageAllowed"] = state?.createImageAllowed;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["imageSourceDetails"] = state?.imageSourceDetails;
            resourceInputs["instanceId"] = state?.instanceId;
            resourceInputs["launchMode"] = state?.launchMode;
            resourceInputs["launchOptions"] = state?.launchOptions;
            resourceInputs["listingType"] = state?.listingType;
            resourceInputs["operatingSystem"] = state?.operatingSystem;
            resourceInputs["operatingSystemVersion"] = state?.operatingSystemVersion;
            resourceInputs["sizeInMbs"] = state?.sizeInMbs;
            resourceInputs["state"] = state?.state;
            resourceInputs["timeCreated"] = state?.timeCreated;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["imageSourceDetails"] = args?.imageSourceDetails;
            resourceInputs["instanceId"] = args?.instanceId;
            resourceInputs["launchMode"] = args?.launchMode;
            resourceInputs["agentFeatures"] = undefined /*out*/;
            resourceInputs["baseImageId"] = undefined /*out*/;
            resourceInputs["billableSizeInGbs"] = undefined /*out*/;
            resourceInputs["createImageAllowed"] = undefined /*out*/;
            resourceInputs["launchOptions"] = undefined /*out*/;
            resourceInputs["listingType"] = undefined /*out*/;
            resourceInputs["operatingSystem"] = undefined /*out*/;
            resourceInputs["operatingSystemVersion"] = undefined /*out*/;
            resourceInputs["sizeInMbs"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Image.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Image = Image;
//# sourceMappingURL=image.js.map