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

from __future__ import annotations
from .utils.json_map import JsonMap
from .base import BaseModel
from .work_statement_cycle_scale_enum import WorkStatementCycleScaleEnum
from .work_statement_cycle_end_type_enum import WorkStatementCycleEndTypeEnum
from .work_statement_payment_due_type_enum import WorkStatementPaymentDueTypeEnum


@JsonMap({})
class CompensationDetailsOfContractToCreateShared(BaseModel):
    """CompensationDetailsOfContractToCreateShared

    :param amount: Amount to be paid. This field can be excluded when creating a Pay-as-you-go task-based or Milestone contracts., defaults to None
    :type amount: float, optional
    :param currency_code: currency_code
    :type currency_code: str
    :param frequency: Scale of the invoice cycle.
    :type frequency: WorkStatementCycleScaleEnum
    :param cycle_end: Date invoice cycle ends.
    :type cycle_end: float
    :param cycle_end_type: Cycle end can be weekly 1-7 (Monday = 1) or monthly 1-31.
    :type cycle_end_type: WorkStatementCycleEndTypeEnum
    :param payment_due_type: Type of payment due. If the payment is due on the last day of month, enter 'WITHIN_MONTH'.
    :type payment_due_type: WorkStatementPaymentDueTypeEnum
    :param payment_due_days: payment_due_days
    :type payment_due_days: float
    :param pay_before_weekends: If the payment due is on a weekend, pay on Friday., defaults to None
    :type pay_before_weekends: bool, optional
    :param first_payment_date: Short date in format ISO-8601 (YYYY-MM-DD). For example 2022-12-31., defaults to None
    :type first_payment_date: str, optional
    :param first_payment: First payment amount., defaults to None
    :type first_payment: float, optional
    :param notice_period: Days before to notice the termination of contract for eather party., defaults to None
    :type notice_period: float, optional
    """

    def __init__(
        self,
        currency_code: str,
        frequency: WorkStatementCycleScaleEnum,
        cycle_end: float,
        cycle_end_type: WorkStatementCycleEndTypeEnum,
        payment_due_type: WorkStatementPaymentDueTypeEnum,
        payment_due_days: float,
        amount: float = None,
        pay_before_weekends: bool = None,
        first_payment_date: str = None,
        first_payment: float = None,
        notice_period: float = None,
    ):
        if amount is not None:
            self.amount = amount
        self.currency_code = self._pattern_matching(
            currency_code, "^[A-Z]{3}$", "currency_code"
        )
        self.frequency = self._enum_matching(
            frequency, WorkStatementCycleScaleEnum.list(), "frequency"
        )
        self.cycle_end = cycle_end
        self.cycle_end_type = self._enum_matching(
            cycle_end_type, WorkStatementCycleEndTypeEnum.list(), "cycle_end_type"
        )
        self.payment_due_type = self._enum_matching(
            payment_due_type, WorkStatementPaymentDueTypeEnum.list(), "payment_due_type"
        )
        self.payment_due_days = payment_due_days
        if pay_before_weekends is not None:
            self.pay_before_weekends = pay_before_weekends
        if first_payment_date is not None:
            self.first_payment_date = self._pattern_matching(
                first_payment_date, "^\d{4}-\d{2}-\d{2}$", "first_payment_date"
            )
        if first_payment is not None:
            self.first_payment = first_payment
        if notice_period is not None:
            self.notice_period = notice_period
