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

// Sub-schema: threadManagement — Actions related to creating, fetching, and managing threads.
// Auto-generated by the onboarding scaffolder.

export type ThreadManagementActions =
    | StartThreadFromMessageAction
    | StartThreadWithoutMessageAction
    | StartThreadInForumOrMediaChannelAction
    | JoinThreadAction
    | AddThreadMemberAction
    | LeaveThreadAction
    | RemoveThreadMemberAction
    | GetThreadMemberAction
    | ListThreadMembersAction
    | ListPublicArchivedThreadsAction
    | ListPrivateArchivedThreadsAction
    | ListJoinedPrivateArchivedThreadsAction;

export type StartThreadWithoutMessageAction = {
    actionName: "startThreadWithoutMessage";
    parameters: {
        // The ID of the channel to start the thread in.
        channel_id: string;
        // The name of the thread.
        name: string;
        // Duration in minutes to automatically archive the thread.
        auto_archive_duration?: number;
        // The type of thread to create.
        type?: number;
    };
};

// Start a thread in a forum or media channel.
export type StartThreadInForumOrMediaChannelAction = {
    actionName: "startThreadInForumOrMediaChannel";
    parameters: {
        // The ID of the forum or media channel.
        channel_id: string;
        // The name of the thread.
        name: string;
        // The initial message for the thread.
        message?: string;
    };
};

// Join a thread.
export type JoinThreadAction = {
    actionName: "joinThread";
    parameters: {
        // The ID of the thread to join.
        channel_id: string;
    };
};

// Add another member to a thread.
export type AddThreadMemberAction = {
    actionName: "addThreadMember";
    parameters: {
        // The ID of the thread.
        channel_id: string;
        // The ID of the user to add.
        user_id: string;
    };
};

// Leave a thread.
export type LeaveThreadAction = {
    actionName: "leaveThread";
    parameters: {
        // The ID of the thread to leave.
        channel_id: string;
    };
};

// Remove another member from a thread.
export type RemoveThreadMemberAction = {
    actionName: "removeThreadMember";
    parameters: {
        // The ID of the thread.
        channel_id: string;
        // The ID of the user to remove.
        user_id: string;
    };
};

// Get a thread member.
export type GetThreadMemberAction = {
    actionName: "getThreadMember";
    parameters: {
        // The ID of the thread.
        channel_id: string;
        // The ID of the user.
        user_id: string;
    };
};

// List members of a thread.
export type ListThreadMembersAction = {
    actionName: "listThreadMembers";
    parameters: {
        // The ID of the thread.
        channel_id: string;
    };
};

// List public archived threads in a channel.
export type ListPublicArchivedThreadsAction = {
    actionName: "listPublicArchivedThreads";
    parameters: {
        // The ID of the channel.
        channel_id: string;
        // Returns threads before this timestamp.
        before?: string;
        // Maximum number of threads to return.
        limit?: number;
    };
};

// List private archived threads in a channel.
export type ListPrivateArchivedThreadsAction = {
    actionName: "listPrivateArchivedThreads";
    parameters: {
        // The ID of the channel.
        channel_id: string;
        // Returns threads before this timestamp.
        before?: string;
        // Maximum number of threads to return.
        limit?: number;
    };
};

// List private archived threads joined by the current user.
export type ListJoinedPrivateArchivedThreadsAction = {
    actionName: "listJoinedPrivateArchivedThreads";
    parameters: {
        // The ID of the channel.
        channel_id: string;
        // Returns threads before this timestamp.
        before?: string;
        // Maximum number of threads to return.
        limit?: number;
    };
};
