# This file was generated by liblab | https://liblab.com/

from enum import Enum
from .utils.json_map import JsonMap
from .base import BaseModel


class CreateTimeoffType(Enum):
    """An enumeration representing different categories.

    :cvar VACATION: "VACATION"
    :vartype VACATION: str
    :cvar SICK_LEAVE: "SICK_LEAVE"
    :vartype SICK_LEAVE: str
    :cvar OTHER: "OTHER"
    :vartype OTHER: str
    """

    VACATION = "VACATION"
    SICK_LEAVE = "SICK_LEAVE"
    OTHER = "OTHER"

    def list():
        """Lists all category values.

        :return: A list of all category values.
        :rtype: list
        """
        return list(map(lambda x: x.value, CreateTimeoffType._member_map_.values()))


@JsonMap({"type_": "type"})
class CreateTimeoff(BaseModel):
    """CreateTimeoff

    :param type_: Time off type.
    :type type_: CreateTimeoffType
    :param start_date: Start date of employee's time off., defaults to None
    :type start_date: str, optional
    :param end_date: End date of employee's time off., defaults to None
    :type end_date: str, optional
    :param with_multiple_dates: If true, then multiple time off days were requested. You must supply a start and end date. If false, end date is ignored
    :type with_multiple_dates: bool
    :param reason: Description for employee's time off., defaults to None
    :type reason: str, optional
    :param is_start_date_half_day: Is the start day a half day?, defaults to None
    :type is_start_date_half_day: bool, optional
    :param is_end_date_half_day: Is the start day a half day?, defaults to None
    :type is_end_date_half_day: bool, optional
    :param other_timeoff_name: Custom name for this time off., defaults to None
    :type other_timeoff_name: str, optional
    """

    def __init__(
        self,
        type_: CreateTimeoffType,
        with_multiple_dates: bool,
        start_date: str = None,
        end_date: str = None,
        reason: str = None,
        is_start_date_half_day: bool = None,
        is_end_date_half_day: bool = None,
        other_timeoff_name: str = None,
    ):
        self.type_ = self._enum_matching(type_, CreateTimeoffType.list(), "type_")
        if start_date is not None:
            self.start_date = start_date
        if end_date is not None:
            self.end_date = end_date
        self.with_multiple_dates = with_multiple_dates
        if reason is not None:
            self.reason = reason
        if is_start_date_half_day is not None:
            self.is_start_date_half_day = is_start_date_half_day
        if is_end_date_half_day is not None:
            self.is_end_date_half_day = is_end_date_half_day
        if other_timeoff_name is not None:
            self.other_timeoff_name = other_timeoff_name
