/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 811aa635cedb
 */
import { uploadUpload } from "../../funcs/uploadUpload.js";
import { UploadRequest$zodSchema } from "../../models/uploadrequest.js";
import { UploadResourceType$zodSchema } from "../../models/uploadresourcetype.js";
import { appUri } from "../apps/uri.js";
import { formatResult } from "../tools.js";
const args = {
    resource_type: UploadResourceType$zodSchema.default("auto").describe(`The type of resource (image, video, raw, or auto).`),
    upload_request: UploadRequest$zodSchema.describe(`The file to upload and associated parameters.`),
};
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.

Transform media files using transformation syntax in delivery URLs, which creates derived files accessible immediately without re-uploading the original.
`,
    scopes: ["librarian", "builder"],
    annotations: {
        "title": "Upload Asset",
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "readOnlyHint": false,
    },
    _meta: {
        ui: { resourceUri: appUri("asset-upload", "upload-asset") },
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await uploadUpload(client, args.resource_type, args.upload_request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        return formatResult(result.value);
    },
};
//# sourceMappingURL=uploadUpload.js.map