# 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({})
class CandidateToPatch(BaseModel):
    """Details of candidate to update

    :param first_name: Candidate's first name., defaults to None
    :type first_name: str, optional
    :param last_name: Candidate's last name., defaults to None
    :type last_name: str, optional
    :param status: Offer status
    :type status: CandidateStatusEnum
    :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 job_title: Job Title., defaults to None
    :type job_title: str, optional
    :param link: Link to candidate's profile in ATS., defaults to None
    :type link: 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,
        status: CandidateStatusEnum,
        first_name: str = None,
        last_name: str = None,
        start_date: str = None,
        job_title: str = None,
        link: str = None,
        email: str = None,
        nationality: str = None,
        country: str = None,
        state: str = None,
    ):
        if first_name is not None:
            self.first_name = first_name
        if last_name is not None:
            self.last_name = last_name
        self.status = self._enum_matching(status, CandidateStatusEnum.list(), "status")
        if start_date is not None:
            self.start_date = start_date
        if job_title is not None:
            self.job_title = job_title
        if link is not None:
            self.link = link
        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
