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

"""
coingeckopublicapiv3

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


class CoinsMarkets(object):

    """Implementation of the 'CoinsMarkets' model.

    Attributes:
        id (str): coin ID
        symbol (str): coin symbol
        name (str): coin name
        image (str): coin image url
        current_price (float): coin current price in currency
        market_cap (float): coin market cap in currency
        market_cap_rank (float): coin rank by market cap
        fully_diluted_valuation (float): coin fully diluted valuation (fdv) in
            currency
        total_volume (float): coin total trading volume in currency
        high_24_h (float): coin 24hr price high in currency
        low_24_h (float): coin 24hr price low in currency
        price_change_24_h (float): coin 24hr price change in currency
        price_change_percentage_24_h (float): coin 24hr price change in
            percentage
        market_cap_change_24_h (float): coin 24hr market cap change in currency
        market_cap_change_percentage_24_h (float): coin 24hr market cap change
            in percentage
        circulating_supply (float): coin circulating supply
        total_supply (float): coin total supply
        max_supply (float): coin max supply
        ath (float): coin all time high (ATH) in currency
        ath_change_percentage (float): coin all time high (ATH) change in
            percentage
        ath_date (datetime): coin all time high (ATH) date
        atl (float): coin all time low (atl) in currency
        atl_change_percentage (float): coin all time low (atl) change in
            percentage
        atl_date (datetime): coin all time low (atl) date
        roi (str): The model property of type str.
        last_updated (datetime): coin last updated timestamp

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "symbol": 'symbol',
        "name": 'name',
        "image": 'image',
        "current_price": 'current_price',
        "market_cap": 'market_cap',
        "market_cap_rank": 'market_cap_rank',
        "fully_diluted_valuation": 'fully_diluted_valuation',
        "total_volume": 'total_volume',
        "high_24_h": 'high_24h',
        "low_24_h": 'low_24h',
        "price_change_24_h": 'price_change_24h',
        "price_change_percentage_24_h": 'price_change_percentage_24h',
        "market_cap_change_24_h": 'market_cap_change_24h',
        "market_cap_change_percentage_24_h": 'market_cap_change_percentage_24h',
        "circulating_supply": 'circulating_supply',
        "total_supply": 'total_supply',
        "max_supply": 'max_supply',
        "ath": 'ath',
        "ath_change_percentage": 'ath_change_percentage',
        "ath_date": 'ath_date',
        "atl": 'atl',
        "atl_change_percentage": 'atl_change_percentage',
        "atl_date": 'atl_date',
        "roi": 'roi',
        "last_updated": 'last_updated'
    }

    _optionals = [
        'id',
        'symbol',
        'name',
        'image',
        'current_price',
        'market_cap',
        'market_cap_rank',
        'fully_diluted_valuation',
        'total_volume',
        'high_24_h',
        'low_24_h',
        'price_change_24_h',
        'price_change_percentage_24_h',
        'market_cap_change_24_h',
        'market_cap_change_percentage_24_h',
        'circulating_supply',
        'total_supply',
        'max_supply',
        'ath',
        'ath_change_percentage',
        'ath_date',
        'atl',
        'atl_change_percentage',
        'atl_date',
        'roi',
        'last_updated',
    ]

    def __init__(self,
                 id=APIHelper.SKIP,
                 symbol=APIHelper.SKIP,
                 name=APIHelper.SKIP,
                 image=APIHelper.SKIP,
                 current_price=APIHelper.SKIP,
                 market_cap=APIHelper.SKIP,
                 market_cap_rank=APIHelper.SKIP,
                 fully_diluted_valuation=APIHelper.SKIP,
                 total_volume=APIHelper.SKIP,
                 high_24_h=APIHelper.SKIP,
                 low_24_h=APIHelper.SKIP,
                 price_change_24_h=APIHelper.SKIP,
                 price_change_percentage_24_h=APIHelper.SKIP,
                 market_cap_change_24_h=APIHelper.SKIP,
                 market_cap_change_percentage_24_h=APIHelper.SKIP,
                 circulating_supply=APIHelper.SKIP,
                 total_supply=APIHelper.SKIP,
                 max_supply=APIHelper.SKIP,
                 ath=APIHelper.SKIP,
                 ath_change_percentage=APIHelper.SKIP,
                 ath_date=APIHelper.SKIP,
                 atl=APIHelper.SKIP,
                 atl_change_percentage=APIHelper.SKIP,
                 atl_date=APIHelper.SKIP,
                 roi=APIHelper.SKIP,
                 last_updated=APIHelper.SKIP):
        """Constructor for the CoinsMarkets class"""

        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id 
        if symbol is not APIHelper.SKIP:
            self.symbol = symbol 
        if name is not APIHelper.SKIP:
            self.name = name 
        if image is not APIHelper.SKIP:
            self.image = image 
        if current_price is not APIHelper.SKIP:
            self.current_price = current_price 
        if market_cap is not APIHelper.SKIP:
            self.market_cap = market_cap 
        if market_cap_rank is not APIHelper.SKIP:
            self.market_cap_rank = market_cap_rank 
        if fully_diluted_valuation is not APIHelper.SKIP:
            self.fully_diluted_valuation = fully_diluted_valuation 
        if total_volume is not APIHelper.SKIP:
            self.total_volume = total_volume 
        if high_24_h is not APIHelper.SKIP:
            self.high_24_h = high_24_h 
        if low_24_h is not APIHelper.SKIP:
            self.low_24_h = low_24_h 
        if price_change_24_h is not APIHelper.SKIP:
            self.price_change_24_h = price_change_24_h 
        if price_change_percentage_24_h is not APIHelper.SKIP:
            self.price_change_percentage_24_h = price_change_percentage_24_h 
        if market_cap_change_24_h is not APIHelper.SKIP:
            self.market_cap_change_24_h = market_cap_change_24_h 
        if market_cap_change_percentage_24_h is not APIHelper.SKIP:
            self.market_cap_change_percentage_24_h = market_cap_change_percentage_24_h 
        if circulating_supply is not APIHelper.SKIP:
            self.circulating_supply = circulating_supply 
        if total_supply is not APIHelper.SKIP:
            self.total_supply = total_supply 
        if max_supply is not APIHelper.SKIP:
            self.max_supply = max_supply 
        if ath is not APIHelper.SKIP:
            self.ath = ath 
        if ath_change_percentage is not APIHelper.SKIP:
            self.ath_change_percentage = ath_change_percentage 
        if ath_date is not APIHelper.SKIP:
            self.ath_date = APIHelper.apply_datetime_converter(ath_date, APIHelper.RFC3339DateTime) if ath_date else None 
        if atl is not APIHelper.SKIP:
            self.atl = atl 
        if atl_change_percentage is not APIHelper.SKIP:
            self.atl_change_percentage = atl_change_percentage 
        if atl_date is not APIHelper.SKIP:
            self.atl_date = APIHelper.apply_datetime_converter(atl_date, APIHelper.RFC3339DateTime) if atl_date else None 
        if roi is not APIHelper.SKIP:
            self.roi = roi 
        if last_updated is not APIHelper.SKIP:
            self.last_updated = APIHelper.apply_datetime_converter(last_updated, APIHelper.RFC3339DateTime) if last_updated else None 

    @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
        symbol = dictionary.get("symbol") if dictionary.get("symbol") else APIHelper.SKIP
        name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP
        image = dictionary.get("image") if dictionary.get("image") else APIHelper.SKIP
        current_price = dictionary.get("current_price") if dictionary.get("current_price") else APIHelper.SKIP
        market_cap = dictionary.get("market_cap") if dictionary.get("market_cap") else APIHelper.SKIP
        market_cap_rank = dictionary.get("market_cap_rank") if dictionary.get("market_cap_rank") else APIHelper.SKIP
        fully_diluted_valuation = dictionary.get("fully_diluted_valuation") if dictionary.get("fully_diluted_valuation") else APIHelper.SKIP
        total_volume = dictionary.get("total_volume") if dictionary.get("total_volume") else APIHelper.SKIP
        high_24_h = dictionary.get("high_24h") if dictionary.get("high_24h") else APIHelper.SKIP
        low_24_h = dictionary.get("low_24h") if dictionary.get("low_24h") else APIHelper.SKIP
        price_change_24_h = dictionary.get("price_change_24h") if dictionary.get("price_change_24h") else APIHelper.SKIP
        price_change_percentage_24_h = dictionary.get("price_change_percentage_24h") if dictionary.get("price_change_percentage_24h") else APIHelper.SKIP
        market_cap_change_24_h = dictionary.get("market_cap_change_24h") if dictionary.get("market_cap_change_24h") else APIHelper.SKIP
        market_cap_change_percentage_24_h = dictionary.get("market_cap_change_percentage_24h") if dictionary.get("market_cap_change_percentage_24h") else APIHelper.SKIP
        circulating_supply = dictionary.get("circulating_supply") if dictionary.get("circulating_supply") else APIHelper.SKIP
        total_supply = dictionary.get("total_supply") if dictionary.get("total_supply") else APIHelper.SKIP
        max_supply = dictionary.get("max_supply") if dictionary.get("max_supply") else APIHelper.SKIP
        ath = dictionary.get("ath") if dictionary.get("ath") else APIHelper.SKIP
        ath_change_percentage = dictionary.get("ath_change_percentage") if dictionary.get("ath_change_percentage") else APIHelper.SKIP
        ath_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("ath_date")).datetime if dictionary.get("ath_date") else APIHelper.SKIP
        atl = dictionary.get("atl") if dictionary.get("atl") else APIHelper.SKIP
        atl_change_percentage = dictionary.get("atl_change_percentage") if dictionary.get("atl_change_percentage") else APIHelper.SKIP
        atl_date = APIHelper.RFC3339DateTime.from_value(dictionary.get("atl_date")).datetime if dictionary.get("atl_date") else APIHelper.SKIP
        roi = dictionary.get("roi") if dictionary.get("roi") else APIHelper.SKIP
        last_updated = APIHelper.RFC3339DateTime.from_value(dictionary.get("last_updated")).datetime if dictionary.get("last_updated") else APIHelper.SKIP
        # Return an object of this model
        return cls(id,
                   symbol,
                   name,
                   image,
                   current_price,
                   market_cap,
                   market_cap_rank,
                   fully_diluted_valuation,
                   total_volume,
                   high_24_h,
                   low_24_h,
                   price_change_24_h,
                   price_change_percentage_24_h,
                   market_cap_change_24_h,
                   market_cap_change_percentage_24_h,
                   circulating_supply,
                   total_supply,
                   max_supply,
                   ath,
                   ath_change_percentage,
                   ath_date,
                   atl,
                   atl_change_percentage,
                   atl_date,
                   roi,
                   last_updated)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'id={(self.id if hasattr(self, "id") else None)!r}, '
                f'symbol={(self.symbol if hasattr(self, "symbol") else None)!r}, '
                f'name={(self.name if hasattr(self, "name") else None)!r}, '
                f'image={(self.image if hasattr(self, "image") else None)!r}, '
                f'current_price={(self.current_price if hasattr(self, "current_price") else None)!r}, '
                f'market_cap={(self.market_cap if hasattr(self, "market_cap") else None)!r}, '
                f'market_cap_rank={(self.market_cap_rank if hasattr(self, "market_cap_rank") else None)!r}, '
                f'fully_diluted_valuation={(self.fully_diluted_valuation if hasattr(self, "fully_diluted_valuation") else None)!r}, '
                f'total_volume={(self.total_volume if hasattr(self, "total_volume") else None)!r}, '
                f'high_24_h={(self.high_24_h if hasattr(self, "high_24_h") else None)!r}, '
                f'low_24_h={(self.low_24_h if hasattr(self, "low_24_h") else None)!r}, '
                f'price_change_24_h={(self.price_change_24_h if hasattr(self, "price_change_24_h") else None)!r}, '
                f'price_change_percentage_24_h={(self.price_change_percentage_24_h if hasattr(self, "price_change_percentage_24_h") else None)!r}, '
                f'market_cap_change_24_h={(self.market_cap_change_24_h if hasattr(self, "market_cap_change_24_h") else None)!r}, '
                f'market_cap_change_percentage_24_h={(self.market_cap_change_percentage_24_h if hasattr(self, "market_cap_change_percentage_24_h") else None)!r}, '
                f'circulating_supply={(self.circulating_supply if hasattr(self, "circulating_supply") else None)!r}, '
                f'total_supply={(self.total_supply if hasattr(self, "total_supply") else None)!r}, '
                f'max_supply={(self.max_supply if hasattr(self, "max_supply") else None)!r}, '
                f'ath={(self.ath if hasattr(self, "ath") else None)!r}, '
                f'ath_change_percentage={(self.ath_change_percentage if hasattr(self, "ath_change_percentage") else None)!r}, '
                f'ath_date={(self.ath_date if hasattr(self, "ath_date") else None)!r}, '
                f'atl={(self.atl if hasattr(self, "atl") else None)!r}, '
                f'atl_change_percentage={(self.atl_change_percentage if hasattr(self, "atl_change_percentage") else None)!r}, '
                f'atl_date={(self.atl_date if hasattr(self, "atl_date") else None)!r}, '
                f'roi={(self.roi if hasattr(self, "roi") else None)!r}, '
                f'last_updated={(self.last_updated if hasattr(self, "last_updated") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'id={(self.id if hasattr(self, "id") else None)!s}, '
                f'symbol={(self.symbol if hasattr(self, "symbol") else None)!s}, '
                f'name={(self.name if hasattr(self, "name") else None)!s}, '
                f'image={(self.image if hasattr(self, "image") else None)!s}, '
                f'current_price={(self.current_price if hasattr(self, "current_price") else None)!s}, '
                f'market_cap={(self.market_cap if hasattr(self, "market_cap") else None)!s}, '
                f'market_cap_rank={(self.market_cap_rank if hasattr(self, "market_cap_rank") else None)!s}, '
                f'fully_diluted_valuation={(self.fully_diluted_valuation if hasattr(self, "fully_diluted_valuation") else None)!s}, '
                f'total_volume={(self.total_volume if hasattr(self, "total_volume") else None)!s}, '
                f'high_24_h={(self.high_24_h if hasattr(self, "high_24_h") else None)!s}, '
                f'low_24_h={(self.low_24_h if hasattr(self, "low_24_h") else None)!s}, '
                f'price_change_24_h={(self.price_change_24_h if hasattr(self, "price_change_24_h") else None)!s}, '
                f'price_change_percentage_24_h={(self.price_change_percentage_24_h if hasattr(self, "price_change_percentage_24_h") else None)!s}, '
                f'market_cap_change_24_h={(self.market_cap_change_24_h if hasattr(self, "market_cap_change_24_h") else None)!s}, '
                f'market_cap_change_percentage_24_h={(self.market_cap_change_percentage_24_h if hasattr(self, "market_cap_change_percentage_24_h") else None)!s}, '
                f'circulating_supply={(self.circulating_supply if hasattr(self, "circulating_supply") else None)!s}, '
                f'total_supply={(self.total_supply if hasattr(self, "total_supply") else None)!s}, '
                f'max_supply={(self.max_supply if hasattr(self, "max_supply") else None)!s}, '
                f'ath={(self.ath if hasattr(self, "ath") else None)!s}, '
                f'ath_change_percentage={(self.ath_change_percentage if hasattr(self, "ath_change_percentage") else None)!s}, '
                f'ath_date={(self.ath_date if hasattr(self, "ath_date") else None)!s}, '
                f'atl={(self.atl if hasattr(self, "atl") else None)!s}, '
                f'atl_change_percentage={(self.atl_change_percentage if hasattr(self, "atl_change_percentage") else None)!s}, '
                f'atl_date={(self.atl_date if hasattr(self, "atl_date") else None)!s}, '
                f'roi={(self.roi if hasattr(self, "roi") else None)!s}, '
                f'last_updated={(self.last_updated if hasattr(self, "last_updated") else None)!s})')
