# 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 .client_of_basic_contract import ClientOfBasicContract
from .worker_of_basic_contract import WorkerOfBasicContract
from .invitations_of_basic_contract import InvitationsOfBasicContract
from .signatures_of_basic_contract import SignaturesOfBasicContract
from .contract_who_reports_enum import ContractWhoReportsEnum


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

    :param id_: id_
    :type id_: str
    :param title: title
    :type title: str
    :param type_: Type of a contract
    :type type_: ContractTypeEnum
    :param status: Status of a contract in Deel workflow
    :type status: ContractStatusEnum
    :param client: client
    :type client: ClientOfBasicContract
    :param worker: worker
    :type worker: WorkerOfBasicContract
    :param invitations: invitations
    :type invitations: InvitationsOfBasicContract
    :param signatures: signatures
    :type signatures: SignaturesOfBasicContract
    :param is_shielded: is_shielded
    :type is_shielded: bool
    :param is_archived: is_archived
    :type is_archived: bool
    :param created_at: Long date-time format following ISO-8601
    :type created_at: str
    :param termination_date: Long date-time format following ISO-8601
    :type termination_date: str
    :param notice_period: Days before to notice the termination of contract for eather party., defaults to None
    :type notice_period: float, optional
    :param scale: The payment scale (e.g., hourly, weekly, monthly, etc.), defaults to None
    :type scale: str, optional
    :param who_reports: Flag to indicate who is supposed to provide regular reports, defaults to None
    :type who_reports: ContractWhoReportsEnum, optional
    :param external_id: A unique identifier for the object provided by an external system., defaults to None
    :type external_id: str, optional
    """

    def __init__(
        self,
        id_: str,
        title: str,
        type_: ContractTypeEnum,
        status: ContractStatusEnum,
        client: ClientOfBasicContract,
        worker: WorkerOfBasicContract,
        invitations: InvitationsOfBasicContract,
        signatures: SignaturesOfBasicContract,
        is_shielded: bool,
        is_archived: bool,
        created_at: str,
        termination_date: str,
        notice_period: float = None,
        scale: str = None,
        who_reports: ContractWhoReportsEnum = None,
        external_id: str = None,
    ):
        self.id_ = id_
        self.title = title
        self.type_ = self._enum_matching(type_, ContractTypeEnum.list(), "type_")
        self.status = self._enum_matching(status, ContractStatusEnum.list(), "status")
        self.client = self._define_object(client, ClientOfBasicContract)
        self.worker = self._define_object(worker, WorkerOfBasicContract)
        self.invitations = self._define_object(invitations, InvitationsOfBasicContract)
        self.signatures = self._define_object(signatures, SignaturesOfBasicContract)
        self.is_shielded = is_shielded
        self.is_archived = is_archived
        self.created_at = created_at
        self.termination_date = termination_date
        if notice_period is not None:
            self.notice_period = notice_period
        if scale is not None:
            self.scale = scale
        if who_reports is not None:
            self.who_reports = self._enum_matching(
                who_reports, ContractWhoReportsEnum.list(), "who_reports"
            )
        if external_id is not None:
            self.external_id = external_id
