"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Upload = exports.UploadChunkAcceptEnum = exports.UploadAcceptEnum = void 0;
const uploadDestroyAsset_js_1 = require("../funcs/uploadDestroyAsset.js");
const uploadText_js_1 = require("../funcs/uploadText.js");
const uploadUpload_js_1 = require("../funcs/uploadUpload.js");
const uploadUploadChunk_js_1 = require("../funcs/uploadUploadChunk.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
var uploadUpload_js_2 = require("../funcs/uploadUpload.js");
Object.defineProperty(exports, "UploadAcceptEnum", { enumerable: true, get: function () { return uploadUpload_js_2.UploadAcceptEnum; } });
var uploadUploadChunk_js_2 = require("../funcs/uploadUploadChunk.js");
Object.defineProperty(exports, "UploadChunkAcceptEnum", { enumerable: true, get: function () { return uploadUploadChunk_js_2.UploadChunkAcceptEnum; } });
class Upload extends sdks_js_1.ClientSDK {
    /**
     * Uploads media assets (images, videos, raw files) to your Cloudinary product environment
     *
     * @remarks
     * Uploads media assets (images, videos, raw files) to your Cloudinary product environment. The file is securely stored
     * in the cloud with backup and revision history. Cloudinary automatically analyzes and saves important data about each
     * asset, such as format, size, resolution, and prominent colors, which is indexed to enable searching on those attributes.
     *
     * Supports uploading from:
     * - Local file paths (SDKs/MCP server only). For MCP server path MUST start with file://
     * - Remote HTTP/HTTPS URLs
     * - Base64 Data URIs (max ~60 MB)
     * - Private storage buckets (S3 or Google Storage)
     * - FTP addresses
     *
     * The uploaded asset is immediately available for transformation and delivery upon successful upload.
     */
    async upload(resourceType, uploadRequest, options) {
        return (0, fp_js_1.unwrapAsync)((0, uploadUpload_js_1.uploadUpload)(this, resourceType, uploadRequest, options));
    }
    /**
     * Upload a single chunk of a large file
     *
     * @remarks
     * Uploads a single chunk of a large file as part of a chunked upload process. This enables efficient upload of
     * large files with the ability to resume interrupted uploads. Each request uploads one chunk of the file.
     * It is required for any files that are larger than 100 MB. This is often relevant for video files, as they
     * tend to have larger file sizes. Minimum chunk size is 5 MB.
     */
    async uploadChunk(resourceType, contentRange, xUniqueUploadId, uploadRequest, options) {
        return (0, fp_js_1.unwrapAsync)((0, uploadUploadChunk_js_1.uploadUploadChunk)(this, resourceType, contentRange, xUniqueUploadId, uploadRequest, options));
    }
    /**
     * Destroys an asset/resource
     */
    async destroyAsset(resourceType, publicId, invalidate, options) {
        return (0, fp_js_1.unwrapAsync)((0, uploadDestroyAsset_js_1.uploadDestroyAsset)(this, resourceType, publicId, invalidate, options));
    }
    /**
     * Create image from text
     *
     * @remarks
     * Dynamically generates an image from a specified text string.
     */
    async text(resourceType, requestBody, options) {
        return (0, fp_js_1.unwrapAsync)((0, uploadText_js_1.uploadText)(this, resourceType, requestBody, options));
    }
}
exports.Upload = Upload;
//# sourceMappingURL=upload.js.map