/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { triggersUpdateTrigger } from "../../funcs/triggersUpdateTrigger.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    id: z.string(),
    requestBody: operations.UpdateTriggerRequestBody$inboundSchema,
};
export const tool$triggersUpdateTrigger = {
    name: "update-trigger",
    description: `Updates the callback URL of an existing webhook trigger in your Cloudinary account

Updates a notification URL for a trigger.`,
    scopes: ["admin"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await triggersUpdateTrigger(client, args.id, args.requestBody, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=triggersUpdateTrigger.js.map