# coding: utf-8

"""
    CryptoAPIs

    Crypto APIs is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more.  # noqa: E501

    The version of the OpenAPI document: 2021-03-20
    Contact: developers@cryptoapis.io
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


from __future__ import annotations
import pprint
import re  # noqa: F401
import json



from pydantic import BaseModel, Field, StrictStr, validator

class GetAssetDetailsByAssetIDRISC(BaseModel):
    """
    Crypto Type Data
    """
    var_1_hour_price_change_in_percentage: StrictStr = Field(..., alias="1HourPriceChangeInPercentage", description="Represents the percentage of the asset's current price against the its price from 1 hour ago.")
    var_1_week_price_change_in_percentage: StrictStr = Field(..., alias="1WeekPriceChangeInPercentage", description="Represents the percentage of the asset's current price against the its price from 1 week ago.")
    var_24_hours_price_change_in_percentage: StrictStr = Field(..., alias="24HoursPriceChangeInPercentage", description="Represents the percentage of the asset's current price against the its price from 24 hours ago.")
    var_24_hours_trading_volume: StrictStr = Field(..., alias="24HoursTradingVolume", description="Represents the trading volume of the asset for the time frame of 24 hours.")
    asset_type: StrictStr = Field(..., alias="assetType", description="Represent a subtype of the crypto assets. Could be COIN or TOKEN.")
    circulating_supply: StrictStr = Field(..., alias="circulatingSupply", description="Represents the amount of the asset that is circulating on the market and in public hands.")
    market_cap_in_usd: StrictStr = Field(..., alias="marketCapInUSD", description="Defines the total market value of the asset's circulating supply in USD.")
    max_supply: StrictStr = Field(..., alias="maxSupply", description="Represents the maximum amount of all coins of a specific asset that will ever exist in its lifetime.")
    __properties = ["1HourPriceChangeInPercentage", "1WeekPriceChangeInPercentage", "24HoursPriceChangeInPercentage", "24HoursTradingVolume", "assetType", "circulatingSupply", "marketCapInUSD", "maxSupply"]

    @validator('asset_type')
    def asset_type_validate_enum(cls, value):
        """Validates the enum"""
        if value not in ('coin', 'token'):
            raise ValueError("must be one of enum values ('coin', 'token')")
        return value

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> GetAssetDetailsByAssetIDRISC:
        """Create an instance of GetAssetDetailsByAssetIDRISC from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> GetAssetDetailsByAssetIDRISC:
        """Create an instance of GetAssetDetailsByAssetIDRISC from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return GetAssetDetailsByAssetIDRISC.parse_obj(obj)

        _obj = GetAssetDetailsByAssetIDRISC.parse_obj({
            "var_1_hour_price_change_in_percentage": obj.get("1HourPriceChangeInPercentage"),
            "var_1_week_price_change_in_percentage": obj.get("1WeekPriceChangeInPercentage"),
            "var_24_hours_price_change_in_percentage": obj.get("24HoursPriceChangeInPercentage"),
            "var_24_hours_trading_volume": obj.get("24HoursTradingVolume"),
            "asset_type": obj.get("assetType"),
            "circulating_supply": obj.get("circulatingSupply"),
            "market_cap_in_usd": obj.get("marketCapInUSD"),
            "max_supply": obj.get("maxSupply")
        })
        return _obj

