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

from __future__ import annotations
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .timeoffs_type_enum import TimeoffsTypeEnum
from .timeoffs_status_enum import TimeoffsStatusEnum
from .timeoffs_profile import TimeoffsProfile
from .timeoffs_attachments_item import TimeoffsAttachmentsItem


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

    :param reason: Reason for requesting time off., defaults to None
    :type reason: str, optional
    :param type_: type_
    :type type_: TimeoffsTypeEnum
    :param requested_at: Long date-time format following ISO-8601
    :type requested_at: str
    :param reviewed_at: Long date-time format following ISO-8601, defaults to None
    :type reviewed_at: str, optional
    :param denial_reason: Reason why time off was denied., defaults to None
    :type denial_reason: str, optional
    :param has_multiple_dates: Indicates if multiple time off days are requested., defaults to None
    :type has_multiple_dates: bool, optional
    :param status: status
    :type status: TimeoffsStatusEnum
    :param other_timeoff_name: Custom title for the time off. Only specify if type is "OTHER"., defaults to None
    :type other_timeoff_name: str, optional
    :param requester: requester, defaults to None
    :type requester: TimeoffsProfile, optional
    :param reviewer: reviewer, defaults to None
    :type reviewer: TimeoffsProfile, optional
    :param days_used_start_year: Days used at the start year., defaults to None
    :type days_used_start_year: str, optional
    :param days_used_end_year: Days used at the end year., defaults to None
    :type days_used_end_year: str, optional
    :param total_days_used: Total number of time off days used., defaults to None
    :type total_days_used: str, optional
    :param start_date_is_half_day: Indicates if the first day of time off is a half day., defaults to None
    :type start_date_is_half_day: bool, optional
    :param end_date_is_half_day: Indicates if the last day of time off is a half day., defaults to None
    :type end_date_is_half_day: bool, optional
    :param single_date: Long date-time format following ISO-8601, defaults to None
    :type single_date: str, optional
    :param date_is_half_day: If true, only a single date was specified., defaults to None
    :type date_is_half_day: bool, optional
    :param attachments: A list of attachments. 2022-09-08 FE only allows for "SICK LEAVE", defaults to None
    :type attachments: List[TimeoffsAttachmentsItem], optional
    """

    def __init__(
        self,
        type_: TimeoffsTypeEnum,
        requested_at: str,
        status: TimeoffsStatusEnum,
        reason: str = None,
        reviewed_at: str = None,
        denial_reason: str = None,
        has_multiple_dates: bool = None,
        other_timeoff_name: str = None,
        requester: TimeoffsProfile = None,
        reviewer: TimeoffsProfile = None,
        days_used_start_year: str = None,
        days_used_end_year: str = None,
        total_days_used: str = None,
        start_date_is_half_day: bool = None,
        end_date_is_half_day: bool = None,
        single_date: str = None,
        date_is_half_day: bool = None,
        attachments: List[TimeoffsAttachmentsItem] = None,
    ):
        if reason is not None:
            self.reason = reason
        self.type_ = self._enum_matching(type_, TimeoffsTypeEnum.list(), "type_")
        self.requested_at = requested_at
        if reviewed_at is not None:
            self.reviewed_at = reviewed_at
        if denial_reason is not None:
            self.denial_reason = denial_reason
        if has_multiple_dates is not None:
            self.has_multiple_dates = has_multiple_dates
        self.status = self._enum_matching(status, TimeoffsStatusEnum.list(), "status")
        if other_timeoff_name is not None:
            self.other_timeoff_name = other_timeoff_name
        if requester is not None:
            self.requester = self._define_object(requester, TimeoffsProfile)
        if reviewer is not None:
            self.reviewer = self._define_object(reviewer, TimeoffsProfile)
        if days_used_start_year is not None:
            self.days_used_start_year = days_used_start_year
        if days_used_end_year is not None:
            self.days_used_end_year = days_used_end_year
        if total_days_used is not None:
            self.total_days_used = total_days_used
        if start_date_is_half_day is not None:
            self.start_date_is_half_day = start_date_is_half_day
        if end_date_is_half_day is not None:
            self.end_date_is_half_day = end_date_is_half_day
        if single_date is not None:
            self.single_date = single_date
        if date_is_half_day is not None:
            self.date_is_half_day = date_is_half_day
        if attachments is not None:
            self.attachments = self._define_list(attachments, TimeoffsAttachmentsItem)
