# 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


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

    :param allowance: Number of holidays., defaults to None
    :type allowance: float, 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
    """

    def __init__(self, allowance: float = None, start_date: str = None):
        if allowance is not None:
            self.allowance = allowance
        if start_date is not None:
            self.start_date = self._pattern_matching(
                start_date, "^\d{4}-\d{2}-\d{2}$", "start_date"
            )


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

    :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 employment., defaults to None
    :type country: str, optional
    :param state: State code of the state/province where 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_: str, optional
    :param work_visa_required: Do you require Deel to apply for a work visa for this person?, defaults to None
    :type work_visa_required: bool, optional
    :param holidays: holidays, defaults to None
    :type holidays: EmploymentHolidays2, optional
    """

    def __init__(
        self,
        start_date: str = None,
        end_date: str = None,
        country: str = None,
        state: str = None,
        type_: str = None,
        work_visa_required: bool = None,
        holidays: EmploymentHolidays2 = None,
    ):
        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 type_ is not None:
            self.type_ = type_
        if work_visa_required is not None:
            self.work_visa_required = work_visa_required
        if holidays is not None:
            self.holidays = self._define_object(holidays, EmploymentHolidays2)


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

    :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 GpContractCreatedClient(BaseModel):
    """GpContractCreatedClient

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

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


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

    :param salary: Gross annual/month salary., defaults to None
    :type salary: float, optional
    :param currency: Currency of gross annual/month salary., defaults to None
    :type currency: str, optional
    :param scale: Scale at which the salary is paid., defaults to None
    :type scale: str, optional
    """

    def __init__(self, salary: float = None, currency: str = None, scale: str = None):
        if salary is not None:
            self.salary = salary
        if currency is not None:
            self.currency = currency
        if scale is not None:
            self.scale = scale


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

    :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 address., defaults to None
    :type email: str, optional
    :param employee_number: Employee's number., defaults to None
    :type employee_number: str, optional
    """

    def __init__(
        self,
        first_name: str = None,
        last_name: str = None,
        email: str = None,
        employee_number: str = None,
    ):
        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
        if employee_number is not None:
            self.employee_number = employee_number


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

    :param id_: Id of the contract 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: GpContractCreatedEmployment, optional
    :param client: client, defaults to None
    :type client: GpContractCreatedClient, optional
    :param compensation_details: compensation_details, defaults to None
    :type compensation_details: GpContractCreatedCompensationDetails, optional
    :param employee: employee, defaults to None
    :type employee: GpContractCreatedEmployee, optional
    """

    def __init__(
        self,
        id_: str = None,
        type_: ContractTypeEnum = None,
        created_at: str = None,
        status: ContractStatusEnum = None,
        job_title: str = None,
        employment: GpContractCreatedEmployment = None,
        client: GpContractCreatedClient = None,
        compensation_details: GpContractCreatedCompensationDetails = None,
        employee: GpContractCreatedEmployee = 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, GpContractCreatedEmployment
            )
        if client is not None:
            self.client = self._define_object(client, GpContractCreatedClient)
        if compensation_details is not None:
            self.compensation_details = self._define_object(
                compensation_details, GpContractCreatedCompensationDetails
            )
        if employee is not None:
            self.employee = self._define_object(employee, GpContractCreatedEmployee)
