# 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 LeaveTime(object):
    _types = {
        "date": str,
        "time": str,
        "half_day": str,
    }

    def __init__(self, d=None):
        self.date: Optional[str] = None
        self.time: Optional[str] = None
        self.half_day: Optional[str] = None
        init(self, d, self._types)

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


class LeaveTimeBuilder(object):
    def __init__(self) -> None:
        self._leave_time = LeaveTime()

    def date(self, date: str) -> "LeaveTimeBuilder":
        self._leave_time.date = date
        return self

    def time(self, time: str) -> "LeaveTimeBuilder":
        self._leave_time.time = time
        return self

    def half_day(self, half_day: str) -> "LeaveTimeBuilder":
        self._leave_time.half_day = half_day
        return self

    def build(self) -> "LeaveTime":
        return self._leave_time
