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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .invoice_adjustment_type_to_create_enum import InvoiceAdjustmentTypeToCreateEnum


@JsonMap({"type_": "type", "payment_cycle_id": "paymentCycleId"})
class InvoiceAdjustmentToCreateWithFile(BaseModel):
    """InvoiceAdjustmentToCreateWithFile

    :param contract_id: Id of a Deel contract.
    :type contract_id: str
    :param date_submitted: Short date in format ISO-8601 (YYYY-MM-DD). For example: 2022-12-31.
    :type date_submitted: str
    :param type_: Type of invoice adjustment.
    :type type_: InvoiceAdjustmentTypeToCreateEnum
    :param amount: Amount to be paid. Must be a positive number.
    :type amount: float
    :param description: Description of the adjustment.
    :type description: str
    :param payment_cycle_id: ID of an existing active payment cycle - required if type is "vat", defaults to None
    :type payment_cycle_id: float, optional
    :param file: Upload the file you want to attach to this entry., defaults to None
    :type file: str, optional
    """

    def __init__(
        self,
        contract_id: str,
        date_submitted: str,
        type_: InvoiceAdjustmentTypeToCreateEnum,
        amount: float,
        description: str,
        payment_cycle_id: float = None,
        file: str = None,
    ):
        self.contract_id = contract_id
        self.date_submitted = date_submitted
        self.type_ = self._enum_matching(
            type_, InvoiceAdjustmentTypeToCreateEnum.list(), "type_"
        )
        self.amount = amount
        self.description = description
        if payment_cycle_id is not None:
            self.payment_cycle_id = payment_cycle_id
        if file is not None:
            self.file = file
