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

"""
coingeckopublicapiv3

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


class Company(object):

    """Implementation of the 'Company' model.

    Attributes:
        name (str): company name
        symbol (str): company symbol
        country (str): company incorporated country
        total_holdings (float): total btc/eth holdings of company
        total_entry_value_usd (float): total entry value in usd
        total_current_value_usd (float): total current value of btc/eth
            holdings in usd
        percentage_of_total_supply (float): percentage of total btc/eth supply

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "name": 'name',
        "symbol": 'symbol',
        "country": 'country',
        "total_holdings": 'total_holdings',
        "total_entry_value_usd": 'total_entry_value_usd',
        "total_current_value_usd": 'total_current_value_usd',
        "percentage_of_total_supply": 'percentage_of_total_supply'
    }

    _optionals = [
        'name',
        'symbol',
        'country',
        'total_holdings',
        'total_entry_value_usd',
        'total_current_value_usd',
        'percentage_of_total_supply',
    ]

    def __init__(self,
                 name=APIHelper.SKIP,
                 symbol=APIHelper.SKIP,
                 country=APIHelper.SKIP,
                 total_holdings=APIHelper.SKIP,
                 total_entry_value_usd=APIHelper.SKIP,
                 total_current_value_usd=APIHelper.SKIP,
                 percentage_of_total_supply=APIHelper.SKIP):
        """Constructor for the Company class"""

        # Initialize members of the class
        if name is not APIHelper.SKIP:
            self.name = name 
        if symbol is not APIHelper.SKIP:
            self.symbol = symbol 
        if country is not APIHelper.SKIP:
            self.country = country 
        if total_holdings is not APIHelper.SKIP:
            self.total_holdings = total_holdings 
        if total_entry_value_usd is not APIHelper.SKIP:
            self.total_entry_value_usd = total_entry_value_usd 
        if total_current_value_usd is not APIHelper.SKIP:
            self.total_current_value_usd = total_current_value_usd 
        if percentage_of_total_supply is not APIHelper.SKIP:
            self.percentage_of_total_supply = percentage_of_total_supply 

    @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
        name = dictionary.get("name") if dictionary.get("name") else APIHelper.SKIP
        symbol = dictionary.get("symbol") if dictionary.get("symbol") else APIHelper.SKIP
        country = dictionary.get("country") if dictionary.get("country") else APIHelper.SKIP
        total_holdings = dictionary.get("total_holdings") if dictionary.get("total_holdings") else APIHelper.SKIP
        total_entry_value_usd = dictionary.get("total_entry_value_usd") if dictionary.get("total_entry_value_usd") else APIHelper.SKIP
        total_current_value_usd = dictionary.get("total_current_value_usd") if dictionary.get("total_current_value_usd") else APIHelper.SKIP
        percentage_of_total_supply = dictionary.get("percentage_of_total_supply") if dictionary.get("percentage_of_total_supply") else APIHelper.SKIP
        # Return an object of this model
        return cls(name,
                   symbol,
                   country,
                   total_holdings,
                   total_entry_value_usd,
                   total_current_value_usd,
                   percentage_of_total_supply)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'name={(self.name if hasattr(self, "name") else None)!r}, '
                f'symbol={(self.symbol if hasattr(self, "symbol") else None)!r}, '
                f'country={(self.country if hasattr(self, "country") else None)!r}, '
                f'total_holdings={(self.total_holdings if hasattr(self, "total_holdings") else None)!r}, '
                f'total_entry_value_usd={(self.total_entry_value_usd if hasattr(self, "total_entry_value_usd") else None)!r}, '
                f'total_current_value_usd={(self.total_current_value_usd if hasattr(self, "total_current_value_usd") else None)!r}, '
                f'percentage_of_total_supply={(self.percentage_of_total_supply if hasattr(self, "percentage_of_total_supply") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'name={(self.name if hasattr(self, "name") else None)!s}, '
                f'symbol={(self.symbol if hasattr(self, "symbol") else None)!s}, '
                f'country={(self.country if hasattr(self, "country") else None)!s}, '
                f'total_holdings={(self.total_holdings if hasattr(self, "total_holdings") else None)!s}, '
                f'total_entry_value_usd={(self.total_entry_value_usd if hasattr(self, "total_entry_value_usd") else None)!s}, '
                f'total_current_value_usd={(self.total_current_value_usd if hasattr(self, "total_current_value_usd") else None)!s}, '
                f'percentage_of_total_supply={(self.percentage_of_total_supply if hasattr(self, "percentage_of_total_supply") else None)!s})')
