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

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


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

    :cvar ESTIMATED_BY_ACCOMMODATION: "ESTIMATED_BY_ACCOMMODATION"
    :vartype ESTIMATED_BY_ACCOMMODATION: str
    :cvar ESTIMATED_BY_BOOKING: "ESTIMATED_BY_BOOKING"
    :vartype ESTIMATED_BY_BOOKING: str
    :cvar OFFICIAL: "OFFICIAL"
    :vartype OFFICIAL: str
    """

    ESTIMATED_BY_ACCOMMODATION = "ESTIMATED_BY_ACCOMMODATION"
    ESTIMATED_BY_BOOKING = "ESTIMATED_BY_BOOKING"
    OFFICIAL = "OFFICIAL"

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

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


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

    :param number_of_reviews: Number of validated reviews for this accommodation., defaults to None
    :type number_of_reviews: int, optional
    :param preferred: Boolean value is "true" if this accommodation is in the Booking.com's preferred program and "false" otherwise., defaults to None
    :type preferred: bool, optional
    :param review_score: A decimal number indicating the current review score of this accommodation property, in the range 1..10., defaults to None
    :type review_score: float, optional
    :param stars: Number of stars of this accommodation property., defaults to None
    :type stars: float, optional
    :param stars_type: An enumerated value describing which type of stars this accommodation has., defaults to None
    :type stars_type: StarsType, optional
    """

    def __init__(
        self,
        number_of_reviews: int = None,
        preferred: bool = None,
        review_score: float = None,
        stars: float = None,
        stars_type: StarsType = None,
    ):
        if number_of_reviews is not None:
            self.number_of_reviews = number_of_reviews
        if preferred is not None:
            self.preferred = preferred
        if review_score is not None:
            self.review_score = review_score
        if stars is not None:
            self.stars = stars
        if stars_type is not None:
            self.stars_type = self._enum_matching(
                stars_type, StarsType.list(), "stars_type"
            )
