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

from __future__ import annotations
from enum import Enum
from .utils.json_map import JsonMap
from .base import BaseModel
from .pension_eor_contract_to_create import PensionEorContractToCreate


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

    :param street: Street and number., defaults to None
    :type street: str, optional
    :param city: City name., defaults to None
    :type city: str, optional
    :param state: State code., defaults to None
    :type state: str, optional
    :param zip: Zip code., defaults to None
    :type zip: str, optional
    :param country: Country code., defaults to None
    :type country: str, optional
    """

    def __init__(
        self,
        street: str = None,
        city: str = None,
        state: str = None,
        zip: str = None,
        country: str = None,
    ):
        if street is not None:
            self.street = street
        if city is not None:
            self.city = city
        if state is not None:
            self.state = state
        if zip is not None:
            self.zip = zip
        if country is not None:
            self.country = self._pattern_matching(country, "^[A-Z]{2}$", "country")


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

    :param first_name: Employee's first name.
    :type first_name: str
    :param last_name: Employee's last name.
    :type last_name: str
    :param email: Employee's email address., defaults to None
    :type email: str, optional
    :param nationality: Employee's nationality.
    :type nationality: str
    :param address: address, defaults to None
    :type address: EmployeeAddress1, optional
    """

    def __init__(
        self,
        first_name: str,
        last_name: str,
        nationality: str,
        email: str = None,
        address: EmployeeAddress1 = None,
    ):
        self.first_name = first_name
        self.last_name = last_name
        if email is not None:
            self.email = email
        self.nationality = nationality
        if address is not None:
            self.address = self._define_object(address, EmployeeAddress1)


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

    :cvar FULL_TIME: "Full-time"
    :vartype FULL_TIME: str
    :cvar PART_TIME: "Part-time"
    :vartype PART_TIME: str
    """

    FULL_TIME = "Full-time"
    PART_TIME = "Part-time"

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

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


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

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

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


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

    :param country: Country code.
    :type country: str
    :param state: State code of the state/province where the this person will be employed., defaults to None
    :type state: str, optional
    :param type_: Is it a full-time contract or a part-time contract?, defaults to None
    :type type_: EmploymentType, optional
    :param work_visa_required: Do you require Deel to apply for work visa for this person?
    :type work_visa_required: bool
    :param start_date: Short date in format ISO-8601 (YYYY-MM-DD). For example: 2022-12-31.
    :type start_date: str
    :param end_date: Short date in format ISO-8601 (YYYY-MM-DD). For example 2022-12-31., defaults to None
    :type end_date: str, optional
    :param probation_period: Number of probation days., defaults to None
    :type probation_period: float, optional
    :param scope_of_work: Scope of work description., defaults to None
    :type scope_of_work: str, optional
    :param time_off_type: If you want to use standard number of holidays for this employee, choose "STANDARD". If you want to enter a specific number of holidays, choose "SPECIFIC" and enter the number of days in the holidays field., defaults to None
    :type time_off_type: TimeOffType, optional
    :param holidays: Enter the number of holidays. Leave this field blank if you are chooseing "STANDARD" time_off_type., defaults to None
    :type holidays: float, optional
    """

    def __init__(
        self,
        country: str,
        work_visa_required: bool,
        start_date: str,
        state: str = None,
        type_: EmploymentType = None,
        end_date: str = None,
        probation_period: float = None,
        scope_of_work: str = None,
        time_off_type: TimeOffType = None,
        holidays: float = None,
    ):
        self.country = self._pattern_matching(country, "^[A-Z]{2}$", "country")
        if state is not None:
            self.state = state
        if type_ is not None:
            self.type_ = self._enum_matching(type_, EmploymentType.list(), "type_")
        self.work_visa_required = work_visa_required
        self.start_date = start_date
        if end_date is not None:
            self.end_date = self._pattern_matching(
                end_date, "^\d{4}-\d{2}-\d{2}$", "end_date"
            )
        if probation_period is not None:
            self.probation_period = probation_period
        if scope_of_work is not None:
            self.scope_of_work = scope_of_work
        if time_off_type is not None:
            self.time_off_type = self._enum_matching(
                time_off_type, TimeOffType.list(), "time_off_type"
            )
        if holidays is not None:
            self.holidays = holidays


@JsonMap({"id_": "id"})
class EorContractToCreateSeniority(BaseModel):
    """EorContractToCreateSeniority

    :param id_: Unique identifier of this resource., defaults to None
    :type id_: str, optional
    """

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


@JsonMap({"id_": "id"})
class ClientLegalEntity1(BaseModel):
    """ClientLegalEntity1

    :param id_: Unique identifier of this resource., defaults to None
    :type id_: str, optional
    """

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


@JsonMap({"id_": "id"})
class ClientTeam1(BaseModel):
    """ClientTeam1

    :param id_: Unique identifier of this resource.
    :type id_: str
    """

    def __init__(self, id_: str):
        self.id_ = id_


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

    :param legal_entity: legal_entity, defaults to None
    :type legal_entity: ClientLegalEntity1, optional
    :param team: team
    :type team: ClientTeam1
    """

    def __init__(self, team: ClientTeam1, legal_entity: ClientLegalEntity1 = None):
        if legal_entity is not None:
            self.legal_entity = self._define_object(legal_entity, ClientLegalEntity1)
        self.team = self._define_object(team, ClientTeam1)


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

    :cvar PERCENTAGE: "PERCENTAGE"
    :vartype PERCENTAGE: str
    :cvar FIXED: "FIXED"
    :vartype FIXED: str
    """

    PERCENTAGE = "PERCENTAGE"
    FIXED = "FIXED"

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

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


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

    :param salary: Employee's gross annual salary., defaults to None
    :type salary: float, optional
    :param currency: Salary currency.
    :type currency: str
    :param variable_compensation: Variable compensation. For example, if the person will earn 5% of the gross annual salary as the variable compensation, enter 5., defaults to None
    :type variable_compensation: float, optional
    :param variable_compensation_type: Should be set only if variable_compensation is set. It can be PERCENTAGE or FIXED., defaults to None
    :type variable_compensation_type: VariableCompensationType, optional
    """

    def __init__(
        self,
        currency: str,
        salary: float = None,
        variable_compensation: float = None,
        variable_compensation_type: VariableCompensationType = None,
    ):
        if salary is not None:
            self.salary = salary
        self.currency = currency
        if variable_compensation is not None:
            self.variable_compensation = variable_compensation
        if variable_compensation_type is not None:
            self.variable_compensation_type = self._enum_matching(
                variable_compensation_type,
                VariableCompensationType.list(),
                "variable_compensation_type",
            )


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

    :cvar SKILLED: "Skilled"
    :vartype SKILLED: str
    :cvar UNSKILLED: "Unskilled"
    :vartype UNSKILLED: str
    """

    SKILLED = "Skilled"
    UNSKILLED = "Unskilled"

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

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


@JsonMap({})
class QuoteAdditionalFields(BaseModel):
    """Some countries require additional employee information for employment contracts.

    :param gender: Employee's gender., defaults to None
    :type gender: str, optional
    :param worker_type: Type of worker., defaults to None
    :type worker_type: WorkerType, optional
    :param dob: Employee's date of birth., defaults to None
    :type dob: str, optional
    """

    def __init__(
        self, gender: str = None, worker_type: WorkerType = None, dob: str = None
    ):
        if gender is not None:
            self.gender = gender
        if worker_type is not None:
            self.worker_type = self._enum_matching(
                worker_type, WorkerType.list(), "worker_type"
            )
        if dob is not None:
            self.dob = dob


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

    :param employee: employee
    :type employee: EorContractToCreateEmployee
    :param employment: employment
    :type employment: EorContractToCreateEmployment
    :param job_title: Employee's job title.
    :type job_title: str
    :param seniority: seniority
    :type seniority: EorContractToCreateSeniority
    :param client: client
    :type client: EorContractToCreateClient
    :param compensation_details: compensation_details
    :type compensation_details: EorContractToCreateCompensationDetails
    :param quote_additional_fields: Some countries require additional employee information for employment contracts., defaults to None
    :type quote_additional_fields: QuoteAdditionalFields, optional
    :param health_plan_id: Healthcare plan id. You can see available healthcare plans in the country guide endpoint., defaults to None
    :type health_plan_id: str, optional
    :param pension: Some countries required a pension benefit., defaults to None
    :type pension: PensionEorContractToCreate, optional
    """

    def __init__(
        self,
        employee: EorContractToCreateEmployee,
        employment: EorContractToCreateEmployment,
        job_title: str,
        seniority: EorContractToCreateSeniority,
        client: EorContractToCreateClient,
        compensation_details: EorContractToCreateCompensationDetails,
        quote_additional_fields: QuoteAdditionalFields = None,
        health_plan_id: str = None,
        pension: PensionEorContractToCreate = None,
    ):
        self.employee = self._define_object(employee, EorContractToCreateEmployee)
        self.employment = self._define_object(employment, EorContractToCreateEmployment)
        self.job_title = job_title
        self.seniority = self._define_object(seniority, EorContractToCreateSeniority)
        self.client = self._define_object(client, EorContractToCreateClient)
        self.compensation_details = self._define_object(
            compensation_details, EorContractToCreateCompensationDetails
        )
        if quote_additional_fields is not None:
            self.quote_additional_fields = self._define_object(
                quote_additional_fields, QuoteAdditionalFields
            )
        if health_plan_id is not None:
            self.health_plan_id = health_plan_id
        if pension is not None:
            self.pension = self._define_object(pension, PensionEorContractToCreate)
