"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$triggersCreateTrigger = void 0;
const triggersCreateTrigger_js_1 = require("../../funcs/triggersCreateTrigger.js");
const operations = __importStar(require("../../models/operations/index.js"));
const tools_js_1 = require("../tools.js");
const args = {
    request: operations.CreateTriggerRequest$inboundSchema,
};
exports.tool$triggersCreateTrigger = {
    name: "create-trigger",
    description: `Purpose: Creates a new event trigger that automatically sends HTTP POST notifications to your specified URL when specific Cloudinary events occur. This enables real-time integration and automation workflows based on asset lifecycle events.
Usage: Use this to set up webhook notifications for asset uploads, deletions, transformations, moderation results, or other events. Essential for building event-driven integrations, audit systems, and automated content workflows.
Example request: {"uri": "https://trigger.site/124", "event_type": "upload"}
Parameters: uri(webhook URL that will receive notifications), event_type(type of event to monitor - upload, delete, transformation, moderation, etc.)
Note: Your account supports up to 30 notification URLs per event type. Total triggers are limited by (unique event types × 30).
When Not to Use: Don't create triggers for events you don't need to process, as this increases notification volume. Avoid creating duplicate triggers for the same event type and URL combination.
Output: Returns created trigger configuration: id(unique trigger identifier), uri(notification URL), event_type(monitored event type), created_at(creation timestamp)
Example output: {"id":"12345678","uri":"https://trigger.site/124","event_type":"upload","created_at":"2023-01-15T10:00:00Z"}
`,
    scopes: ["admin"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await (0, triggersCreateTrigger_js_1.triggersCreateTrigger)(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=triggersCreateTrigger.js.map