# 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 .eor_field import EorField
from .salary_frequency_scale_enum import SalaryFrequencyScaleEnum
from .benefit_status_enum import BenefitStatusEnum
from .health_insurance_provider import HealthInsuranceProvider
from .pension_provider import PensionProvider


@JsonMap({"most_common": "mostCommon"})
class Holiday(BaseModel):
    """Range of the number of holidays.

    :param min: Minimum number of holidays required for a legally compliant contract., defaults to None
    :type min: str, optional
    :param max: Maximum number of holidays required for a legally compliant contract., defaults to None
    :type max: str, optional
    :param most_common: Most common number of holidays, defaults to None
    :type most_common: str, optional
    """

    def __init__(self, min: str = None, max: str = None, most_common: str = None):
        if min is not None:
            self.min = min
        if max is not None:
            self.max = max
        if most_common is not None:
            self.most_common = most_common


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

    :cvar PRORATED: "PRORATED"
    :vartype PRORATED: str
    :cvar STANDARD: "STANDARD"
    :vartype STANDARD: str
    :cvar SPECIFIC: "SPECIFIC"
    :vartype SPECIFIC: str
    """

    PRORATED = "PRORATED"
    STANDARD = "STANDARD"
    SPECIFIC = "SPECIFIC"

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

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


@JsonMap({"type_": "type"})
class PartTimeHoliday(BaseModel):
    """Holiday type and range for part-time contracts.

    :param type_: type_, defaults to None
    :type type_: PartTimeHolidayType, optional
    :param min: Minimum number of holidays required for a legally compliant contract., defaults to None
    :type min: str, optional
    :param max: Maximum number of holidays required for a legally compliant contract., defaults to None
    :type max: str, optional
    """

    def __init__(
        self, type_: PartTimeHolidayType = None, min: str = None, max: str = None
    ):
        if type_ is not None:
            self.type_ = self._enum_matching(type_, PartTimeHolidayType.list(), "type_")
        if min is not None:
            self.min = min
        if max is not None:
            self.max = max


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

    :param min: Minimum number of sick days required for a legally compliant contract., defaults to None
    :type min: str, optional
    :param max: Maximum number of sick days allowed for a legally compliant contract., defaults to None
    :type max: str, optional
    """

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


@JsonMap({})
class Salary(BaseModel):
    """Salary range.

    :param min: Minimum wage for a legally compliant contract., defaults to None
    :type min: str, optional
    :param max: Maximum wage allowed for a legally compliant contract., defaults to None
    :type max: str, optional
    :param frequency: Scale of the salary frequency., defaults to None
    :type frequency: SalaryFrequencyScaleEnum, optional
    """

    def __init__(
        self,
        min: str = None,
        max: str = None,
        frequency: SalaryFrequencyScaleEnum = None,
    ):
        if min is not None:
            self.min = min
        if max is not None:
            self.max = max
        if frequency is not None:
            self.frequency = self._enum_matching(
                frequency, SalaryFrequencyScaleEnum.list(), "frequency"
            )


@JsonMap({})
class Probation(BaseModel):
    """Probation period range.

    :param min: Minimum probation days required for a legally compliant contract., defaults to None
    :type min: str, optional
    :param max: Maximum probation days allowed for a legally compliant contract., defaults to None
    :type max: float, optional
    """

    def __init__(self, min: str = None, max: float = None):
        if min is not None:
            self.min = min
        if max is not None:
            self.max = max


@JsonMap({})
class PartTimeProbation(BaseModel):
    """Probation period range for part-time contracts.

    :param min: Minimum probation days required for a legally compliant contract., defaults to None
    :type min: float, optional
    :param max: Maximum probation days allowed for a legally compliant contract., defaults to None
    :type max: float, optional
    """

    def __init__(self, min: float = None, max: float = None):
        if min is not None:
            self.min = min
        if max is not None:
            self.max = max


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

    :param min: min, defaults to None
    :type min: str, optional
    :param max: max, defaults to None
    :type max: str, optional
    """

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


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

    :param min: min, defaults to None
    :type min: str, optional
    :param max: max, defaults to None
    :type max: str, optional
    """

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


@JsonMap({})
class WorkSchedule(BaseModel):
    """Employee's Work schedule in days and hours.

    :param days: days, defaults to None
    :type days: Days, optional
    :param hours: hours, defaults to None
    :type hours: Hours, optional
    """

    def __init__(self, days: Days = None, hours: Hours = None):
        if days is not None:
            self.days = self._define_object(days, Days)
        if hours is not None:
            self.hours = self._define_object(hours, Hours)


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

    :cvar ALLOWED_WITHOUT_LIMITATION: "ALLOWED_WITHOUT_LIMITATION"
    :vartype ALLOWED_WITHOUT_LIMITATION: str
    :cvar ALLOWED_WITH_MAXIMUM_LIMITATION: "ALLOWED_WITH_MAXIMUM_LIMITATION"
    :vartype ALLOWED_WITH_MAXIMUM_LIMITATION: str
    :cvar NOT_ALLOWED: "NOT_ALLOWED"
    :vartype NOT_ALLOWED: str
    """

    ALLOWED_WITHOUT_LIMITATION = "ALLOWED_WITHOUT_LIMITATION"
    ALLOWED_WITH_MAXIMUM_LIMITATION = "ALLOWED_WITH_MAXIMUM_LIMITATION"
    NOT_ALLOWED = "NOT_ALLOWED"

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

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


@JsonMap({"type_": "type"})
class DefiniteContract(BaseModel):
    """Conditions to make definitive contract.

    :param type_: type_, defaults to None
    :type type_: DefiniteContractType, optional
    :param maximum_limitation: maximum_limitation, defaults to None
    :type maximum_limitation: float, optional
    """

    def __init__(
        self, type_: DefiniteContractType = None, maximum_limitation: float = None
    ):
        if type_ is not None:
            self.type_ = self._enum_matching(
                type_, DefiniteContractType.list(), "type_"
            )
        if maximum_limitation is not None:
            self.maximum_limitation = maximum_limitation


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

    :param status: status, defaults to None
    :type status: BenefitStatusEnum, optional
    :param providers: providers, defaults to None
    :type providers: List[HealthInsuranceProvider], optional
    """

    def __init__(
        self,
        status: BenefitStatusEnum = None,
        providers: List[HealthInsuranceProvider] = None,
    ):
        if status is not None:
            self.status = self._enum_matching(
                status, BenefitStatusEnum.list(), "status"
            )
        if providers is not None:
            self.providers = self._define_list(providers, HealthInsuranceProvider)


@JsonMap({})
class Pension(BaseModel):
    """If it is there, you must specify the pension benefit when creating an EOR contract.

    :param status: status, defaults to None
    :type status: BenefitStatusEnum, optional
    :param providers: providers, defaults to None
    :type providers: List[PensionProvider], optional
    """

    def __init__(
        self, status: BenefitStatusEnum = None, providers: List[PensionProvider] = None
    ):
        if status is not None:
            self.status = self._enum_matching(
                status, BenefitStatusEnum.list(), "status"
            )
        if providers is not None:
            self.providers = self._define_list(providers, PensionProvider)


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

    :param holiday: Range of the number of holidays., defaults to None
    :type holiday: Holiday, optional
    :param part_time_holiday: Holiday type and range for part-time contracts., defaults to None
    :type part_time_holiday: PartTimeHoliday, optional
    :param sick_days: sick_days, defaults to None
    :type sick_days: SickDays, optional
    :param salary: Salary range., defaults to None
    :type salary: Salary, optional
    :param probation: Probation period range., defaults to None
    :type probation: Probation, optional
    :param part_time_probation: Probation period range for part-time contracts., defaults to None
    :type part_time_probation: PartTimeProbation, optional
    :param work_schedule: Employee's Work schedule in days and hours., defaults to None
    :type work_schedule: WorkSchedule, optional
    :param insurance_fee: Insurance fee., defaults to None
    :type insurance_fee: str, optional
    :param currency: Country currency., defaults to None
    :type currency: str, optional
    :param hiring_guide_country_name: Country name., defaults to None
    :type hiring_guide_country_name: str, optional
    :param start_date_buffer: Calculate employee's minimum start date using the start date buffer. Today's date + (number of business days x start_date_buffer) = Minimum start date., defaults to None
    :type start_date_buffer: float, optional
    :param definite_contract: Conditions to make definitive contract., defaults to None
    :type definite_contract: DefiniteContract, optional
    :param adjustments_information_box: Country specific notes and information., defaults to None
    :type adjustments_information_box: str, optional
    :param health_insurance: health_insurance, defaults to None
    :type health_insurance: HealthInsurance, optional
    :param pension: If it is there, you must specify the pension benefit when creating an EOR contract., defaults to None
    :type pension: Pension, optional
    :param mandatory_fields: mandatory_fields, defaults to None
    :type mandatory_fields: List[EorField], optional
    """

    def __init__(
        self,
        holiday: Holiday = None,
        part_time_holiday: PartTimeHoliday = None,
        sick_days: SickDays = None,
        salary: Salary = None,
        probation: Probation = None,
        part_time_probation: PartTimeProbation = None,
        work_schedule: WorkSchedule = None,
        insurance_fee: str = None,
        currency: str = None,
        hiring_guide_country_name: str = None,
        start_date_buffer: float = None,
        definite_contract: DefiniteContract = None,
        adjustments_information_box: str = None,
        health_insurance: HealthInsurance = None,
        pension: Pension = None,
        mandatory_fields: List[EorField] = None,
    ):
        if holiday is not None:
            self.holiday = self._define_object(holiday, Holiday)
        if part_time_holiday is not None:
            self.part_time_holiday = self._define_object(
                part_time_holiday, PartTimeHoliday
            )
        if sick_days is not None:
            self.sick_days = self._define_object(sick_days, SickDays)
        if salary is not None:
            self.salary = self._define_object(salary, Salary)
        if probation is not None:
            self.probation = self._define_object(probation, Probation)
        if part_time_probation is not None:
            self.part_time_probation = self._define_object(
                part_time_probation, PartTimeProbation
            )
        if work_schedule is not None:
            self.work_schedule = self._define_object(work_schedule, WorkSchedule)
        if insurance_fee is not None:
            self.insurance_fee = insurance_fee
        if currency is not None:
            self.currency = currency
        if hiring_guide_country_name is not None:
            self.hiring_guide_country_name = hiring_guide_country_name
        if start_date_buffer is not None:
            self.start_date_buffer = start_date_buffer
        if definite_contract is not None:
            self.definite_contract = self._define_object(
                definite_contract, DefiniteContract
            )
        if adjustments_information_box is not None:
            self.adjustments_information_box = adjustments_information_box
        if health_insurance is not None:
            self.health_insurance = self._define_object(
                health_insurance, HealthInsurance
            )
        if pension is not None:
            self.pension = self._define_object(pension, Pension)
        if mandatory_fields is not None:
            self.mandatory_fields = self._define_list(mandatory_fields, EorField)
