# 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_names import I18nNames


class UserLeave(object):
    _types = {
        "approval_id": str,
        "uniq_id": str,
        "unit": int,
        "interval": int,
        "start_time": str,
        "end_time": str,
        "i18n_names": I18nNames,
        "default_locale": str,
        "reason": str,
        "approve_pass_time": str,
        "approve_apply_time": str,
        "idempotent_id": str,
    }

    def __init__(self, d=None):
        self.approval_id: Optional[str] = None
        self.uniq_id: Optional[str] = None
        self.unit: Optional[int] = None
        self.interval: Optional[int] = None
        self.start_time: Optional[str] = None
        self.end_time: Optional[str] = None
        self.i18n_names: Optional[I18nNames] = None
        self.default_locale: Optional[str] = None
        self.reason: Optional[str] = None
        self.approve_pass_time: Optional[str] = None
        self.approve_apply_time: Optional[str] = None
        self.idempotent_id: Optional[str] = None
        init(self, d, self._types)

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


class UserLeaveBuilder(object):
    def __init__(self) -> None:
        self._user_leave = UserLeave()

    def approval_id(self, approval_id: str) -> "UserLeaveBuilder":
        self._user_leave.approval_id = approval_id
        return self

    def uniq_id(self, uniq_id: str) -> "UserLeaveBuilder":
        self._user_leave.uniq_id = uniq_id
        return self

    def unit(self, unit: int) -> "UserLeaveBuilder":
        self._user_leave.unit = unit
        return self

    def interval(self, interval: int) -> "UserLeaveBuilder":
        self._user_leave.interval = interval
        return self

    def start_time(self, start_time: str) -> "UserLeaveBuilder":
        self._user_leave.start_time = start_time
        return self

    def end_time(self, end_time: str) -> "UserLeaveBuilder":
        self._user_leave.end_time = end_time
        return self

    def i18n_names(self, i18n_names: I18nNames) -> "UserLeaveBuilder":
        self._user_leave.i18n_names = i18n_names
        return self

    def default_locale(self, default_locale: str) -> "UserLeaveBuilder":
        self._user_leave.default_locale = default_locale
        return self

    def reason(self, reason: str) -> "UserLeaveBuilder":
        self._user_leave.reason = reason
        return self

    def approve_pass_time(self, approve_pass_time: str) -> "UserLeaveBuilder":
        self._user_leave.approve_pass_time = approve_pass_time
        return self

    def approve_apply_time(self, approve_apply_time: str) -> "UserLeaveBuilder":
        self._user_leave.approve_apply_time = approve_apply_time
        return self

    def idempotent_id(self, idempotent_id: str) -> "UserLeaveBuilder":
        self._user_leave.idempotent_id = idempotent_id
        return self

    def build(self) -> "UserLeave":
        return self._user_leave
