# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class MessageError(object):
    _types = {
        "code": str,
        "message": str,
        "error_type": str,
        "log_id": str,
        "title": str,
    }

    def __init__(self, d=None):
        self.code: Optional[str] = None
        self.message: Optional[str] = None
        self.error_type: Optional[str] = None
        self.log_id: Optional[str] = None
        self.title: Optional[str] = None
        init(self, d, self._types)

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


class MessageErrorBuilder(object):
    def __init__(self) -> None:
        self._message_error = MessageError()

    def code(self, code: str) -> "MessageErrorBuilder":
        self._message_error.code = code
        return self

    def message(self, message: str) -> "MessageErrorBuilder":
        self._message_error.message = message
        return self

    def error_type(self, error_type: str) -> "MessageErrorBuilder":
        self._message_error.error_type = error_type
        return self

    def log_id(self, log_id: str) -> "MessageErrorBuilder":
        self._message_error.log_id = log_id
        return self

    def title(self, title: str) -> "MessageErrorBuilder":
        self._message_error.title = title
        return self

    def build(self) -> "MessageError":
        return self._message_error
