# 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 MindMapRoot(object):
    _types = {
        "layout": str,
        "type": str,
        "line_style": str,
        "up_children": List[str],
        "down_children": List[str],
        "left_children": List[str],
        "right_children": List[str],
    }

    def __init__(self, d=None):
        self.layout: Optional[str] = None
        self.type: Optional[str] = None
        self.line_style: Optional[str] = None
        self.up_children: Optional[List[str]] = None
        self.down_children: Optional[List[str]] = None
        self.left_children: Optional[List[str]] = None
        self.right_children: Optional[List[str]] = None
        init(self, d, self._types)

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


class MindMapRootBuilder(object):
    def __init__(self) -> None:
        self._mind_map_root = MindMapRoot()

    def layout(self, layout: str) -> "MindMapRootBuilder":
        self._mind_map_root.layout = layout
        return self

    def type(self, type: str) -> "MindMapRootBuilder":
        self._mind_map_root.type = type
        return self

    def line_style(self, line_style: str) -> "MindMapRootBuilder":
        self._mind_map_root.line_style = line_style
        return self

    def up_children(self, up_children: List[str]) -> "MindMapRootBuilder":
        self._mind_map_root.up_children = up_children
        return self

    def down_children(self, down_children: List[str]) -> "MindMapRootBuilder":
        self._mind_map_root.down_children = down_children
        return self

    def left_children(self, left_children: List[str]) -> "MindMapRootBuilder":
        self._mind_map_root.left_children = left_children
        return self

    def right_children(self, right_children: List[str]) -> "MindMapRootBuilder":
        self._mind_map_root.right_children = right_children
        return self

    def build(self) -> "MindMapRoot":
        return self._mind_map_root
