# 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 .i18n import I18n
from .i18n import I18n
from .custom_field_data import CustomFieldData


class Position(object):
    _types = {
        "position_id": str,
        "code": str,
        "names": List[I18n],
        "descriptions": List[I18n],
        "active": bool,
        "job_family_id_list": List[str],
        "cost_center_id": str,
        "job_id": str,
        "job_level_id_list": List[str],
        "employee_type_id_list": List[str],
        "job_grade_id_list": List[str],
        "work_location_id_list": List[str],
        "working_hours_type_id": str,
        "department_id": str,
        "direct_leader_id": str,
        "dotted_line_leader_id": str,
        "is_key_position": bool,
        "effective_time": str,
        "expiration_time": str,
        "custom_fields": List[CustomFieldData],
        "created_by": str,
    }

    def __init__(self, d=None):
        self.position_id: Optional[str] = None
        self.code: Optional[str] = None
        self.names: Optional[List[I18n]] = None
        self.descriptions: Optional[List[I18n]] = None
        self.active: Optional[bool] = None
        self.job_family_id_list: Optional[List[str]] = None
        self.cost_center_id: Optional[str] = None
        self.job_id: Optional[str] = None
        self.job_level_id_list: Optional[List[str]] = None
        self.employee_type_id_list: Optional[List[str]] = None
        self.job_grade_id_list: Optional[List[str]] = None
        self.work_location_id_list: Optional[List[str]] = None
        self.working_hours_type_id: Optional[str] = None
        self.department_id: Optional[str] = None
        self.direct_leader_id: Optional[str] = None
        self.dotted_line_leader_id: Optional[str] = None
        self.is_key_position: Optional[bool] = None
        self.effective_time: Optional[str] = None
        self.expiration_time: Optional[str] = None
        self.custom_fields: Optional[List[CustomFieldData]] = None
        self.created_by: Optional[str] = None
        init(self, d, self._types)

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


class PositionBuilder(object):
    def __init__(self) -> None:
        self._position = Position()

    def position_id(self, position_id: str) -> "PositionBuilder":
        self._position.position_id = position_id
        return self

    def code(self, code: str) -> "PositionBuilder":
        self._position.code = code
        return self

    def names(self, names: List[I18n]) -> "PositionBuilder":
        self._position.names = names
        return self

    def descriptions(self, descriptions: List[I18n]) -> "PositionBuilder":
        self._position.descriptions = descriptions
        return self

    def active(self, active: bool) -> "PositionBuilder":
        self._position.active = active
        return self

    def job_family_id_list(self, job_family_id_list: List[str]) -> "PositionBuilder":
        self._position.job_family_id_list = job_family_id_list
        return self

    def cost_center_id(self, cost_center_id: str) -> "PositionBuilder":
        self._position.cost_center_id = cost_center_id
        return self

    def job_id(self, job_id: str) -> "PositionBuilder":
        self._position.job_id = job_id
        return self

    def job_level_id_list(self, job_level_id_list: List[str]) -> "PositionBuilder":
        self._position.job_level_id_list = job_level_id_list
        return self

    def employee_type_id_list(self, employee_type_id_list: List[str]) -> "PositionBuilder":
        self._position.employee_type_id_list = employee_type_id_list
        return self

    def job_grade_id_list(self, job_grade_id_list: List[str]) -> "PositionBuilder":
        self._position.job_grade_id_list = job_grade_id_list
        return self

    def work_location_id_list(self, work_location_id_list: List[str]) -> "PositionBuilder":
        self._position.work_location_id_list = work_location_id_list
        return self

    def working_hours_type_id(self, working_hours_type_id: str) -> "PositionBuilder":
        self._position.working_hours_type_id = working_hours_type_id
        return self

    def department_id(self, department_id: str) -> "PositionBuilder":
        self._position.department_id = department_id
        return self

    def direct_leader_id(self, direct_leader_id: str) -> "PositionBuilder":
        self._position.direct_leader_id = direct_leader_id
        return self

    def dotted_line_leader_id(self, dotted_line_leader_id: str) -> "PositionBuilder":
        self._position.dotted_line_leader_id = dotted_line_leader_id
        return self

    def is_key_position(self, is_key_position: bool) -> "PositionBuilder":
        self._position.is_key_position = is_key_position
        return self

    def effective_time(self, effective_time: str) -> "PositionBuilder":
        self._position.effective_time = effective_time
        return self

    def expiration_time(self, expiration_time: str) -> "PositionBuilder":
        self._position.expiration_time = expiration_time
        return self

    def custom_fields(self, custom_fields: List[CustomFieldData]) -> "PositionBuilder":
        self._position.custom_fields = custom_fields
        return self

    def created_by(self, created_by: str) -> "PositionBuilder":
        self._position.created_by = created_by
        return self

    def build(self) -> "Position":
        return self._position
