"""mindbodypublicapi.

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

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


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

    A Visit DTO with Waitlist Informatoin

    Attributes:
        waitlist_id (int): waitlist entry Id
        waitlist_order_number (int): order of the waitlist entry

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "waitlist_id": "WaitlistId",
        "waitlist_order_number": "WaitlistOrderNumber",
    }

    _optionals = [
        "waitlist_id",
        "waitlist_order_number",
    ]

    def __init__(
        self,
        waitlist_id=APIHelper.SKIP,
        waitlist_order_number=APIHelper.SKIP):
        """Initialize a VisitWaitlistInfo instance."""
        # Initialize members of the class
        if waitlist_id is not APIHelper.SKIP:
            self.waitlist_id = waitlist_id
        if waitlist_order_number is not APIHelper.SKIP:
            self.waitlist_order_number = waitlist_order_number

    @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
        waitlist_id =\
            dictionary.get("WaitlistId")\
            if dictionary.get("WaitlistId")\
                else APIHelper.SKIP
        waitlist_order_number =\
            dictionary.get("WaitlistOrderNumber")\
            if dictionary.get("WaitlistOrderNumber")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(waitlist_id,
                   waitlist_order_number)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _waitlist_id=(
            self.waitlist_id
            if hasattr(self, "waitlist_id")
            else None
        )
        _waitlist_order_number=(
            self.waitlist_order_number
            if hasattr(self, "waitlist_order_number")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"waitlist_id={_waitlist_id!r}, "
            f"waitlist_order_number={_waitlist_order_number!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _waitlist_id=(
            self.waitlist_id
            if hasattr(self, "waitlist_id")
            else None
        )
        _waitlist_order_number=(
            self.waitlist_order_number
            if hasattr(self, "waitlist_order_number")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"waitlist_id={_waitlist_id!s}, "
            f"waitlist_order_number={_waitlist_order_number!s}, "
            f")"
        )
