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

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


class PeopleTimeOffContainerType(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, PeopleTimeOffContainerType._member_map_.values())
        )


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

    :param type_: Time off type., defaults to None
    :type type_: PeopleTimeOffContainerType, optional
    :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 reason: Description for employee's time off., defaults to None
    :type reason: str, optional
    :param attachments: Attachments for employee's time off., defaults to None
    :type attachments: str, optional
    """

    def __init__(
        self,
        type_: PeopleTimeOffContainerType = None,
        start_date: str = None,
        end_date: str = None,
        reason: str = None,
        attachments: str = None,
    ):
        if type_ is not None:
            self.type_ = self._enum_matching(
                type_, PeopleTimeOffContainerType.list(), "type_"
            )
        if start_date is not None:
            self.start_date = start_date
        if end_date is not None:
            self.end_date = end_date
        if reason is not None:
            self.reason = reason
        if attachments is not None:
            self.attachments = attachments
