# -*- coding: utf-8 -*-

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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


class ErrorObject(object):

    """Implementation of the 'ErrorObject' model.

    Attributes:
        status (int): The HTTP status code (also returned in the response
            header; see [Response Status
            Codes](/documentation/web-api/concepts/api-calls#response-status-co
            des) for more information).
        message (str): A short description of the cause of the error.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "status": 'status',
        "message": 'message'
    }

    def __init__(self,
                 status=None,
                 message=None):
        """Constructor for the ErrorObject class"""

        # Initialize members of the class
        self.status = status 
        self.message = message 

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates 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 None
        message = dictionary.get("message") if dictionary.get("message") else None
        # Return an object of this model
        return cls(status,
                   message)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'status={self.status!r}, '
                f'message={self.message!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'status={self.status!s}, '
                f'message={self.message!s})')
