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

"""
coingeckopublicapiv3

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


class ConvertedVolume(object):

    """Implementation of the 'ConvertedVolume' model.

    coin ticker converted volume

    Attributes:
        btc (float): The model property of type float.
        eth (float): The model property of type float.
        usd (float): The model property of type float.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "btc": 'btc',
        "eth": 'eth',
        "usd": 'usd'
    }

    _optionals = [
        'btc',
        'eth',
        'usd',
    ]

    def __init__(self,
                 btc=APIHelper.SKIP,
                 eth=APIHelper.SKIP,
                 usd=APIHelper.SKIP):
        """Constructor for the ConvertedVolume class"""

        # Initialize members of the class
        if btc is not APIHelper.SKIP:
            self.btc = btc 
        if eth is not APIHelper.SKIP:
            self.eth = eth 
        if usd is not APIHelper.SKIP:
            self.usd = usd 

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

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'btc={(self.btc if hasattr(self, "btc") else None)!r}, '
                f'eth={(self.eth if hasattr(self, "eth") else None)!r}, '
                f'usd={(self.usd if hasattr(self, "usd") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'btc={(self.btc if hasattr(self, "btc") else None)!s}, '
                f'eth={(self.eth if hasattr(self, "eth") else None)!s}, '
                f'usd={(self.usd if hasattr(self, "usd") else None)!s})')
