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

"""
coingeckopublicapiv3

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


class Data1(object):

    """Implementation of the 'Data1' model.

    Attributes:
        floor_price (str): NFT collection floor price
        floor_price_in_usd_24_h_percentage_change (str): NFT collection floor
            price in usd 24 hours percentage change
        h_24_volume (str): NFT collection volume in 24 hours
        h_24_average_sale_price (str): NFT collection 24 hours average sale
            price
        sparkline (str): NFT collection sparkline image url
        content (str): The model property of type str.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "floor_price": 'floor_price',
        "floor_price_in_usd_24_h_percentage_change": 'floor_price_in_usd_24h_percentage_change',
        "h_24_volume": 'h24_volume',
        "h_24_average_sale_price": 'h24_average_sale_price',
        "sparkline": 'sparkline',
        "content": 'content'
    }

    _optionals = [
        'floor_price',
        'floor_price_in_usd_24_h_percentage_change',
        'h_24_volume',
        'h_24_average_sale_price',
        'sparkline',
        'content',
    ]

    def __init__(self,
                 floor_price=APIHelper.SKIP,
                 floor_price_in_usd_24_h_percentage_change=APIHelper.SKIP,
                 h_24_volume=APIHelper.SKIP,
                 h_24_average_sale_price=APIHelper.SKIP,
                 sparkline=APIHelper.SKIP,
                 content=APIHelper.SKIP):
        """Constructor for the Data1 class"""

        # Initialize members of the class
        if floor_price is not APIHelper.SKIP:
            self.floor_price = floor_price 
        if floor_price_in_usd_24_h_percentage_change is not APIHelper.SKIP:
            self.floor_price_in_usd_24_h_percentage_change = floor_price_in_usd_24_h_percentage_change 
        if h_24_volume is not APIHelper.SKIP:
            self.h_24_volume = h_24_volume 
        if h_24_average_sale_price is not APIHelper.SKIP:
            self.h_24_average_sale_price = h_24_average_sale_price 
        if sparkline is not APIHelper.SKIP:
            self.sparkline = sparkline 
        if content is not APIHelper.SKIP:
            self.content = content 

    @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
        floor_price = dictionary.get("floor_price") if dictionary.get("floor_price") else APIHelper.SKIP
        floor_price_in_usd_24_h_percentage_change = dictionary.get("floor_price_in_usd_24h_percentage_change") if dictionary.get("floor_price_in_usd_24h_percentage_change") else APIHelper.SKIP
        h_24_volume = dictionary.get("h24_volume") if dictionary.get("h24_volume") else APIHelper.SKIP
        h_24_average_sale_price = dictionary.get("h24_average_sale_price") if dictionary.get("h24_average_sale_price") else APIHelper.SKIP
        sparkline = dictionary.get("sparkline") if dictionary.get("sparkline") else APIHelper.SKIP
        content = dictionary.get("content") if dictionary.get("content") else APIHelper.SKIP
        # Return an object of this model
        return cls(floor_price,
                   floor_price_in_usd_24_h_percentage_change,
                   h_24_volume,
                   h_24_average_sale_price,
                   sparkline,
                   content)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'floor_price={(self.floor_price if hasattr(self, "floor_price") else None)!r}, '
                f'floor_price_in_usd_24_h_percentage_change={(self.floor_price_in_usd_24_h_percentage_change if hasattr(self, "floor_price_in_usd_24_h_percentage_change") else None)!r}, '
                f'h_24_volume={(self.h_24_volume if hasattr(self, "h_24_volume") else None)!r}, '
                f'h_24_average_sale_price={(self.h_24_average_sale_price if hasattr(self, "h_24_average_sale_price") else None)!r}, '
                f'sparkline={(self.sparkline if hasattr(self, "sparkline") else None)!r}, '
                f'content={(self.content if hasattr(self, "content") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'floor_price={(self.floor_price if hasattr(self, "floor_price") else None)!s}, '
                f'floor_price_in_usd_24_h_percentage_change={(self.floor_price_in_usd_24_h_percentage_change if hasattr(self, "floor_price_in_usd_24_h_percentage_change") else None)!s}, '
                f'h_24_volume={(self.h_24_volume if hasattr(self, "h_24_volume") else None)!s}, '
                f'h_24_average_sale_price={(self.h_24_average_sale_price if hasattr(self, "h_24_average_sale_price") else None)!s}, '
                f'sparkline={(self.sparkline if hasattr(self, "sparkline") else None)!s}, '
                f'content={(self.content if hasattr(self, "content") else None)!s})')
