"""mindbodypublicapi.

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

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


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

    Contains information about the spot details.

    Attributes:
        reserved_spot_numbers (List[int]): Contains information about the collection
            of reserved spot numbers.
        available_spot_numbers (List[int]): Contains information about the collection
            of available spot numbers.
        unavailable_spot_numbers (List[int]): Contains information about the
            collection of Unavailable spot numbers.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "reserved_spot_numbers": "ReservedSpotNumbers",
        "available_spot_numbers": "AvailableSpotNumbers",
        "unavailable_spot_numbers": "UnavailableSpotNumbers",
    }

    _optionals = [
        "reserved_spot_numbers",
        "available_spot_numbers",
        "unavailable_spot_numbers",
    ]

    def __init__(
        self,
        reserved_spot_numbers=APIHelper.SKIP,
        available_spot_numbers=APIHelper.SKIP,
        unavailable_spot_numbers=APIHelper.SKIP):
        """Initialize a Spot instance."""
        # Initialize members of the class
        if reserved_spot_numbers is not APIHelper.SKIP:
            self.reserved_spot_numbers = reserved_spot_numbers
        if available_spot_numbers is not APIHelper.SKIP:
            self.available_spot_numbers = available_spot_numbers
        if unavailable_spot_numbers is not APIHelper.SKIP:
            self.unavailable_spot_numbers = unavailable_spot_numbers

    @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
        reserved_spot_numbers =\
            dictionary.get("ReservedSpotNumbers")\
            if dictionary.get("ReservedSpotNumbers")\
                else APIHelper.SKIP
        available_spot_numbers =\
            dictionary.get("AvailableSpotNumbers")\
            if dictionary.get("AvailableSpotNumbers")\
                else APIHelper.SKIP
        unavailable_spot_numbers =\
            dictionary.get("UnavailableSpotNumbers")\
            if dictionary.get("UnavailableSpotNumbers")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(reserved_spot_numbers,
                   available_spot_numbers,
                   unavailable_spot_numbers)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _reserved_spot_numbers=(
            self.reserved_spot_numbers
            if hasattr(self, "reserved_spot_numbers")
            else None
        )
        _available_spot_numbers=(
            self.available_spot_numbers
            if hasattr(self, "available_spot_numbers")
            else None
        )
        _unavailable_spot_numbers=(
            self.unavailable_spot_numbers
            if hasattr(self, "unavailable_spot_numbers")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"reserved_spot_numbers={_reserved_spot_numbers!r}, "
            f"available_spot_numbers={_available_spot_numbers!r}, "
            f"unavailable_spot_numbers={_unavailable_spot_numbers!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _reserved_spot_numbers=(
            self.reserved_spot_numbers
            if hasattr(self, "reserved_spot_numbers")
            else None
        )
        _available_spot_numbers=(
            self.available_spot_numbers
            if hasattr(self, "available_spot_numbers")
            else None
        )
        _unavailable_spot_numbers=(
            self.unavailable_spot_numbers
            if hasattr(self, "unavailable_spot_numbers")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"reserved_spot_numbers={_reserved_spot_numbers!s}, "
            f"available_spot_numbers={_available_spot_numbers!s}, "
            f"unavailable_spot_numbers={_unavailable_spot_numbers!s}, "
            f")"
        )
