# 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 .flexible_rule import FlexibleRule
from .punch_time_rule import PunchTimeRule
from .late_off_late_on_rule import LateOffLateOnRule
from .rest_rule import RestRule
from .overtime_rule import OvertimeRule
from .rest_rule import RestRule
from .shift_middle_time_rule import ShiftMiddleTimeRule
from .shift_attendance_time_config import ShiftAttendanceTimeConfig
from .late_off_late_on_setting import LateOffLateOnSetting
from .rest_time_flexible_config import RestTimeFlexibleConfig


class QueryShiftResponseBody(object):
    _types = {
        "shift_id": str,
        "shift_name": str,
        "punch_times": int,
        "sub_shift_leader_ids": List[str],
        "is_flexible": bool,
        "flexible_minutes": int,
        "flexible_rule": List[FlexibleRule],
        "no_need_off": bool,
        "punch_time_rule": List[PunchTimeRule],
        "late_off_late_on_rule": List[LateOffLateOnRule],
        "rest_time_rule": List[RestRule],
        "overtime_rule": List[OvertimeRule],
        "day_type": int,
        "overtime_rest_time_rule": List[RestRule],
        "late_minutes_as_serious_late": int,
        "shift_middle_time_rule": ShiftMiddleTimeRule,
        "shift_attendance_time_config": ShiftAttendanceTimeConfig,
        "late_off_late_on_setting": LateOffLateOnSetting,
        "id": str,
        "rest_time_flexible_configs": List[RestTimeFlexibleConfig],
    }

    def __init__(self, d=None):
        self.shift_id: Optional[str] = None
        self.shift_name: Optional[str] = None
        self.punch_times: Optional[int] = None
        self.sub_shift_leader_ids: Optional[List[str]] = None
        self.is_flexible: Optional[bool] = None
        self.flexible_minutes: Optional[int] = None
        self.flexible_rule: Optional[List[FlexibleRule]] = None
        self.no_need_off: Optional[bool] = None
        self.punch_time_rule: Optional[List[PunchTimeRule]] = None
        self.late_off_late_on_rule: Optional[List[LateOffLateOnRule]] = None
        self.rest_time_rule: Optional[List[RestRule]] = None
        self.overtime_rule: Optional[List[OvertimeRule]] = None
        self.day_type: Optional[int] = None
        self.overtime_rest_time_rule: Optional[List[RestRule]] = None
        self.late_minutes_as_serious_late: Optional[int] = None
        self.shift_middle_time_rule: Optional[ShiftMiddleTimeRule] = None
        self.shift_attendance_time_config: Optional[ShiftAttendanceTimeConfig] = None
        self.late_off_late_on_setting: Optional[LateOffLateOnSetting] = None
        self.id: Optional[str] = None
        self.rest_time_flexible_configs: Optional[List[RestTimeFlexibleConfig]] = None
        init(self, d, self._types)

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


class QueryShiftResponseBodyBuilder(object):
    def __init__(self) -> None:
        self._query_shift_response_body = QueryShiftResponseBody()

    def shift_id(self, shift_id: str) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.shift_id = shift_id
        return self

    def shift_name(self, shift_name: str) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.shift_name = shift_name
        return self

    def punch_times(self, punch_times: int) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.punch_times = punch_times
        return self

    def sub_shift_leader_ids(self, sub_shift_leader_ids: List[str]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.sub_shift_leader_ids = sub_shift_leader_ids
        return self

    def is_flexible(self, is_flexible: bool) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.is_flexible = is_flexible
        return self

    def flexible_minutes(self, flexible_minutes: int) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.flexible_minutes = flexible_minutes
        return self

    def flexible_rule(self, flexible_rule: List[FlexibleRule]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.flexible_rule = flexible_rule
        return self

    def no_need_off(self, no_need_off: bool) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.no_need_off = no_need_off
        return self

    def punch_time_rule(self, punch_time_rule: List[PunchTimeRule]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.punch_time_rule = punch_time_rule
        return self

    def late_off_late_on_rule(self, late_off_late_on_rule: List[LateOffLateOnRule]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.late_off_late_on_rule = late_off_late_on_rule
        return self

    def rest_time_rule(self, rest_time_rule: List[RestRule]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.rest_time_rule = rest_time_rule
        return self

    def overtime_rule(self, overtime_rule: List[OvertimeRule]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.overtime_rule = overtime_rule
        return self

    def day_type(self, day_type: int) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.day_type = day_type
        return self

    def overtime_rest_time_rule(self, overtime_rest_time_rule: List[RestRule]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.overtime_rest_time_rule = overtime_rest_time_rule
        return self

    def late_minutes_as_serious_late(self, late_minutes_as_serious_late: int) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.late_minutes_as_serious_late = late_minutes_as_serious_late
        return self

    def shift_middle_time_rule(self, shift_middle_time_rule: ShiftMiddleTimeRule) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.shift_middle_time_rule = shift_middle_time_rule
        return self

    def shift_attendance_time_config(self,
                                     shift_attendance_time_config: ShiftAttendanceTimeConfig) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.shift_attendance_time_config = shift_attendance_time_config
        return self

    def late_off_late_on_setting(self,
                                 late_off_late_on_setting: LateOffLateOnSetting) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.late_off_late_on_setting = late_off_late_on_setting
        return self

    def id(self, id: str) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.id = id
        return self

    def rest_time_flexible_configs(self, rest_time_flexible_configs: List[
        RestTimeFlexibleConfig]) -> "QueryShiftResponseBodyBuilder":
        self._query_shift_response_body.rest_time_flexible_configs = rest_time_flexible_configs
        return self

    def build(self) -> "QueryShiftResponseBody":
        return self._query_shift_response_body
