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

"""
coingeckopublicapiv3

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


class Explorer(object):

    """Implementation of the 'Explorer' model.

    Attributes:
        name (str): The model property of type str.
        link (str): The model property of type str.

    """

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

    _optionals = [
        'name',
        'link',
    ]

    def __init__(self,
                 name=APIHelper.SKIP,
                 link=APIHelper.SKIP):
        """Constructor for the Explorer class"""

        # Initialize members of the class
        if name is not APIHelper.SKIP:
            self.name = name 
        if link is not APIHelper.SKIP:
            self.link = link 

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

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

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