// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
    baseUrl: 'http://localhost:8080' | (string & {});
};

export type HealthResponse = {
    ok: boolean;
    mode: string;
    timestamp: string;
    storage: HealthStorageStatus;
};

export type HealthStorageStatus = {
    provider: string;
    ok: boolean;
    error?: string;
};

export type MetricsResponse = {
    generatedAt: string;
    uptimeSeconds: number;
    requestsTotal: number;
    statusClassTotals: {
        [key: string]: number;
    };
    routes: Array<MetricsRouteStat>;
};

export type MetricsRouteStat = {
    method: string;
    path: string;
    status: number;
    count: number;
    avgLatencyMs: number;
    maxLatencyMs: number;
    lastSeenAt: string;
};

export type ErrorResponse = {
    error: ErrorDetail;
};

export type ErrorDetail = {
    code: string;
    message: string;
    requestId: string;
};

export type BoardGroup = {
    id: string;
    workspaceSlug: string;
    name: string;
    color: string;
    order: number;
};

export type Workspace = {
    id: string;
    slug: string;
    name: string;
    role: 'owner' | 'admin' | 'member';
    createdAt: string;
};

export type Member = {
    id: string;
    workspaceSlug: string;
    name: string;
    email: string;
    role: 'owner' | 'admin' | 'member';
    status: 'active' | 'invited' | 'removed';
};

export type Invite = {
    id: string;
    workspaceSlug: string;
    email: string;
    role: 'owner' | 'admin' | 'member';
    token: string;
    createdAt: string;
    status: 'pending' | 'accepted';
};

export type ActivityEntry = {
    id: string;
    workspaceSlug: string;
    title: string;
    detail: string;
    createdAt: string;
};

export type Label = {
    id: string;
    workspaceSlug: string;
    name: string;
    color: string;
};

export type Attachment = {
    id: string;
    name: string;
    mimeType: string;
    size: number;
    dataUrl?: string;
};

export type TaskComment = {
    id: string;
    taskId: string;
    author: string;
    content: string;
    createdAt: string;
};

export type Task = {
    id: string;
    workspaceSlug: string;
    boardGroupId: string;
    title: string;
    description?: string;
    status: 'todo' | 'in_progress' | 'done';
    color: string;
    dueAt?: string;
    scheduledStart?: string;
    scheduledEnd?: string;
    assigneeId?: string;
    labelIds: Array<string>;
    attachments: Array<Attachment>;
    comments: Array<TaskComment>;
    createdAt: string;
    updatedAt: string;
};

export type CreateTaskInput = {
    workspaceSlug: string;
    boardGroupId: string;
    title: string;
    description?: string;
    dueAt?: string;
    color?: string;
};

export type UpdateTaskInput = {
    title?: string;
    description?: string;
    status?: 'todo' | 'in_progress' | 'done';
    boardGroupId?: string;
    color?: string;
    dueAt?: string;
    scheduledStart?: string;
    scheduledEnd?: string;
    assigneeId?: string;
    labelIds?: Array<string>;
    attachments?: Array<Attachment>;
    comments?: Array<TaskComment>;
};

export type CalendarEvent = {
    id: string;
    workspaceSlug: string;
    title: string;
    description?: string;
    startsAt: string;
    endsAt: string;
    color: string;
    linkedTaskId?: string;
    attachments: Array<Attachment>;
};

export type CreateCalendarEventInput = {
    workspaceSlug: string;
    title: string;
    description?: string;
    startsAt: string;
    endsAt: string;
    linkedTaskId?: string;
    color?: string;
    attachments?: Array<Attachment>;
};

export type UpdateCalendarEventInput = {
    title?: string;
    description?: string;
    startsAt?: string;
    endsAt?: string;
    linkedTaskId?: string;
    color?: string;
    attachments?: Array<Attachment>;
};

export type Note = {
    id: string;
    workspaceSlug: string;
    title: string;
    content: string;
    updatedAt: string;
};

export type CreateNoteInput = {
    workspaceSlug: string;
    title: string;
    content: string;
};

export type UpdateNoteInput = {
    title?: string;
    content?: string;
};

export type FocusSession = {
    id: string;
    workspaceSlug: string;
    taskId?: string;
    mode: 'focus' | 'short_break' | 'long_break';
    startedAt: string;
    completedAt?: string;
    pausedAt?: string;
    pausedTotalSeconds: number;
    durationSeconds: number;
};

export type CreateFocusSessionInput = {
    workspaceSlug: string;
    taskId?: string;
    mode: 'focus' | 'short_break' | 'long_break';
    durationSeconds: number;
};

export type UpdateFocusSessionInput = {
    completedAt?: string;
    pausedAt?: string;
    pausedTotalSeconds?: number;
};

export type MailAddress = {
    name: string;
    email: string;
};

export type Mailbox = {
    id: string;
    workspaceSlug: string;
    label: string;
    email: string;
    displayName: string;
    imapHost: string;
    imapPort: number;
    imapUsername: string;
    imapUseTls: boolean;
    smtpHost: string;
    smtpPort: number;
    smtpUsername: string;
    smtpUseTls: boolean;
    createdAt: string;
    updatedAt: string;
    lastSyncedAt?: string;
    syncStatus: 'idle' | 'syncing' | 'ready' | 'error';
    syncError?: string;
};

export type MailMessage = {
    id: string;
    workspaceSlug: string;
    mailboxId: string;
    remoteUid: number;
    messageId: string;
    folder: string;
    from: MailAddress;
    to: Array<MailAddress>;
    cc: Array<MailAddress>;
    subject: string;
    snippet: string;
    textBody: string;
    htmlBody: string;
    receivedAt: string;
    isRead: boolean;
    linkedTaskId?: string;
    createdAt: string;
    updatedAt: string;
};

export type OutgoingMail = {
    id: string;
    workspaceSlug: string;
    mailboxId: string;
    to: Array<MailAddress>;
    cc: Array<MailAddress>;
    bcc: Array<MailAddress>;
    subject: string;
    textBody: string;
    htmlBody: string;
    status: 'queued' | 'scheduled' | 'sent' | 'failed';
    scheduledFor?: string;
    sentAt?: string;
    error?: string;
    createdAt: string;
    updatedAt: string;
};

export type ConnectMailboxInput = {
    workspaceSlug: string;
    label?: string;
    email: string;
    displayName?: string;
    imapHost: string;
    imapPort?: number;
    imapUsername?: string;
    imapPassword: string;
    imapUseTls?: boolean;
    smtpHost: string;
    smtpPort?: number;
    smtpUsername?: string;
    smtpPassword?: string;
    smtpUseTls?: boolean;
};

export type CreateOutgoingMailInput = {
    workspaceSlug: string;
    mailboxId: string;
    to: Array<MailAddress>;
    cc?: Array<MailAddress>;
    bcc?: Array<MailAddress>;
    subject?: string;
    textBody?: string;
    htmlBody?: string;
    scheduledFor?: string;
};

export type CreateTaskFromMailInput = {
    boardGroupId: string;
    title?: string;
    dueAt?: string;
    color?: string;
};

export type CreateBoardGroupInput = {
    workspaceSlug: string;
    name: string;
    color?: string;
};

export type UpdateBoardGroupInput = {
    name?: string;
    color?: string;
    order?: number;
};

export type CreateLabelInput = {
    workspaceSlug: string;
    name: string;
    color: string;
};

export type CreateInviteInput = {
    workspaceSlug: string;
    email: string;
    role: 'owner' | 'admin' | 'member';
};

export type AcceptInviteInput = {
    name: string;
    email: string;
};

export type UpdateMemberInput = {
    role?: 'owner' | 'admin' | 'member';
    status?: 'active' | 'removed';
};

export type GetHealthData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/v1/health';
};

export type GetHealthErrors = {
    /**
     * Dependency health check failed
     */
    503: HealthResponse;
};

export type GetHealthError = GetHealthErrors[keyof GetHealthErrors];

export type GetHealthResponses = {
    /**
     * Health check
     */
    200: HealthResponse;
};

export type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses];

export type GetMetricsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/v1/metrics';
};

export type GetMetricsErrors = {
    /**
     * Metrics token missing or invalid
     */
    401: ErrorResponse;
};

export type GetMetricsError = GetMetricsErrors[keyof GetMetricsErrors];

export type GetMetricsResponses = {
    /**
     * Runtime request metrics snapshot
     */
    200: MetricsResponse;
};

export type GetMetricsResponse = GetMetricsResponses[keyof GetMetricsResponses];

export type GetMetricsPrometheusData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/v1/metrics/prometheus';
};

export type GetMetricsPrometheusErrors = {
    /**
     * Metrics token missing or invalid
     */
    401: ErrorResponse;
};

export type GetMetricsPrometheusError = GetMetricsPrometheusErrors[keyof GetMetricsPrometheusErrors];

export type GetMetricsPrometheusResponses = {
    /**
     * Runtime request metrics in Prometheus text format
     */
    200: string;
};

export type GetMetricsPrometheusResponse = GetMetricsPrometheusResponses[keyof GetMetricsPrometheusResponses];

export type ListWorkspacesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/v1/workspaces';
};

export type ListWorkspacesResponses = {
    /**
     * Workspace list
     */
    200: {
        data: Array<Workspace>;
    };
};

export type ListWorkspacesResponse = ListWorkspacesResponses[keyof ListWorkspacesResponses];

export type ListMembersData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/members';
};

export type ListMembersResponses = {
    /**
     * Workspace members
     */
    200: {
        data: Array<Member>;
    };
};

export type ListMembersResponse = ListMembersResponses[keyof ListMembersResponses];

export type UpdateMemberData = {
    body: UpdateMemberInput;
    path: {
        memberId: string;
    };
    query?: never;
    url: '/v1/members/{memberId}';
};

export type UpdateMemberErrors = {
    /**
     * Invalid input
     */
    400: ErrorResponse;
    /**
     * Forbidden
     */
    403: ErrorResponse;
    /**
     * Member not found
     */
    404: ErrorResponse;
    /**
     * Business rule conflict
     */
    409: ErrorResponse;
};

export type UpdateMemberError = UpdateMemberErrors[keyof UpdateMemberErrors];

export type UpdateMemberResponses = {
    /**
     * Updated member
     */
    200: {
        data: Member;
    };
};

export type UpdateMemberResponse = UpdateMemberResponses[keyof UpdateMemberResponses];

export type ListInvitesData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/invites';
};

export type ListInvitesResponses = {
    /**
     * Workspace invites
     */
    200: {
        data: Array<Invite>;
    };
};

export type ListInvitesResponse = ListInvitesResponses[keyof ListInvitesResponses];

export type CreateInviteData = {
    body: CreateInviteInput;
    path?: never;
    query?: never;
    url: '/v1/invites';
};

export type CreateInviteErrors = {
    /**
     * Invalid input
     */
    400: ErrorResponse;
    /**
     * Forbidden
     */
    403: ErrorResponse;
};

export type CreateInviteError = CreateInviteErrors[keyof CreateInviteErrors];

export type CreateInviteResponses = {
    /**
     * Created invite
     */
    201: {
        data: Invite;
    };
};

export type CreateInviteResponse = CreateInviteResponses[keyof CreateInviteResponses];

export type GetInviteByTokenData = {
    body?: never;
    path: {
        token: string;
    };
    query?: never;
    url: '/v1/invites/{token}';
};

export type GetInviteByTokenErrors = {
    /**
     * Invite not found
     */
    404: ErrorResponse;
};

export type GetInviteByTokenError = GetInviteByTokenErrors[keyof GetInviteByTokenErrors];

export type GetInviteByTokenResponses = {
    /**
     * Invite detail
     */
    200: {
        data: Invite;
    };
};

export type GetInviteByTokenResponse = GetInviteByTokenResponses[keyof GetInviteByTokenResponses];

export type AcceptInviteData = {
    body: AcceptInviteInput;
    path: {
        token: string;
    };
    query?: never;
    url: '/v1/invites/{token}/accept';
};

export type AcceptInviteErrors = {
    /**
     * Invalid input
     */
    400: ErrorResponse;
    /**
     * Invite not found
     */
    404: ErrorResponse;
};

export type AcceptInviteError = AcceptInviteErrors[keyof AcceptInviteErrors];

export type AcceptInviteResponses = {
    /**
     * Accepted invite
     */
    200: {
        data: Invite;
    };
};

export type AcceptInviteResponse = AcceptInviteResponses[keyof AcceptInviteResponses];

export type RevokeInviteData = {
    body?: never;
    path: {
        inviteId: string;
    };
    query?: never;
    url: '/v1/invites/{inviteId}/revoke';
};

export type RevokeInviteErrors = {
    /**
     * Forbidden
     */
    403: ErrorResponse;
    /**
     * Invite not found
     */
    404: ErrorResponse;
    /**
     * Invite state conflict
     */
    409: ErrorResponse;
};

export type RevokeInviteError = RevokeInviteErrors[keyof RevokeInviteErrors];

export type RevokeInviteResponses = {
    /**
     * Invite revoked
     */
    204: void;
};

export type RevokeInviteResponse = RevokeInviteResponses[keyof RevokeInviteResponses];

export type ListActivityData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
        /**
         * Max entries to return (1-40, default 8)
         */
        limit?: number;
        /**
         * Optional inferred activity category filter
         */
        type?: 'task' | 'board' | 'calendar' | 'note' | 'focus' | 'mail' | 'invite' | 'system';
        /**
         * Case-insensitive text search over title and detail
         */
        q?: string;
    };
    url: '/v1/activity';
};

export type ListActivityErrors = {
    /**
     * Invalid activity query parameters
     */
    400: ErrorResponse;
};

export type ListActivityError = ListActivityErrors[keyof ListActivityErrors];

export type ListActivityResponses = {
    /**
     * Workspace activity feed
     */
    200: {
        data: Array<ActivityEntry>;
    };
};

export type ListActivityResponse = ListActivityResponses[keyof ListActivityResponses];

export type ListBoardGroupsData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/board-groups';
};

export type ListBoardGroupsResponses = {
    /**
     * Board groups
     */
    200: {
        data: Array<BoardGroup>;
    };
};

export type ListBoardGroupsResponse = ListBoardGroupsResponses[keyof ListBoardGroupsResponses];

export type CreateBoardGroupData = {
    body: CreateBoardGroupInput;
    path?: never;
    query?: never;
    url: '/v1/board-groups';
};

export type CreateBoardGroupResponses = {
    /**
     * Created board group
     */
    201: {
        data: BoardGroup;
    };
};

export type CreateBoardGroupResponse = CreateBoardGroupResponses[keyof CreateBoardGroupResponses];

export type UpdateBoardGroupData = {
    body: UpdateBoardGroupInput;
    path: {
        groupId: string;
    };
    query?: never;
    url: '/v1/board-groups/{groupId}';
};

export type UpdateBoardGroupResponses = {
    /**
     * Updated board group
     */
    200: {
        data: BoardGroup;
    };
};

export type UpdateBoardGroupResponse = UpdateBoardGroupResponses[keyof UpdateBoardGroupResponses];

export type ListLabelsData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/labels';
};

export type ListLabelsResponses = {
    /**
     * Label list
     */
    200: {
        data: Array<Label>;
    };
};

export type ListLabelsResponse = ListLabelsResponses[keyof ListLabelsResponses];

export type CreateLabelData = {
    body: CreateLabelInput;
    path?: never;
    query?: never;
    url: '/v1/labels';
};

export type CreateLabelResponses = {
    /**
     * Created label
     */
    201: {
        data: Label;
    };
};

export type CreateLabelResponse = CreateLabelResponses[keyof CreateLabelResponses];

export type ListTasksData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/tasks';
};

export type ListTasksResponses = {
    /**
     * Task list
     */
    200: {
        data: Array<Task>;
    };
};

export type ListTasksResponse = ListTasksResponses[keyof ListTasksResponses];

export type CreateTaskData = {
    body: CreateTaskInput;
    path?: never;
    query?: never;
    url: '/v1/tasks';
};

export type CreateTaskResponses = {
    /**
     * Created task
     */
    201: {
        data: Task;
    };
};

export type CreateTaskResponse = CreateTaskResponses[keyof CreateTaskResponses];

export type ListCalendarEventsData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/calendar/events';
};

export type ListCalendarEventsResponses = {
    /**
     * Calendar events
     */
    200: {
        data: Array<CalendarEvent>;
    };
};

export type ListCalendarEventsResponse = ListCalendarEventsResponses[keyof ListCalendarEventsResponses];

export type CreateCalendarEventData = {
    body: CreateCalendarEventInput;
    path?: never;
    query?: never;
    url: '/v1/calendar/events';
};

export type CreateCalendarEventResponses = {
    /**
     * Created event
     */
    201: {
        data: CalendarEvent;
    };
};

export type CreateCalendarEventResponse = CreateCalendarEventResponses[keyof CreateCalendarEventResponses];

export type UpdateTaskData = {
    body: UpdateTaskInput;
    path: {
        taskId: string;
    };
    query?: never;
    url: '/v1/tasks/{taskId}';
};

export type UpdateTaskResponses = {
    /**
     * Updated task
     */
    200: {
        data: Task;
    };
};

export type UpdateTaskResponse = UpdateTaskResponses[keyof UpdateTaskResponses];

export type UploadTaskAttachmentData = {
    body: {
        file: Blob | File;
    };
    path: {
        taskId: string;
    };
    query?: never;
    url: '/v1/tasks/{taskId}/attachments';
};

export type UploadTaskAttachmentErrors = {
    /**
     * Invalid upload
     */
    400: ErrorResponse;
    /**
     * Task not found
     */
    404: ErrorResponse;
    /**
     * Attachment storage or update failure
     */
    500: ErrorResponse;
};

export type UploadTaskAttachmentError = UploadTaskAttachmentErrors[keyof UploadTaskAttachmentErrors];

export type UploadTaskAttachmentResponses = {
    /**
     * Uploaded task attachment
     */
    201: {
        data: Attachment;
    };
};

export type UploadTaskAttachmentResponse = UploadTaskAttachmentResponses[keyof UploadTaskAttachmentResponses];

export type DeleteTaskAttachmentData = {
    body?: never;
    path: {
        taskId: string;
        attachmentId: string;
    };
    query?: never;
    url: '/v1/tasks/{taskId}/attachments/{attachmentId}';
};

export type DeleteTaskAttachmentErrors = {
    /**
     * Task or attachment not found
     */
    404: ErrorResponse;
    /**
     * Attachment delete failure
     */
    500: ErrorResponse;
};

export type DeleteTaskAttachmentError = DeleteTaskAttachmentErrors[keyof DeleteTaskAttachmentErrors];

export type DeleteTaskAttachmentResponses = {
    /**
     * Deleted attachment
     */
    204: void;
};

export type DeleteTaskAttachmentResponse = DeleteTaskAttachmentResponses[keyof DeleteTaskAttachmentResponses];

export type DownloadTaskAttachmentData = {
    body?: never;
    path: {
        taskId: string;
        attachmentId: string;
    };
    query?: never;
    url: '/v1/tasks/{taskId}/attachments/{attachmentId}/download';
};

export type DownloadTaskAttachmentErrors = {
    /**
     * Task or attachment not found
     */
    404: ErrorResponse;
    /**
     * Attachment read failure
     */
    500: ErrorResponse;
};

export type DownloadTaskAttachmentError = DownloadTaskAttachmentErrors[keyof DownloadTaskAttachmentErrors];

export type DownloadTaskAttachmentResponses = {
    /**
     * Attachment file stream
     */
    200: Blob | File;
};

export type DownloadTaskAttachmentResponse = DownloadTaskAttachmentResponses[keyof DownloadTaskAttachmentResponses];

export type UpdateCalendarEventData = {
    body: UpdateCalendarEventInput;
    path: {
        eventId: string;
    };
    query?: never;
    url: '/v1/calendar/events/{eventId}';
};

export type UpdateCalendarEventResponses = {
    /**
     * Updated event
     */
    200: {
        data: CalendarEvent;
    };
};

export type UpdateCalendarEventResponse = UpdateCalendarEventResponses[keyof UpdateCalendarEventResponses];

export type ListNotesData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/notes';
};

export type ListNotesResponses = {
    /**
     * Notes list
     */
    200: {
        data: Array<Note>;
    };
};

export type ListNotesResponse = ListNotesResponses[keyof ListNotesResponses];

export type CreateNoteData = {
    body: CreateNoteInput;
    path?: never;
    query?: never;
    url: '/v1/notes';
};

export type CreateNoteResponses = {
    /**
     * Created note
     */
    201: {
        data: Note;
    };
};

export type CreateNoteResponse = CreateNoteResponses[keyof CreateNoteResponses];

export type UpdateNoteData = {
    body: UpdateNoteInput;
    path: {
        noteId: string;
    };
    query?: never;
    url: '/v1/notes/{noteId}';
};

export type UpdateNoteResponses = {
    /**
     * Updated note
     */
    200: {
        data: Note;
    };
};

export type UpdateNoteResponse = UpdateNoteResponses[keyof UpdateNoteResponses];

export type ListFocusSessionsData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/focus/sessions';
};

export type ListFocusSessionsResponses = {
    /**
     * Focus sessions
     */
    200: {
        data: Array<FocusSession>;
    };
};

export type ListFocusSessionsResponse = ListFocusSessionsResponses[keyof ListFocusSessionsResponses];

export type CreateFocusSessionData = {
    body: CreateFocusSessionInput;
    path?: never;
    query?: never;
    url: '/v1/focus/sessions';
};

export type CreateFocusSessionResponses = {
    /**
     * Created focus session
     */
    201: {
        data: FocusSession;
    };
};

export type CreateFocusSessionResponse = CreateFocusSessionResponses[keyof CreateFocusSessionResponses];

export type UpdateFocusSessionData = {
    body: UpdateFocusSessionInput;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/v1/focus/sessions/{sessionId}';
};

export type UpdateFocusSessionResponses = {
    /**
     * Updated focus session
     */
    200: {
        data: FocusSession;
    };
};

export type UpdateFocusSessionResponse = UpdateFocusSessionResponses[keyof UpdateFocusSessionResponses];

export type ListMailboxesData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
    };
    url: '/v1/mailboxes';
};

export type ListMailboxesResponses = {
    /**
     * Connected mailboxes
     */
    200: {
        data: Array<Mailbox>;
    };
};

export type ListMailboxesResponse = ListMailboxesResponses[keyof ListMailboxesResponses];

export type ConnectMailboxData = {
    body: ConnectMailboxInput;
    path?: never;
    query?: never;
    url: '/v1/mailboxes';
};

export type ConnectMailboxErrors = {
    /**
     * Invalid mailbox configuration
     */
    400: ErrorResponse;
};

export type ConnectMailboxError = ConnectMailboxErrors[keyof ConnectMailboxErrors];

export type ConnectMailboxResponses = {
    /**
     * Connected mailbox
     */
    201: {
        data: Mailbox;
    };
};

export type ConnectMailboxResponse = ConnectMailboxResponses[keyof ConnectMailboxResponses];

export type SyncMailboxData = {
    body?: never;
    path: {
        mailboxId: string;
    };
    query?: never;
    url: '/v1/mailboxes/{mailboxId}/sync';
};

export type SyncMailboxErrors = {
    /**
     * Mailbox not found
     */
    404: ErrorResponse;
    /**
     * Mail provider sync failure
     */
    502: ErrorResponse;
};

export type SyncMailboxError = SyncMailboxErrors[keyof SyncMailboxErrors];

export type SyncMailboxResponses = {
    /**
     * Synced mailbox
     */
    200: {
        data: Mailbox;
    };
};

export type SyncMailboxResponse = SyncMailboxResponses[keyof SyncMailboxResponses];

export type ListMailMessagesData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
        mailboxId?: string;
    };
    url: '/v1/mail/messages';
};

export type ListMailMessagesResponses = {
    /**
     * Mail messages
     */
    200: {
        data: Array<MailMessage>;
    };
};

export type ListMailMessagesResponse = ListMailMessagesResponses[keyof ListMailMessagesResponses];

export type CreateTaskFromMailData = {
    body: CreateTaskFromMailInput;
    path: {
        messageId: string;
    };
    query?: never;
    url: '/v1/mail/messages/{messageId}/create-task';
};

export type CreateTaskFromMailErrors = {
    /**
     * Invalid request
     */
    400: ErrorResponse;
    /**
     * Message not found
     */
    404: ErrorResponse;
    /**
     * Message already linked
     */
    409: ErrorResponse;
    /**
     * Link operation failure
     */
    500: ErrorResponse;
};

export type CreateTaskFromMailError = CreateTaskFromMailErrors[keyof CreateTaskFromMailErrors];

export type CreateTaskFromMailResponses = {
    /**
     * Created task from mail
     */
    201: {
        data: Task;
    };
};

export type CreateTaskFromMailResponse = CreateTaskFromMailResponses[keyof CreateTaskFromMailResponses];

export type ListOutgoingMailsData = {
    body?: never;
    path?: never;
    query: {
        workspaceSlug: string;
        mailboxId?: string;
    };
    url: '/v1/mail/outgoing';
};

export type ListOutgoingMailsResponses = {
    /**
     * Outgoing mail queue
     */
    200: {
        data: Array<OutgoingMail>;
    };
};

export type ListOutgoingMailsResponse = ListOutgoingMailsResponses[keyof ListOutgoingMailsResponses];

export type CreateOutgoingMailData = {
    body: CreateOutgoingMailInput;
    path?: never;
    query?: never;
    url: '/v1/mail/outgoing';
};

export type CreateOutgoingMailErrors = {
    /**
     * Invalid input
     */
    400: ErrorResponse;
    /**
     * Mailbox does not belong to workspace
     */
    403: ErrorResponse;
    /**
     * Mailbox not found
     */
    404: ErrorResponse;
    /**
     * Queue delivery upstream failure
     */
    502: ErrorResponse;
};

export type CreateOutgoingMailError = CreateOutgoingMailErrors[keyof CreateOutgoingMailErrors];

export type CreateOutgoingMailResponses = {
    /**
     * Queued outgoing mail
     */
    201: {
        data: OutgoingMail;
    };
};

export type CreateOutgoingMailResponse = CreateOutgoingMailResponses[keyof CreateOutgoingMailResponses];
