"""mindbodypublicapi.

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

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


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

    Contains information about the response message detail.

    Attributes:
        status (str): Contains information about the response status.
        transaction_id (str): The unique transaction ID.
        message (str): Contains information about the response message detail.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "status": "Status",
        "transaction_id": "TransactionId",
        "message": "Message",
    }

    _optionals = [
        "status",
        "transaction_id",
        "message",
    ]

    def __init__(
        self,
        status=APIHelper.SKIP,
        transaction_id=APIHelper.SKIP,
        message=APIHelper.SKIP):
        """Initialize a ResponseDetails instance."""
        # Initialize members of the class
        if status is not APIHelper.SKIP:
            self.status = status
        if transaction_id is not APIHelper.SKIP:
            self.transaction_id = transaction_id
        if message is not APIHelper.SKIP:
            self.message = message

    @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
        status =\
            dictionary.get("Status")\
            if dictionary.get("Status")\
                else APIHelper.SKIP
        transaction_id =\
            dictionary.get("TransactionId")\
            if dictionary.get("TransactionId")\
                else APIHelper.SKIP
        message =\
            dictionary.get("Message")\
            if dictionary.get("Message")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(status,
                   transaction_id,
                   message)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _transaction_id=(
            self.transaction_id
            if hasattr(self, "transaction_id")
            else None
        )
        _message=(
            self.message
            if hasattr(self, "message")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"status={_status!r}, "
            f"transaction_id={_transaction_id!r}, "
            f"message={_message!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _transaction_id=(
            self.transaction_id
            if hasattr(self, "transaction_id")
            else None
        )
        _message=(
            self.message
            if hasattr(self, "message")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"status={_status!s}, "
            f"transaction_id={_transaction_id!s}, "
            f"message={_message!s}, "
            f")"
        )
