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

"""
coingeckopublicapiv3

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


class CoinsMarketChartRange(object):

    """Implementation of the 'CoinsMarketChartRange' model.

    Attributes:
        prices (List[float]): The model property of type List[float].
        market_caps (List[float]): The model property of type List[float].
        total_volumes (List[float]): The model property of type List[float].

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "prices": 'prices',
        "market_caps": 'market_caps',
        "total_volumes": 'total_volumes'
    }

    _optionals = [
        'prices',
        'market_caps',
        'total_volumes',
    ]

    def __init__(self,
                 prices=APIHelper.SKIP,
                 market_caps=APIHelper.SKIP,
                 total_volumes=APIHelper.SKIP):
        """Constructor for the CoinsMarketChartRange class"""

        # Initialize members of the class
        if prices is not APIHelper.SKIP:
            self.prices = prices 
        if market_caps is not APIHelper.SKIP:
            self.market_caps = market_caps 
        if total_volumes is not APIHelper.SKIP:
            self.total_volumes = total_volumes 

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

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

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