"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.StorageObject = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Object resource in Oracle Cloud Infrastructure Object Storage service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/objectstorage/latest/Object
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/
 *
 * Creates a new object or overwrites an existing object with the same name. The maximum object size allowed by
 * PutObject is 50 GiB.
 *
 * See [Object Names](https://docs.cloud.oracle.com/iaas/Content/Object/Tasks/managingobjects.htm#namerequirements)
 * for object naming requirements.
 *
 * See [Special Instructions for Object Storage PUT](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/signingrequests.htm#ObjectStoragePut)
 * for request signature requirements.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testObject = new oci.objectstorage.StorageObject("test_object", {
 *     bucket: objectBucket,
 *     content: objectContent,
 *     namespace: objectNamespace,
 *     object: objectObject,
 *     cacheControl: objectCacheControl,
 *     contentDisposition: objectContentDisposition,
 *     contentEncoding: objectContentEncoding,
 *     contentLanguage: objectContentLanguage,
 *     contentType: objectContentType,
 *     deleteAllObjectVersions: objectDeleteAllObjectVersions === "true",
 *     metadata: objectMetadata,
 *     storageTier: objectStorageTier,
 *     opcSseKmsKeyId: objectOpcSseKmsKeyId,
 * });
 * ```
 *
 * ## Import
 *
 * Objects can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:ObjectStorage/storageObject:StorageObject test_object "n/{namespaceName}/b/{bucketName}/o/{objectName}"
 * ```
 */
class StorageObject extends pulumi.CustomResource {
    /**
     * Get an existing StorageObject 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 StorageObject(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:ObjectStorage/storageObject:StorageObject';
    /**
     * Returns true if the given object is an instance of StorageObject.  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'] === StorageObject.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["bucket"] = state?.bucket;
            resourceInputs["cacheControl"] = state?.cacheControl;
            resourceInputs["content"] = state?.content;
            resourceInputs["contentDisposition"] = state?.contentDisposition;
            resourceInputs["contentEncoding"] = state?.contentEncoding;
            resourceInputs["contentLanguage"] = state?.contentLanguage;
            resourceInputs["contentLength"] = state?.contentLength;
            resourceInputs["contentMd5"] = state?.contentMd5;
            resourceInputs["contentType"] = state?.contentType;
            resourceInputs["deleteAllObjectVersions"] = state?.deleteAllObjectVersions;
            resourceInputs["metadata"] = state?.metadata;
            resourceInputs["namespace"] = state?.namespace;
            resourceInputs["object"] = state?.object;
            resourceInputs["opcSseKmsKeyId"] = state?.opcSseKmsKeyId;
            resourceInputs["source"] = state?.source;
            resourceInputs["sourceUriDetails"] = state?.sourceUriDetails;
            resourceInputs["state"] = state?.state;
            resourceInputs["storageTier"] = state?.storageTier;
            resourceInputs["versionId"] = state?.versionId;
            resourceInputs["workRequestId"] = state?.workRequestId;
        }
        else {
            const args = argsOrState;
            if (args?.bucket === undefined && !opts.urn) {
                throw new Error("Missing required property 'bucket'");
            }
            if (args?.namespace === undefined && !opts.urn) {
                throw new Error("Missing required property 'namespace'");
            }
            if (args?.object === undefined && !opts.urn) {
                throw new Error("Missing required property 'object'");
            }
            resourceInputs["bucket"] = args?.bucket;
            resourceInputs["cacheControl"] = args?.cacheControl;
            resourceInputs["content"] = args?.content;
            resourceInputs["contentDisposition"] = args?.contentDisposition;
            resourceInputs["contentEncoding"] = args?.contentEncoding;
            resourceInputs["contentLanguage"] = args?.contentLanguage;
            resourceInputs["contentMd5"] = args?.contentMd5;
            resourceInputs["contentType"] = args?.contentType;
            resourceInputs["deleteAllObjectVersions"] = args?.deleteAllObjectVersions;
            resourceInputs["metadata"] = args?.metadata;
            resourceInputs["namespace"] = args?.namespace;
            resourceInputs["object"] = args?.object;
            resourceInputs["opcSseKmsKeyId"] = args?.opcSseKmsKeyId;
            resourceInputs["source"] = args?.source;
            resourceInputs["sourceUriDetails"] = args?.sourceUriDetails;
            resourceInputs["storageTier"] = args?.storageTier;
            resourceInputs["contentLength"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["versionId"] = undefined /*out*/;
            resourceInputs["workRequestId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(StorageObject.__pulumiType, name, resourceInputs, opts);
    }
}
exports.StorageObject = StorageObject;
//# sourceMappingURL=storageObject.js.map