"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
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 () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.tool$uploadPresetsCreateUploadPreset = void 0;
const uploadPresetsCreateUploadPreset_js_1 = require("../../funcs/uploadPresetsCreateUploadPreset.js");
const components = __importStar(require("../../models/components/index.js"));
const tools_js_1 = require("../tools.js");
const args = {
    request: components.UploadPreset$inboundSchema,
};
exports.tool$uploadPresetsCreateUploadPreset = {
    name: "create-upload-preset",
    description: `Purpose: Creates a new named upload preset that defines default upload parameters and transformations. Upload presets streamline the upload process by pre-configuring settings like folder destinations, tags, transformations, and access controls for consistent file handling.
Usage: Use when you need to standardize upload configurations for different content types that require different processing rules (e.g., user profile photos need resizing and face detection, product catalog images need multiple size variants, temporary files need minimal processing). Essential for creating reusable upload workflows that ensure consistent processing and organization.
Example request: {"name": "temp-new-upload-preset", "unsigned": true, "use_filename": true, "unique_filename": false, "folder": "temp", "tags": "temp,test"}
Note: Cannot set overwrite=true for unsigned presets due to security restrictions.
Parameters - examples of parameters that can be used: name(preset identifier), unsigned(allows uploads without authentication), use_filename(preserves original filename), unique_filename(generates unique names), folder(destination folder), tags(comma-separated labels), overwrite(replace existing files - not allowed for unsigned), access_mode(public/authenticated), type(upload type), transformation(image/video processing), allowed_formats(permitted file types), backup(create backup copy), auto_tagging(AI tagging threshold), faces(face detection), colors(color analysis), quality_analysis(image quality check), moderation(content moderation service), notification_url(webhook endpoint), async(background processing), eager(generate derivatives), display_name(human readable name)
When Not to Use: Don't create upload presets for one-time uploads or when upload requirements frequently change. Avoid creating duplicates of existing presets - use update-upload-preset to modify existing configurations instead.
Output: Returns creation confirmation with preset identification details: message(creation status - "created"), name(preset identifier as specified), external_id(unique system-generated identifier for internal tracking)
Example output: {"message":"created","name":"temp-new-upload-preset","external_id":"26c944df-84f0-4bd3-afa6-1cb177fce5dc"}
`,
    scopes: ["builder"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await (0, uploadPresetsCreateUploadPreset_js_1.uploadPresetsCreateUploadPreset)(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return (0, tools_js_1.formatResult)(value, apiCall);
    },
};
//# sourceMappingURL=uploadPresetsCreateUploadPreset.js.map