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

"""
coingeckopublicapiv3

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


class Image(object):

    """Implementation of the 'Image' model.

    coin image url

    Attributes:
        thumb (str): The model property of type str.
        small (str): The model property of type str.
        large (str): The model property of type str.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "thumb": 'thumb',
        "small": 'small',
        "large": 'large'
    }

    _optionals = [
        'thumb',
        'small',
        'large',
    ]

    def __init__(self,
                 thumb=APIHelper.SKIP,
                 small=APIHelper.SKIP,
                 large=APIHelper.SKIP):
        """Constructor for the Image class"""

        # Initialize members of the class
        if thumb is not APIHelper.SKIP:
            self.thumb = thumb 
        if small is not APIHelper.SKIP:
            self.small = small 
        if large is not APIHelper.SKIP:
            self.large = large 

    @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
        thumb = dictionary.get("thumb") if dictionary.get("thumb") else APIHelper.SKIP
        small = dictionary.get("small") if dictionary.get("small") else APIHelper.SKIP
        large = dictionary.get("large") if dictionary.get("large") else APIHelper.SKIP
        # Return an object of this model
        return cls(thumb,
                   small,
                   large)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'thumb={(self.thumb if hasattr(self, "thumb") else None)!r}, '
                f'small={(self.small if hasattr(self, "small") else None)!r}, '
                f'large={(self.large if hasattr(self, "large") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'thumb={(self.thumb if hasattr(self, "thumb") else None)!s}, '
                f'small={(self.small if hasattr(self, "small") else None)!s}, '
                f'large={(self.large if hasattr(self, "large") else None)!s})')
