# retoor <retoor@molodetz.nl>

from __future__ import annotations

from ..spec import Action
from ._shared import ATTACHMENTS, body, query


MESSAGE_ACTIONS: tuple[Action, ...] = (
    Action(
        name="list_messages",
        method="GET",
        path="/messages",
        summary="View direct message conversations",
        params=(
            query("with_uid", "Open a conversation with a user uid."),
            query("search", "Search conversations."),
        ),
    ),
    Action(
        name="search_message_users",
        method="GET",
        path="/messages/search",
        summary="Search users to message",
        params=(query("q", "Search query."),),
    ),
    Action(
        name="send_message",
        method="POST",
        path="/messages/send",
        summary="Send a direct message",
        params=(
            body("content", "Message body.", required=True),
            body("receiver_uid", "Recipient user uid.", required=True),
            body("attachment_uids", ATTACHMENTS),
        ),
    ),
)
