// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

// Sub-schema: webhookManagement — Actions related to creating, fetching, and executing webhooks.
// Auto-generated by the onboarding scaffolder.

export type WebhookManagementActions =
    | CreateWebhookAction
    | GetWebhookAction
    | ExecuteWebhookAction;

// Creates a new webhook in a specified channel.
// Sample phrases:
//   - "Can you set up a new webhook in the channel with ID 12345? Name it 'Updates' and use the avatar image from this link."
//   - "Please create a webhook named 'Alerts' in the channel 67890 and use this avatar for it."
//   - "I need a new webhook in channel 54321 called 'Notifications'. Use this avatar image for it."
export type CreateWebhookAction = {
    actionName: "createWebhook";
    parameters: {
        // The ID of the channel where the webhook will be created.
        channel_id: string;
        // The name of the webhook.
        name: string;
        // The avatar for the webhook.
        avatar?: string;
    };
};

// Fetches a webhook object for a given webhook ID.
// Sample phrases:
//   - "Can you fetch the webhook details for ID 12345?"
//   - "I need the webhook information for webhook ID 12345."
//   - "Please get the webhook object for the ID 12345."
export type GetWebhookAction = {
    actionName: "getWebhook";
    parameters: {
        // The ID of the webhook to fetch.
        webhook_id: string;
    };
};

// Executes a webhook, sending a message to the channel.
// Sample phrases:
//   - "Send a message using the webhook with ID 12345 and token abcde. The content should be 'Hello everyone!', and use the username 'Bot' with the avatar URL 'http://example.com/avatar.png'. Make it a TTS message."
//   - "Can you execute the webhook with ID 12345 and token abcde? The message should say 'Hello everyone!', and use the username 'Bot' with the avatar 'http://example.com/avatar.png'. Also, make it a TTS message."
//   - "Please trigger the webhook with ID 12345 and token abcde to send a message saying 'Hello everyone!'. Use 'Bot' as the username and 'http://example.com/avatar.png' as the avatar. Enable TTS for this message."
export type ExecuteWebhookAction = {
    actionName: "executeWebhook";
    parameters: {
        // The ID of the webhook to execute.
        webhook_id: string;
        // The token for the webhook.
        webhook_token: string;
        // The content of the message.
        content?: string;
        // The username to use for the message.
        username?: string;
        // The avatar URL to use for the message.
        avatar_url?: string;
        // Whether the message should be sent as text-to-speech.
        tts?: boolean;
    };
};
