# 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 .builtin_action import BuiltinAction
from .skill_base_info import SkillBaseInfo
from .message_progress import MessageProgress
from .sender import Sender
from .message_error import MessageError


class Message(object):
    _types = {
        "id": int,
        "title": str,
        "content": str,
        "message_status": str,
        "builtin_actions": List[BuiltinAction],
        "skill_base_infos": List[SkillBaseInfo],
        "message_progress": MessageProgress,
        "sender": Sender,
        "error": MessageError,
        "trigger_type": str,
        "visibility": str,
    }

    def __init__(self, d=None):
        self.id: Optional[int] = None
        self.title: Optional[str] = None
        self.content: Optional[str] = None
        self.message_status: Optional[str] = None
        self.builtin_actions: Optional[List[BuiltinAction]] = None
        self.skill_base_infos: Optional[List[SkillBaseInfo]] = None
        self.message_progress: Optional[MessageProgress] = None
        self.sender: Optional[Sender] = None
        self.error: Optional[MessageError] = None
        self.trigger_type: Optional[str] = None
        self.visibility: Optional[str] = None
        init(self, d, self._types)

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


class MessageBuilder(object):
    def __init__(self) -> None:
        self._message = Message()

    def id(self, id: int) -> "MessageBuilder":
        self._message.id = id
        return self

    def title(self, title: str) -> "MessageBuilder":
        self._message.title = title
        return self

    def content(self, content: str) -> "MessageBuilder":
        self._message.content = content
        return self

    def message_status(self, message_status: str) -> "MessageBuilder":
        self._message.message_status = message_status
        return self

    def builtin_actions(self, builtin_actions: List[BuiltinAction]) -> "MessageBuilder":
        self._message.builtin_actions = builtin_actions
        return self

    def skill_base_infos(self, skill_base_infos: List[SkillBaseInfo]) -> "MessageBuilder":
        self._message.skill_base_infos = skill_base_infos
        return self

    def message_progress(self, message_progress: MessageProgress) -> "MessageBuilder":
        self._message.message_progress = message_progress
        return self

    def sender(self, sender: Sender) -> "MessageBuilder":
        self._message.sender = sender
        return self

    def error(self, error: MessageError) -> "MessageBuilder":
        self._message.error = error
        return self

    def trigger_type(self, trigger_type: str) -> "MessageBuilder":
        self._message.trigger_type = trigger_type
        return self

    def visibility(self, visibility: str) -> "MessageBuilder":
        self._message.visibility = visibility
        return self

    def build(self) -> "Message":
        return self._message
