# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .aily_message_file import AilyMessageFile
from .aily_sender import AilySender
from .aily_mention import AilyMention


class AilyMessage(object):
    _types = {
        "id": str,
        "session_id": str,
        "run_id": str,
        "content_type": str,
        "content": str,
        "files": List[AilyMessageFile],
        "quote_message_id": str,
        "sender": AilySender,
        "mentions": List[AilyMention],
        "plain_text": str,
        "created_at": int,
        "status": str,
        "reasoning_content": str,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.session_id: Optional[str] = None
        self.run_id: Optional[str] = None
        self.content_type: Optional[str] = None
        self.content: Optional[str] = None
        self.files: Optional[List[AilyMessageFile]] = None
        self.quote_message_id: Optional[str] = None
        self.sender: Optional[AilySender] = None
        self.mentions: Optional[List[AilyMention]] = None
        self.plain_text: Optional[str] = None
        self.created_at: Optional[int] = None
        self.status: Optional[str] = None
        self.reasoning_content: Optional[str] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "AilyMessageBuilder":
        return AilyMessageBuilder()


class AilyMessageBuilder(object):
    def __init__(self) -> None:
        self._aily_message = AilyMessage()

    def id(self, id: str) -> "AilyMessageBuilder":
        self._aily_message.id = id
        return self

    def session_id(self, session_id: str) -> "AilyMessageBuilder":
        self._aily_message.session_id = session_id
        return self

    def run_id(self, run_id: str) -> "AilyMessageBuilder":
        self._aily_message.run_id = run_id
        return self

    def content_type(self, content_type: str) -> "AilyMessageBuilder":
        self._aily_message.content_type = content_type
        return self

    def content(self, content: str) -> "AilyMessageBuilder":
        self._aily_message.content = content
        return self

    def files(self, files: List[AilyMessageFile]) -> "AilyMessageBuilder":
        self._aily_message.files = files
        return self

    def quote_message_id(self, quote_message_id: str) -> "AilyMessageBuilder":
        self._aily_message.quote_message_id = quote_message_id
        return self

    def sender(self, sender: AilySender) -> "AilyMessageBuilder":
        self._aily_message.sender = sender
        return self

    def mentions(self, mentions: List[AilyMention]) -> "AilyMessageBuilder":
        self._aily_message.mentions = mentions
        return self

    def plain_text(self, plain_text: str) -> "AilyMessageBuilder":
        self._aily_message.plain_text = plain_text
        return self

    def created_at(self, created_at: int) -> "AilyMessageBuilder":
        self._aily_message.created_at = created_at
        return self

    def status(self, status: str) -> "AilyMessageBuilder":
        self._aily_message.status = status
        return self

    def reasoning_content(self, reasoning_content: str) -> "AilyMessageBuilder":
        self._aily_message.reasoning_content = reasoning_content
        return self

    def build(self) -> "AilyMessage":
        return self._aily_message
