"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$transformationsDeleteTransformation = void 0;
const z = __importStar(require("zod"));
const transformationsDeleteTransformation_js_1 = require("../../funcs/transformationsDeleteTransformation.js");
const tools_js_1 = require("../tools.js");
const args = {
    transformation: z.string(),
    invalidate: z.boolean().optional(),
};
exports.tool$transformationsDeleteTransformation = {
    name: "delete-transformation",
    description: `Purpose: Permanently removes a named or unnamed transformation from your Cloudinary account. This operation can also invalidate all derived resources (cached versions) that were generated using this transformation.
Usage: Use this to clean up unused transformations, remove deprecated transformation configurations, or manage transformation inventory. Essential for maintaining organized transformation catalogs and reducing account clutter.
Example request: DELETE /transformations/my_old_transformation?invalidate=true
Parameters: transformation(URL-encoded transformation string or name), invalidate(whether to invalidate derived resources using this transformation from CDN)
When Not to Use: Don't delete transformations that are still actively used in production applications, as this will break image/video delivery. Avoid deleting without testing if invalidate=true, as this affects cached content delivery.
Output: Returns deletion confirmation: message(deletion status confirmation)
Example output: {"message": "deleted"}
`,
    scopes: ["admin"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await (0, transformationsDeleteTransformation_js_1.transformationsDeleteTransformation)(client, args.transformation, args.invalidate, { 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=transformationsDeleteTransformation.js.map