"""mindbodypublicapi.

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

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


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

    A Client DTO with Suspension Informatoin

    Attributes:
        booking_suspended (bool): When 'true', indicates that the client is suspended
            from booking
        suspension_start_date (str): Indicates the Date that BookingSuspension starts
            'YYYY-MM-DD'
        suspension_end_date (str): Indicates the Date that BookingSuspension ends
            'YYYY-MM-DD'

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "booking_suspended": "BookingSuspended",
        "suspension_start_date": "SuspensionStartDate",
        "suspension_end_date": "SuspensionEndDate",
    }

    _optionals = [
        "booking_suspended",
        "suspension_start_date",
        "suspension_end_date",
    ]

    def __init__(
        self,
        booking_suspended=APIHelper.SKIP,
        suspension_start_date=APIHelper.SKIP,
        suspension_end_date=APIHelper.SKIP):
        """Initialize a ClientSuspensionInfo instance."""
        # Initialize members of the class
        if booking_suspended is not APIHelper.SKIP:
            self.booking_suspended = booking_suspended
        if suspension_start_date is not APIHelper.SKIP:
            self.suspension_start_date = suspension_start_date
        if suspension_end_date is not APIHelper.SKIP:
            self.suspension_end_date = suspension_end_date

    @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
        booking_suspended =\
            dictionary.get("BookingSuspended")\
            if "BookingSuspended" in dictionary.keys()\
                else APIHelper.SKIP
        suspension_start_date =\
            dictionary.get("SuspensionStartDate")\
            if dictionary.get("SuspensionStartDate")\
                else APIHelper.SKIP
        suspension_end_date =\
            dictionary.get("SuspensionEndDate")\
            if dictionary.get("SuspensionEndDate")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(booking_suspended,
                   suspension_start_date,
                   suspension_end_date)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _booking_suspended=(
            self.booking_suspended
            if hasattr(self, "booking_suspended")
            else None
        )
        _suspension_start_date=(
            self.suspension_start_date
            if hasattr(self, "suspension_start_date")
            else None
        )
        _suspension_end_date=(
            self.suspension_end_date
            if hasattr(self, "suspension_end_date")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"booking_suspended={_booking_suspended!r}, "
            f"suspension_start_date={_suspension_start_date!r}, "
            f"suspension_end_date={_suspension_end_date!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _booking_suspended=(
            self.booking_suspended
            if hasattr(self, "booking_suspended")
            else None
        )
        _suspension_start_date=(
            self.suspension_start_date
            if hasattr(self, "suspension_start_date")
            else None
        )
        _suspension_end_date=(
            self.suspension_end_date
            if hasattr(self, "suspension_end_date")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"booking_suspended={_booking_suspended!s}, "
            f"suspension_start_date={_suspension_start_date!s}, "
            f"suspension_end_date={_suspension_end_date!s}, "
            f")"
        )
