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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .adjustment_status_enum import AdjustmentStatusEnum


@JsonMap({"id_": "id", "file_type": "fileType"})
class File(BaseModel):
    """File

    :param id_: The unique identifier of the file, defaults to None
    :type id_: str, optional
    :param name: The name of the file, defaults to None
    :type name: str, optional
    :param file_type: The type of the file, defaults to None
    :type file_type: str, optional
    """

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


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

    :param id_: The unique identifier of the adjustment, defaults to None
    :type id_: str, optional
    :param contract_id: The identifier of the contract associated with the adjustment, defaults to None
    :type contract_id: str, optional
    :param amount: The amount of the adjustment, defaults to None
    :type amount: str, optional
    :param date_of_adjustment: The date of the adjustment, defaults to None
    :type date_of_adjustment: str, optional
    :param title: The title of the adjustment, defaults to None
    :type title: str, optional
    :param description: The description of the adjustment, defaults to None
    :type description: str, optional
    :param cycle_reference: The reference to the cycle associated with the adjustment, defaults to None
    :type cycle_reference: str, optional
    :param status: Adjustment status, defaults to None
    :type status: AdjustmentStatusEnum, optional
    :param adjustment_category_id: The identifier of the adjustment category associated with the adjustment, defaults to None
    :type adjustment_category_id: str, optional
    :param actual_start_cycle_date: The date of the actual start cycle date, defaults to None
    :type actual_start_cycle_date: str, optional
    :param actual_end_cycle_date: The date of the actual end cycle date, defaults to None
    :type actual_end_cycle_date: str, optional
    :param move_next_cycle: If an adjustments can belong to another payroll cycle, defaults to None
    :type move_next_cycle: bool, optional
    :param file: file, defaults to None
    :type file: File, optional
    :param created_at: The date and time when the adjustment was created, defaults to None
    :type created_at: str, optional
    :param updated_at: The date and time when the adjustment was last updated, defaults to None
    :type updated_at: str, optional
    """

    def __init__(
        self,
        id_: str = None,
        contract_id: str = None,
        amount: str = None,
        date_of_adjustment: str = None,
        title: str = None,
        description: str = None,
        cycle_reference: str = None,
        status: AdjustmentStatusEnum = None,
        adjustment_category_id: str = None,
        actual_start_cycle_date: str = None,
        actual_end_cycle_date: str = None,
        move_next_cycle: bool = None,
        file: File = None,
        created_at: str = None,
        updated_at: str = None,
    ):
        if id_ is not None:
            self.id_ = id_
        if contract_id is not None:
            self.contract_id = contract_id
        if amount is not None:
            self.amount = amount
        if date_of_adjustment is not None:
            self.date_of_adjustment = date_of_adjustment
        if title is not None:
            self.title = title
        if description is not None:
            self.description = description
        if cycle_reference is not None:
            self.cycle_reference = cycle_reference
        if status is not None:
            self.status = self._enum_matching(
                status, AdjustmentStatusEnum.list(), "status"
            )
        if adjustment_category_id is not None:
            self.adjustment_category_id = adjustment_category_id
        if actual_start_cycle_date is not None:
            self.actual_start_cycle_date = actual_start_cycle_date
        if actual_end_cycle_date is not None:
            self.actual_end_cycle_date = actual_end_cycle_date
        if move_next_cycle is not None:
            self.move_next_cycle = move_next_cycle
        if file is not None:
            self.file = self._define_object(file, File)
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
