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

from enum import Enum
from .utils.json_map import JsonMap
from .base import BaseModel


class Mode(Enum):
    """An enumeration representing different categories.

    :cvar CALCULATED_AMOUNT: "CALCULATED_AMOUNT"
    :vartype CALCULATED_AMOUNT: str
    :cvar INCALCULABLE: "INCALCULABLE"
    :vartype INCALCULABLE: str
    :cvar PERCENTAGE: "PERCENTAGE"
    :vartype PERCENTAGE: str
    :cvar PER_NIGHT: "PER_NIGHT"
    :vartype PER_NIGHT: str
    :cvar PER_PERSON_PER_NIGHT: "PER_PERSON_PER_NIGHT"
    :vartype PER_PERSON_PER_NIGHT: str
    :cvar PER_PERSON_PER_STAY: "PER_PERSON_PER_STAY"
    :vartype PER_PERSON_PER_STAY: str
    :cvar PER_STAY: "PER_STAY"
    :vartype PER_STAY: str
    """

    CALCULATED_AMOUNT = "CALCULATED_AMOUNT"
    INCALCULABLE = "INCALCULABLE"
    PERCENTAGE = "PERCENTAGE"
    PER_NIGHT = "PER_NIGHT"
    PER_PERSON_PER_NIGHT = "PER_PERSON_PER_NIGHT"
    PER_PERSON_PER_STAY = "PER_PERSON_PER_STAY"
    PER_STAY = "PER_STAY"

    def list():
        """Lists all category values.

        :return: A list of all category values.
        :rtype: list
        """
        return list(map(lambda x: x.value, Mode._member_map_.values()))


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

    :param charge: charge, defaults to None
    :type charge: int, optional
    :param condition: condition, defaults to None
    :type condition: int, optional
    :param mode: mode, defaults to None
    :type mode: Mode, optional
    :param percentage: percentage, defaults to None
    :type percentage: float, optional
    :param total_amount: total_amount, defaults to None
    :type total_amount: float, optional
    :param unit_amount: unit_amount, defaults to None
    :type unit_amount: float, optional
    """

    def __init__(
        self,
        charge: int = None,
        condition: int = None,
        mode: Mode = None,
        percentage: float = None,
        total_amount: float = None,
        unit_amount: float = None,
    ):
        if charge is not None:
            self.charge = charge
        if condition is not None:
            self.condition = condition
        if mode is not None:
            self.mode = self._enum_matching(mode, Mode.list(), "mode")
        if percentage is not None:
            self.percentage = percentage
        if total_amount is not None:
            self.total_amount = total_amount
        if unit_amount is not None:
            self.unit_amount = unit_amount
