"""mindbodypublicapi.

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

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


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

    Attributes:
        class_id (int): Class ID to lookup.
        hide_cancel (bool): When `true`, indicates that this class is hidden when
            cancelled.  When `false`, indicates that this class is not hidden when
            cancelled.
        send_client_email (bool): When `true`, sends the client an automatic email
            about the cancellation, if the client has opted to receive email.
        send_staff_email (bool): When `true`, sends the staff an automatic email
            about the cancellation, if the staff has opted to receive email.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "class_id": "ClassID",
        "hide_cancel": "HideCancel",
        "send_client_email": "SendClientEmail",
        "send_staff_email": "SendStaffEmail",
    }

    _optionals = [
        "class_id",
        "hide_cancel",
        "send_client_email",
        "send_staff_email",
    ]

    def __init__(
        self,
        class_id=APIHelper.SKIP,
        hide_cancel=APIHelper.SKIP,
        send_client_email=APIHelper.SKIP,
        send_staff_email=APIHelper.SKIP):
        """Initialize a CancelSingleClassRequest instance."""
        # Initialize members of the class
        if class_id is not APIHelper.SKIP:
            self.class_id = class_id
        if hide_cancel is not APIHelper.SKIP:
            self.hide_cancel = hide_cancel
        if send_client_email is not APIHelper.SKIP:
            self.send_client_email = send_client_email
        if send_staff_email is not APIHelper.SKIP:
            self.send_staff_email = send_staff_email

    @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
        class_id =\
            dictionary.get("ClassID")\
            if dictionary.get("ClassID")\
                else APIHelper.SKIP
        hide_cancel =\
            dictionary.get("HideCancel")\
            if "HideCancel" in dictionary.keys()\
                else APIHelper.SKIP
        send_client_email =\
            dictionary.get("SendClientEmail")\
            if "SendClientEmail" in dictionary.keys()\
                else APIHelper.SKIP
        send_staff_email =\
            dictionary.get("SendStaffEmail")\
            if "SendStaffEmail" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(class_id,
                   hide_cancel,
                   send_client_email,
                   send_staff_email)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _hide_cancel=(
            self.hide_cancel
            if hasattr(self, "hide_cancel")
            else None
        )
        _send_client_email=(
            self.send_client_email
            if hasattr(self, "send_client_email")
            else None
        )
        _send_staff_email=(
            self.send_staff_email
            if hasattr(self, "send_staff_email")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!r}, "
            f"hide_cancel={_hide_cancel!r}, "
            f"send_client_email={_send_client_email!r}, "
            f"send_staff_email={_send_staff_email!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _hide_cancel=(
            self.hide_cancel
            if hasattr(self, "hide_cancel")
            else None
        )
        _send_client_email=(
            self.send_client_email
            if hasattr(self, "send_client_email")
            else None
        )
        _send_staff_email=(
            self.send_staff_email
            if hasattr(self, "send_staff_email")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!s}, "
            f"hide_cancel={_hide_cancel!s}, "
            f"send_client_email={_send_client_email!s}, "
            f"send_staff_email={_send_staff_email!s}, "
            f")"
        )
