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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .contract_type_enum import ContractTypeEnum
from .contract_status_enum import ContractStatusEnum
from .seniority import Seniority


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

    :param scope_of_work: Scope of work description., defaults to None
    :type scope_of_work: str, optional
    :param start_date: Short date in format ISO-8601 (YYYY-MM-DD). For example 2022-12-31., defaults to None
    :type start_date: str, optional
    :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 country: Country of employement., defaults to None
    :type country: str, optional
    :param state: State code of the state/province where the this person will be employed., defaults to None
    :type state: str, optional
    :param work_visa_required: Do you require Deel to apply for work visa for this person?, defaults to None
    :type work_visa_required: bool, 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: str, optional
    :param probation_period: Number of probation days., defaults to None
    :type probation_period: float, optional
    :param calculated_holidays: Number of calculate holidays for this contract., defaults to None
    :type calculated_holidays: str, optional
    """

    def __init__(
        self,
        scope_of_work: str = None,
        start_date: str = None,
        end_date: str = None,
        country: str = None,
        state: str = None,
        work_visa_required: bool = None,
        time_off_type: str = None,
        probation_period: float = None,
        calculated_holidays: str = None,
    ):
        if scope_of_work is not None:
            self.scope_of_work = scope_of_work
        if start_date is not None:
            self.start_date = self._pattern_matching(
                start_date, "^\d{4}-\d{2}-\d{2}$", "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 country is not None:
            self.country = country
        if state is not None:
            self.state = state
        if work_visa_required is not None:
            self.work_visa_required = work_visa_required
        if time_off_type is not None:
            self.time_off_type = time_off_type
        if probation_period is not None:
            self.probation_period = probation_period
        if calculated_holidays is not None:
            self.calculated_holidays = calculated_holidays


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

    :param name: Legal entity name., defaults to None
    :type name: str, optional
    """

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


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

    :param legal_entity: legal_entity, defaults to None
    :type legal_entity: ClientLegalEntity2, optional
    """

    def __init__(self, legal_entity: ClientLegalEntity2 = None):
        if legal_entity is not None:
            self.legal_entity = self._define_object(legal_entity, ClientLegalEntity2)


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

    :param salary: Gross annual salary., defaults to None
    :type salary: float, optional
    :param currency: Currency of gross annual salary., defaults to None
    :type currency: str, optional
    :param variable_compensation: Variable compensation acount or percentage., defaults to None
    :type variable_compensation: str, optional
    :param variable_compensation_type: Type fo variable compensation., defaults to None
    :type variable_compensation_type: str, optional
    """

    def __init__(
        self,
        salary: float = None,
        currency: str = None,
        variable_compensation: str = None,
        variable_compensation_type: str = None,
    ):
        if salary is not None:
            self.salary = salary
        if currency is not None:
            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 = variable_compensation_type


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

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

    def __init__(
        self,
        legal_name: str = None,
        first_name: str = None,
        last_name: str = None,
        email: str = None,
    ):
        if legal_name is not None:
            self.legal_name = legal_name
        if first_name is not None:
            self.first_name = first_name
        if last_name is not None:
            self.last_name = last_name
        if email is not None:
            self.email = email


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

    :param id_: Health plan ID, defaults to None
    :type id_: str, optional
    :param name: Health plan name, defaults to None
    :type name: str, optional
    """

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


@JsonMap({"id_": "id", "type_": "type"})
class EorContractCreated(BaseModel):
    """EorContractCreated

    :param id_: Id of the contract quote created, defaults to None
    :type id_: str, optional
    :param type_: Type of a contract, defaults to None
    :type type_: ContractTypeEnum, optional
    :param created_at: Long date-time format following ISO-8601, defaults to None
    :type created_at: str, optional
    :param status: Status of a contract in Deel workflow, defaults to None
    :type status: ContractStatusEnum, optional
    :param job_title: Employee's job title., defaults to None
    :type job_title: str, optional
    :param employment: employment, defaults to None
    :type employment: EorContractCreatedEmployment, optional
    :param client: client, defaults to None
    :type client: EorContractCreatedClient, optional
    :param compensation_details: compensation_details, defaults to None
    :type compensation_details: EorContractCreatedCompensationDetails, optional
    :param employee: employee, defaults to None
    :type employee: EorContractCreatedEmployee, optional
    :param health_plan: health_plan, defaults to None
    :type health_plan: HealthPlan, optional
    :param seniority: Seniority describes level of expertise at a job e.g. junior, defaults to None
    :type seniority: Seniority, optional
    """

    def __init__(
        self,
        id_: str = None,
        type_: ContractTypeEnum = None,
        created_at: str = None,
        status: ContractStatusEnum = None,
        job_title: str = None,
        employment: EorContractCreatedEmployment = None,
        client: EorContractCreatedClient = None,
        compensation_details: EorContractCreatedCompensationDetails = None,
        employee: EorContractCreatedEmployee = None,
        health_plan: HealthPlan = None,
        seniority: Seniority = None,
    ):
        if id_ is not None:
            self.id_ = id_
        if type_ is not None:
            self.type_ = self._enum_matching(type_, ContractTypeEnum.list(), "type_")
        if created_at is not None:
            self.created_at = created_at
        if status is not None:
            self.status = self._enum_matching(
                status, ContractStatusEnum.list(), "status"
            )
        if job_title is not None:
            self.job_title = job_title
        if employment is not None:
            self.employment = self._define_object(
                employment, EorContractCreatedEmployment
            )
        if client is not None:
            self.client = self._define_object(client, EorContractCreatedClient)
        if compensation_details is not None:
            self.compensation_details = self._define_object(
                compensation_details, EorContractCreatedCompensationDetails
            )
        if employee is not None:
            self.employee = self._define_object(employee, EorContractCreatedEmployee)
        if health_plan is not None:
            self.health_plan = self._define_object(health_plan, HealthPlan)
        if seniority is not None:
            self.seniority = self._define_object(seniority, Seniority)
