"""cellpointapi.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from cellpointapi.api_helper import APIHelper


class Room(object):
    """Implementation of the 'Room' model.

    Details of a room

    Attributes:
        id (str): Unique identifier for the room
        room_type (str): Type of room
        bed_type (str): Type of bed in the room
        description (str): Description of the room
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "id",
        "room_type": "roomType",
        "bed_type": "bedType",
        "description": "description",
    }

    def __init__(
        self,
        id=None,
        room_type=None,
        bed_type=None,
        description=None,
        additional_properties=None):
        """Initialize a Room instance."""
        # Initialize members of the class
        self.id = id
        self.room_type = room_type
        self.bed_type = bed_type
        self.description = description

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                else None
        room_type =\
            dictionary.get("roomType")\
            if dictionary.get("roomType")\
                else None
        bed_type =\
            dictionary.get("bedType")\
            if dictionary.get("bedType")\
                else None
        description =\
            dictionary.get("description")\
            if dictionary.get("description")\
                else None

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(id,
                   room_type,
                   bed_type,
                   description,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=self.id
        _room_type=self.room_type
        _bed_type=self.bed_type
        _description=self.description
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"room_type={_room_type!r}, "
            f"bed_type={_bed_type!r}, "
            f"description={_description!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=self.id
        _room_type=self.room_type
        _bed_type=self.bed_type
        _description=self.description
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"room_type={_room_type!s}, "
            f"bed_type={_bed_type!s}, "
            f"description={_description!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
