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

from __future__ import annotations
from enum import Enum
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .identifier_value import IdentifierValue, IdentifierValueGuard


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


@JsonMap({})
class Requester(BaseModel):
    """Requester

    :param name: Time off requester name., defaults to None
    :type name: str, optional
    """

    def __init__(self, name: str = None):
        if name is not None:
            self.name = name


@JsonMap({})
class Reviewer(BaseModel):
    """Reviewer

    :param name: Time off reviewer name., defaults to None
    :type name: str, optional
    """

    def __init__(self, name: str = None):
        if name is not None:
            self.name = name


@JsonMap({})
class EmployeeTimeoffsItemAttachments(BaseModel):
    """EmployeeTimeoffsItemAttachments

    :param attachment_id: Unique identifier of an attachment., defaults to None
    :type attachment_id: str, optional
    :param label: Attachment label., defaults to None
    :type label: str, optional
    :param file_extension: Attachment file extension., defaults to None
    :type file_extension: str, optional
    """

    def __init__(
        self, attachment_id: str = None, label: str = None, file_extension: str = None
    ):
        if attachment_id is not None:
            self.attachment_id = attachment_id
        if label is not None:
            self.label = label
        if file_extension is not None:
            self.file_extension = file_extension


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

    :param time_off_id: time_off_id
    :type time_off_id: IdentifierValue
    :param time_off_type_id: Unique identifier of this resource.
    :type time_off_type_id: str
    :param policy_id: Unique identifier of this resource.
    :type policy_id: str
    :param policy_type_id: Unique identifier of this resource.
    :type policy_type_id: str
    :param policy_name: Time off policy name.
    :type policy_name: str
    :param policy_type_name: Time off policy type name.
    :type policy_type_name: str
    :param reason: Reason for time off.
    :type reason: str
    :param type_: Time off type.
    :type type_: EmployeeTimeoffsItemType
    :param requested_at: Time off requested date.
    :type requested_at: str
    :param reviewed_at: Time off reviewed date.
    :type reviewed_at: str
    :param with_multiple_dates: Time off with multiple dates.
    :type with_multiple_dates: bool
    :param created_at: Time off created date.
    :type created_at: str
    :param updated_at: Time off updated date.
    :type updated_at: str
    :param denial_reason: Time off denial reason.
    :type denial_reason: str
    :param requester: requester
    :type requester: Requester
    :param reviewer: reviewer
    :type reviewer: Reviewer
    :param days_used_start_year: Days used in the start year.
    :type days_used_start_year: str
    :param days_used_end_year: Days used in the end year.
    :type days_used_end_year: str
    :param days_used: Days used.
    :type days_used: str
    :param start_date: Time off start date.
    :type start_date: str
    :param end_date: Time off end date.
    :type end_date: str
    :param is_start_date_half_day: Is start date half day.
    :type is_start_date_half_day: bool
    :param is_end_date_half_day: Is end date half day.
    :type is_end_date_half_day: bool
    :param attachments: attachments
    :type attachments: List[EmployeeTimeoffsItemAttachments]
    :param change_request: Time off change request.
    :type change_request: str
    """

    def __init__(
        self,
        time_off_id: IdentifierValue,
        time_off_type_id: str,
        policy_id: str,
        policy_type_id: str,
        policy_name: str,
        policy_type_name: str,
        reason: str,
        type_: EmployeeTimeoffsItemType,
        requested_at: str,
        reviewed_at: str,
        with_multiple_dates: bool,
        created_at: str,
        updated_at: str,
        denial_reason: str,
        requester: Requester,
        reviewer: Reviewer,
        days_used_start_year: str,
        days_used_end_year: str,
        days_used: str,
        start_date: str,
        end_date: str,
        is_start_date_half_day: bool,
        is_end_date_half_day: bool,
        attachments: List[EmployeeTimeoffsItemAttachments],
        change_request: str,
    ):
        self.time_off_id = IdentifierValueGuard.return_one_of(time_off_id)
        self.time_off_type_id = time_off_type_id
        self.policy_id = policy_id
        self.policy_type_id = policy_type_id
        self.policy_name = policy_name
        self.policy_type_name = policy_type_name
        self.reason = reason
        self.type_ = self._enum_matching(
            type_, EmployeeTimeoffsItemType.list(), "type_"
        )
        self.requested_at = requested_at
        self.reviewed_at = reviewed_at
        self.with_multiple_dates = with_multiple_dates
        self.created_at = created_at
        self.updated_at = updated_at
        self.denial_reason = denial_reason
        self.requester = self._define_object(requester, Requester)
        self.reviewer = self._define_object(reviewer, Reviewer)
        self.days_used_start_year = days_used_start_year
        self.days_used_end_year = days_used_end_year
        self.days_used = days_used
        self.start_date = start_date
        self.end_date = end_date
        self.is_start_date_half_day = is_start_date_half_day
        self.is_end_date_half_day = is_end_date_half_day
        self.attachments = self._define_list(
            attachments, EmployeeTimeoffsItemAttachments
        )
        self.change_request = change_request
