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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .candidate_status_enum import CandidateStatusEnum


@JsonMap({"id_": "id"})
class CandidateToCreate(BaseModel):
    """Details of candidate to create

    :param id_: Unique identifier of candidate in your ATS.
    :type id_: str
    :param first_name: Candidate's first name.
    :type first_name: str
    :param last_name: Candidate's last name.
    :type last_name: str
    :param status: Offer status
    :type status: CandidateStatusEnum
    :param start_date: Short date in format ISO-8601 (YYYY-MM-DD). For example: 2022-12-31.
    :type start_date: str
    :param link: Link to candidate's profile in ATS.
    :type link: str
    :param job_title: Job Title., defaults to None
    :type job_title: str, optional
    :param email: Worker's email address., defaults to None
    :type email: str, optional
    :param nationality: nationality, defaults to None
    :type nationality: str, optional
    :param country: Country code., defaults to None
    :type country: str, optional
    :param state: Job location state., defaults to None
    :type state: str, optional
    """

    def __init__(
        self,
        id_: str,
        first_name: str,
        last_name: str,
        status: CandidateStatusEnum,
        start_date: str,
        link: str,
        job_title: str = None,
        email: str = None,
        nationality: str = None,
        country: str = None,
        state: str = None,
    ):
        self.id_ = id_
        self.first_name = first_name
        self.last_name = last_name
        self.status = self._enum_matching(status, CandidateStatusEnum.list(), "status")
        self.start_date = start_date
        self.link = link
        if job_title is not None:
            self.job_title = job_title
        if email is not None:
            self.email = email
        if nationality is not None:
            self.nationality = nationality
        if country is not None:
            self.country = self._pattern_matching(country, "^[A-Z]{2}$", "country")
        if state is not None:
            self.state = state
