/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { uploadUpload } from "../../funcs/uploadUpload.js";
import * as components from "../../models/components/index.js";
import { formatResult } from "../tools.js";
const args = {
    resourceType: components.UploadResourceType$inboundSchema.default("auto"),
    uploadRequest: components.UploadRequest$inboundSchema,
};
export const tool$uploadUpload = {
    name: "upload-asset",
    description: `Uploads media assets (images, videos, raw files) to your Cloudinary product environment

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.
`,
    scopes: ["librarian", "builder"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await uploadUpload(client, args.resourceType, args.uploadRequest, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=uploadUpload.js.map