"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$uploadPresetsListUploadPresets = void 0;
const z = __importStar(require("zod"));
const uploadPresetsListUploadPresets_js_1 = require("../../funcs/uploadPresetsListUploadPresets.js");
const operations = __importStar(require("../../models/operations/index.js"));
const tools_js_1 = require("../tools.js");
const args = {
    orderBy: operations.ListUploadPresetsOrderBy$inboundSchema.optional(),
    direction: operations.ListUploadPresetsDirection$inboundSchema.optional(),
    nextCursor: z.number().int().optional(),
};
exports.tool$uploadPresetsListUploadPresets = {
    name: "list-upload-presets",
    description: `Purpose: Lists all upload presets defined in your Cloudinary product environment with their complete configuration settings. Upload presets contain predefined upload parameters that streamline file processing workflows.
Usage: Use when you need to audit existing upload configurations, build management interfaces, or understand available preset options before creating new ones. Essential for preset management and configuration discovery.
Example request: GET /upload_presets (no request body required)
Parameters: direction(asc/desc sort order), order_by(name/id/updated_at sort field), next_cursor(pagination token for additional results)
When Not to Use: Don't use for retrieving a single preset's details - use get-upload-preset-details instead. Avoid frequent polling as preset configurations rarely change.
Output: Returns array of preset objects with configuration details: presets(array containing preset objects), name(preset identifier), unsigned(authentication requirement), settings(configuration object with upload parameters), external_id(unique system identifier)
Example output: {"presets":[{"name":"Prepend Folder","unsigned":false,"settings":{"overwrite":"1","use_filename":"1","unique_filename":"0","use_filename_as_display_name":"1","use_asset_folder_as_public_id_prefix":"1","type":"upload"},"external_id":"6052708a-94b2-47e3-9368-c9de14032b72"}]}
`,
    scopes: ["builder"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await (0, uploadPresetsListUploadPresets_js_1.uploadPresetsListUploadPresets)(client, args.orderBy, args.direction, args.nextCursor, { 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=uploadPresetsListUploadPresets.js.map