/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { triggersCreateTrigger } from "../../funcs/triggersCreateTrigger.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: operations.CreateTriggerRequest$inboundSchema,
};
export const tool$triggersCreateTrigger = {
    name: "create-trigger",
    description: `Creates a new notification trigger (webhook) by specifying an event type and a destination

Creates a new trigger. 
Your product environment supports triggers up to a maximum determined by multiplying the number of unique event types by the limit of 30 notification URLs.
`,
    scopes: ["admin"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await 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 formatResult(value, apiCall);
    },
};
//# sourceMappingURL=triggersCreateTrigger.js.map