# 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 DepartmentTree(object):
    _types = {
        "id": str,
        "level": int,
        "children": List[str],
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.level: Optional[int] = None
        self.children: Optional[List[str]] = None
        init(self, d, self._types)

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


class DepartmentTreeBuilder(object):
    def __init__(self) -> None:
        self._department_tree = DepartmentTree()

    def id(self, id: str) -> "DepartmentTreeBuilder":
        self._department_tree.id = id
        return self

    def level(self, level: int) -> "DepartmentTreeBuilder":
        self._department_tree.level = level
        return self

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

    def build(self) -> "DepartmentTree":
        return self._department_tree
