# Code generated by Lark OpenAPI.

from typing import Optional, List

from lark_oapi.core.construct import init
from .enum import Enum
from .hiberarchy_common import HiberarchyCommon
from .object_field_data import ObjectFieldData


class Department(object):
    _types = {
        "id": str,
        "sub_type": Enum,
        "manager": str,
        "is_confidential": bool,
        "hiberarchy_common": HiberarchyCommon,
        "effective_time": str,
        "expiration_time": str,
        "custom_fields": List[ObjectFieldData],
        "cost_center_id": str,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.sub_type: Optional[Enum] = None
        self.manager: Optional[str] = None
        self.is_confidential: Optional[bool] = None
        self.hiberarchy_common: Optional[HiberarchyCommon] = None
        self.effective_time: Optional[str] = None
        self.expiration_time: Optional[str] = None
        self.custom_fields: Optional[List[ObjectFieldData]] = None
        self.cost_center_id: Optional[str] = None
        init(self, d, self._types)

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


class DepartmentBuilder(object):
    def __init__(self) -> None:
        self._department = Department()

    def id(self, id: str) -> "DepartmentBuilder":
        self._department.id = id
        return self

    def sub_type(self, sub_type: Enum) -> "DepartmentBuilder":
        self._department.sub_type = sub_type
        return self

    def manager(self, manager: str) -> "DepartmentBuilder":
        self._department.manager = manager
        return self

    def is_confidential(self, is_confidential: bool) -> "DepartmentBuilder":
        self._department.is_confidential = is_confidential
        return self

    def hiberarchy_common(self, hiberarchy_common: HiberarchyCommon) -> "DepartmentBuilder":
        self._department.hiberarchy_common = hiberarchy_common
        return self

    def effective_time(self, effective_time: str) -> "DepartmentBuilder":
        self._department.effective_time = effective_time
        return self

    def expiration_time(self, expiration_time: str) -> "DepartmentBuilder":
        self._department.expiration_time = expiration_time
        return self

    def custom_fields(self, custom_fields: List[ObjectFieldData]) -> "DepartmentBuilder":
        self._department.custom_fields = custom_fields
        return self

    def cost_center_id(self, cost_center_id: str) -> "DepartmentBuilder":
        self._department.cost_center_id = cost_center_id
        return self

    def build(self) -> "Department":
        return self._department
