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

"""
coingeckopublicapiv3

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


class Coin1(object):

    """Implementation of the 'Coin1' model.

    Attributes:
        id (str): coin ID
        coin_id (float): The model property of type float.
        name (str): coin name
        symbol (str): coin symbol
        market_cap_rank (float): coin market cap rank
        thumb (str): coin thumb image url
        small (str): coin small image url
        large (str): coin large image url
        slug (str): coin web slug
        price_btc (float): coin price in btc
        score (float): coin sequence in the list
        data (Data): The model property of type Data.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "coin_id": 'coin_id',
        "name": 'name',
        "symbol": 'symbol',
        "market_cap_rank": 'market_cap_rank',
        "thumb": 'thumb',
        "small": 'small',
        "large": 'large',
        "slug": 'slug',
        "price_btc": 'price_btc',
        "score": 'score',
        "data": 'data'
    }

    _optionals = [
        'id',
        'coin_id',
        'name',
        'symbol',
        'market_cap_rank',
        'thumb',
        'small',
        'large',
        'slug',
        'price_btc',
        'score',
        'data',
    ]

    def __init__(self,
                 id=APIHelper.SKIP,
                 coin_id=APIHelper.SKIP,
                 name=APIHelper.SKIP,
                 symbol=APIHelper.SKIP,
                 market_cap_rank=APIHelper.SKIP,
                 thumb=APIHelper.SKIP,
                 small=APIHelper.SKIP,
                 large=APIHelper.SKIP,
                 slug=APIHelper.SKIP,
                 price_btc=APIHelper.SKIP,
                 score=APIHelper.SKIP,
                 data=APIHelper.SKIP):
        """Constructor for the Coin1 class"""

        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id 
        if coin_id is not APIHelper.SKIP:
            self.coin_id = coin_id 
        if name is not APIHelper.SKIP:
            self.name = name 
        if symbol is not APIHelper.SKIP:
            self.symbol = symbol 
        if market_cap_rank is not APIHelper.SKIP:
            self.market_cap_rank = market_cap_rank 
        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 
        if slug is not APIHelper.SKIP:
            self.slug = slug 
        if price_btc is not APIHelper.SKIP:
            self.price_btc = price_btc 
        if score is not APIHelper.SKIP:
            self.score = score 
        if data is not APIHelper.SKIP:
            self.data = data 

    @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
        coin_id = dictionary.get("coin_id") if dictionary.get("coin_id") else APIHelper.SKIP
        name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP
        symbol = dictionary.get("symbol") if dictionary.get("symbol") else APIHelper.SKIP
        market_cap_rank = dictionary.get("market_cap_rank") if dictionary.get("market_cap_rank") else APIHelper.SKIP
        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
        slug = dictionary.get("slug") if dictionary.get("slug") else APIHelper.SKIP
        price_btc = dictionary.get("price_btc") if dictionary.get("price_btc") else APIHelper.SKIP
        score = dictionary.get("score") if dictionary.get("score") else APIHelper.SKIP
        data = Data.from_dictionary(dictionary.get('data')) if 'data' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(id,
                   coin_id,
                   name,
                   symbol,
                   market_cap_rank,
                   thumb,
                   small,
                   large,
                   slug,
                   price_btc,
                   score,
                   data)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'id={(self.id if hasattr(self, "id") else None)!r}, '
                f'coin_id={(self.coin_id if hasattr(self, "coin_id") else None)!r}, '
                f'name={(self.name if hasattr(self, "name") else None)!r}, '
                f'symbol={(self.symbol if hasattr(self, "symbol") else None)!r}, '
                f'market_cap_rank={(self.market_cap_rank if hasattr(self, "market_cap_rank") else None)!r}, '
                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}, '
                f'slug={(self.slug if hasattr(self, "slug") else None)!r}, '
                f'price_btc={(self.price_btc if hasattr(self, "price_btc") else None)!r}, '
                f'score={(self.score if hasattr(self, "score") else None)!r}, '
                f'data={(self.data if hasattr(self, "data") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'id={(self.id if hasattr(self, "id") else None)!s}, '
                f'coin_id={(self.coin_id if hasattr(self, "coin_id") else None)!s}, '
                f'name={(self.name if hasattr(self, "name") else None)!s}, '
                f'symbol={(self.symbol if hasattr(self, "symbol") else None)!s}, '
                f'market_cap_rank={(self.market_cap_rank if hasattr(self, "market_cap_rank") else None)!s}, '
                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}, '
                f'slug={(self.slug if hasattr(self, "slug") else None)!s}, '
                f'price_btc={(self.price_btc if hasattr(self, "price_btc") else None)!s}, '
                f'score={(self.score if hasattr(self, "score") else None)!s}, '
                f'data={(self.data if hasattr(self, "data") else None)!s})')
