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

"""
swaggerpetstoreopenapi30

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from swaggerpetstoreopenapi30.api_helper import APIHelper


class PetImage(object):

    """Implementation of the 'PetImage' model.

    Attributes:
        code (int): The model property of type int.
        mtype (str): The model property of type str.
        message (str): The model property of type str.

    """

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

    _optionals = [
        'code',
        'mtype',
        'message',
    ]

    def __init__(self,
                 code=APIHelper.SKIP,
                 mtype=APIHelper.SKIP,
                 message=APIHelper.SKIP):
        """Constructor for the PetImage class"""

        # Initialize members of the class
        if code is not APIHelper.SKIP:
            self.code = code 
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype 
        if message is not APIHelper.SKIP:
            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
        code = dictionary.get("code") if dictionary.get("code") else APIHelper.SKIP
        mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP
        message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP
        # Return an object of this model
        return cls(code,
                   mtype,
                   message)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'code={(self.code if hasattr(self, "code") else None)!r}, '
                f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r}, '
                f'message={(self.message if hasattr(self, "message") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'code={(self.code if hasattr(self, "code") else None)!s}, '
                f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s}, '
                f'message={(self.message if hasattr(self, "message") else None)!s})')
