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

"""
coingeckopublicapiv3

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


class Market1(object):

    """Implementation of the 'Market1' model.

    coin ticker exchange

    Attributes:
        name (str): exchange name
        identifier (str): exchange identifier
        has_trading_incentive (bool): exchange trading incentive
        logo (str): exchange image url

    """

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

    _optionals = [
        'logo',
    ]

    def __init__(self,
                 name=None,
                 identifier=None,
                 has_trading_incentive=None,
                 logo=APIHelper.SKIP):
        """Constructor for the Market1 class"""

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

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

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

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