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

"""
coingeckopublicapiv3

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


class Exchanges(object):

    """Implementation of the 'Exchanges' model.

    Attributes:
        id (str): exchange ID
        name (str): exchange name
        year_established (float): exchange established year
        country (str): exchange country
        description (str): exchange description
        url (str): exchange website url
        image (str): exchange image url
        has_trading_incentive (bool): exchange trading incentive
        trust_score (float): exchange trust score
        trust_score_rank (float): exchange trust score rank
        trade_volume_24_h_btc (float): exchange trade volume in BTC in 24 hours

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "name": 'name',
        "year_established": 'year_established',
        "country": 'country',
        "description": 'description',
        "url": 'url',
        "image": 'image',
        "has_trading_incentive": 'has_trading_incentive',
        "trust_score": 'trust_score',
        "trust_score_rank": 'trust_score_rank',
        "trade_volume_24_h_btc": 'trade_volume_24h_btc'
    }

    _optionals = [
        'id',
        'name',
        'year_established',
        'country',
        'description',
        'url',
        'image',
        'has_trading_incentive',
        'trust_score',
        'trust_score_rank',
        'trade_volume_24_h_btc',
    ]

    def __init__(self,
                 id=APIHelper.SKIP,
                 name=APIHelper.SKIP,
                 year_established=APIHelper.SKIP,
                 country=APIHelper.SKIP,
                 description=APIHelper.SKIP,
                 url=APIHelper.SKIP,
                 image=APIHelper.SKIP,
                 has_trading_incentive=APIHelper.SKIP,
                 trust_score=APIHelper.SKIP,
                 trust_score_rank=APIHelper.SKIP,
                 trade_volume_24_h_btc=APIHelper.SKIP):
        """Constructor for the Exchanges class"""

        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id 
        if name is not APIHelper.SKIP:
            self.name = name 
        if year_established is not APIHelper.SKIP:
            self.year_established = year_established 
        if country is not APIHelper.SKIP:
            self.country = country 
        if description is not APIHelper.SKIP:
            self.description = description 
        if url is not APIHelper.SKIP:
            self.url = url 
        if image is not APIHelper.SKIP:
            self.image = image 
        if has_trading_incentive is not APIHelper.SKIP:
            self.has_trading_incentive = has_trading_incentive 
        if trust_score is not APIHelper.SKIP:
            self.trust_score = trust_score 
        if trust_score_rank is not APIHelper.SKIP:
            self.trust_score_rank = trust_score_rank 
        if trade_volume_24_h_btc is not APIHelper.SKIP:
            self.trade_volume_24_h_btc = trade_volume_24_h_btc 

    @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
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP
        year_established = dictionary.get("year_established") if dictionary.get("year_established") else APIHelper.SKIP
        country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP
        description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP
        url = dictionary.get("url") if dictionary.get("url") else APIHelper.SKIP
        image = dictionary.get("image") if dictionary.get("image") else APIHelper.SKIP
        has_trading_incentive = dictionary.get("has_trading_incentive") if "has_trading_incentive" in dictionary.keys() else APIHelper.SKIP
        trust_score = dictionary.get("trust_score") if dictionary.get("trust_score") else APIHelper.SKIP
        trust_score_rank = dictionary.get("trust_score_rank") if dictionary.get("trust_score_rank") else APIHelper.SKIP
        trade_volume_24_h_btc = dictionary.get("trade_volume_24h_btc") if dictionary.get("trade_volume_24h_btc") else APIHelper.SKIP
        # Return an object of this model
        return cls(id,
                   name,
                   year_established,
                   country,
                   description,
                   url,
                   image,
                   has_trading_incentive,
                   trust_score,
                   trust_score_rank,
                   trade_volume_24_h_btc)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'id={(self.id if hasattr(self, "id") else None)!r}, '
                f'name={(self.name if hasattr(self, "name") else None)!r}, '
                f'year_established={(self.year_established if hasattr(self, "year_established") else None)!r}, '
                f'country={(self.country if hasattr(self, "country") else None)!r}, '
                f'description={(self.description if hasattr(self, "description") else None)!r}, '
                f'url={(self.url if hasattr(self, "url") else None)!r}, '
                f'image={(self.image if hasattr(self, "image") else None)!r}, '
                f'has_trading_incentive={(self.has_trading_incentive if hasattr(self, "has_trading_incentive") else None)!r}, '
                f'trust_score={(self.trust_score if hasattr(self, "trust_score") else None)!r}, '
                f'trust_score_rank={(self.trust_score_rank if hasattr(self, "trust_score_rank") else None)!r}, '
                f'trade_volume_24_h_btc={(self.trade_volume_24_h_btc if hasattr(self, "trade_volume_24_h_btc") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'id={(self.id if hasattr(self, "id") else None)!s}, '
                f'name={(self.name if hasattr(self, "name") else None)!s}, '
                f'year_established={(self.year_established if hasattr(self, "year_established") else None)!s}, '
                f'country={(self.country if hasattr(self, "country") else None)!s}, '
                f'description={(self.description if hasattr(self, "description") else None)!s}, '
                f'url={(self.url if hasattr(self, "url") else None)!s}, '
                f'image={(self.image if hasattr(self, "image") else None)!s}, '
                f'has_trading_incentive={(self.has_trading_incentive if hasattr(self, "has_trading_incentive") else None)!s}, '
                f'trust_score={(self.trust_score if hasattr(self, "trust_score") else None)!s}, '
                f'trust_score_rank={(self.trust_score_rank if hasattr(self, "trust_score_rank") else None)!s}, '
                f'trade_volume_24_h_btc={(self.trade_volume_24_h_btc if hasattr(self, "trade_volume_24_h_btc") else None)!s})')
