# 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 .text import Text
from .style import Style
from .image import Image
from .composite_shape import CompositeShape
from .connector import Connector
from .section import Section
from .table import Table
from .mind_map import MindMap


class WhiteboardNode(object):
    _types = {
        "id": str,
        "type": str,
        "parent_id": str,
        "children": List[str],
        "x": float,
        "y": float,
        "angle": float,
        "width": float,
        "height": float,
        "text": Text,
        "style": Style,
        "image": Image,
        "composite_shape": CompositeShape,
        "connector": Connector,
        "section": Section,
        "table": Table,
        "mind_map": MindMap,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.type: Optional[str] = None
        self.parent_id: Optional[str] = None
        self.children: Optional[List[str]] = None
        self.x: Optional[float] = None
        self.y: Optional[float] = None
        self.angle: Optional[float] = None
        self.width: Optional[float] = None
        self.height: Optional[float] = None
        self.text: Optional[Text] = None
        self.style: Optional[Style] = None
        self.image: Optional[Image] = None
        self.composite_shape: Optional[CompositeShape] = None
        self.connector: Optional[Connector] = None
        self.section: Optional[Section] = None
        self.table: Optional[Table] = None
        self.mind_map: Optional[MindMap] = None
        init(self, d, self._types)

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


class WhiteboardNodeBuilder(object):
    def __init__(self) -> None:
        self._whiteboard_node = WhiteboardNode()

    def id(self, id: str) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.id = id
        return self

    def type(self, type: str) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.type = type
        return self

    def parent_id(self, parent_id: str) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.parent_id = parent_id
        return self

    def children(self, children: List[str]) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.children = children
        return self

    def x(self, x: float) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.x = x
        return self

    def y(self, y: float) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.y = y
        return self

    def angle(self, angle: float) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.angle = angle
        return self

    def width(self, width: float) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.width = width
        return self

    def height(self, height: float) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.height = height
        return self

    def text(self, text: Text) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.text = text
        return self

    def style(self, style: Style) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.style = style
        return self

    def image(self, image: Image) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.image = image
        return self

    def composite_shape(self, composite_shape: CompositeShape) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.composite_shape = composite_shape
        return self

    def connector(self, connector: Connector) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.connector = connector
        return self

    def section(self, section: Section) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.section = section
        return self

    def table(self, table: Table) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.table = table
        return self

    def mind_map(self, mind_map: MindMap) -> "WhiteboardNodeBuilder":
        self._whiteboard_node.mind_map = mind_map
        return self

    def build(self) -> "WhiteboardNode":
        return self._whiteboard_node
