# coding: utf-8

"""
    Zarban API

    API for Zarban services.  # noqa: E501

    The version of the OpenAPI document: 2.0.0
    Contact: info@zarban.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from zarban.service.openapi_client.configuration import Configuration


class FormattedReserveData(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'id': 'str',
        'underlying_asset': 'Token',
        'z_token_address': 'str',
        'variable_debt_token_address': 'str',
        'borrowing_enabled': 'bool',
        'is_active': 'bool',
        'is_frozen': 'bool',
        'usage_as_collateral_enabled': 'bool',
        'reserve_factor': 'str',
        'base_lt_vas_collateral': 'str',
        'reserve_liquidation_threshold': 'str',
        'reserve_liquidation_bonus': 'str',
        'utilization_rate': 'str',
        'total_debt': 'dict(str, str)',
        'total_liquidity': 'dict(str, str)',
        'available_liquidity': 'dict(str, str)',
        'supply_apy': 'str',
        'supply_apr': 'str',
        'variable_borrow_apy': 'str',
        'variable_borrow_apr': 'str',
        'price': 'dict(str, str)'
    }

    attribute_map = {
        'id': 'id',
        'underlying_asset': 'underlyingAsset',
        'z_token_address': 'zTokenAddress',
        'variable_debt_token_address': 'variableDebtTokenAddress',
        'borrowing_enabled': 'borrowingEnabled',
        'is_active': 'isActive',
        'is_frozen': 'isFrozen',
        'usage_as_collateral_enabled': 'usageAsCollateralEnabled',
        'reserve_factor': 'reserveFactor',
        'base_lt_vas_collateral': 'baseLTVasCollateral',
        'reserve_liquidation_threshold': 'reserveLiquidationThreshold',
        'reserve_liquidation_bonus': 'reserveLiquidationBonus',
        'utilization_rate': 'utilizationRate',
        'total_debt': 'totalDebt',
        'total_liquidity': 'totalLiquidity',
        'available_liquidity': 'availableLiquidity',
        'supply_apy': 'supplyAPY',
        'supply_apr': 'supplyAPR',
        'variable_borrow_apy': 'variableBorrowAPY',
        'variable_borrow_apr': 'variableBorrowAPR',
        'price': 'price'
    }

    def __init__(self, id=None, underlying_asset=None, z_token_address=None, variable_debt_token_address=None, borrowing_enabled=None, is_active=None, is_frozen=None, usage_as_collateral_enabled=None, reserve_factor=None, base_lt_vas_collateral=None, reserve_liquidation_threshold=None, reserve_liquidation_bonus=None, utilization_rate=None, total_debt=None, total_liquidity=None, available_liquidity=None, supply_apy=None, supply_apr=None, variable_borrow_apy=None, variable_borrow_apr=None, price=None, local_vars_configuration=None):  # noqa: E501
        """FormattedReserveData - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._underlying_asset = None
        self._z_token_address = None
        self._variable_debt_token_address = None
        self._borrowing_enabled = None
        self._is_active = None
        self._is_frozen = None
        self._usage_as_collateral_enabled = None
        self._reserve_factor = None
        self._base_lt_vas_collateral = None
        self._reserve_liquidation_threshold = None
        self._reserve_liquidation_bonus = None
        self._utilization_rate = None
        self._total_debt = None
        self._total_liquidity = None
        self._available_liquidity = None
        self._supply_apy = None
        self._supply_apr = None
        self._variable_borrow_apy = None
        self._variable_borrow_apr = None
        self._price = None
        self.discriminator = None

        self.id = id
        self.underlying_asset = underlying_asset
        self.z_token_address = z_token_address
        self.variable_debt_token_address = variable_debt_token_address
        self.borrowing_enabled = borrowing_enabled
        self.is_active = is_active
        self.is_frozen = is_frozen
        self.usage_as_collateral_enabled = usage_as_collateral_enabled
        self.reserve_factor = reserve_factor
        self.base_lt_vas_collateral = base_lt_vas_collateral
        self.reserve_liquidation_threshold = reserve_liquidation_threshold
        self.reserve_liquidation_bonus = reserve_liquidation_bonus
        self.utilization_rate = utilization_rate
        self.total_debt = total_debt
        self.total_liquidity = total_liquidity
        self.available_liquidity = available_liquidity
        self.supply_apy = supply_apy
        self.supply_apr = supply_apr
        self.variable_borrow_apy = variable_borrow_apy
        self.variable_borrow_apr = variable_borrow_apr
        self.price = price

    @property
    def id(self):
        """Gets the id of this FormattedReserveData.  # noqa: E501

        Identifier for the reserve data.  # noqa: E501

        :return: The id of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this FormattedReserveData.

        Identifier for the reserve data.  # noqa: E501

        :param id: The id of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and id is None:  # noqa: E501
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

    @property
    def underlying_asset(self):
        """Gets the underlying_asset of this FormattedReserveData.  # noqa: E501


        :return: The underlying_asset of this FormattedReserveData.  # noqa: E501
        :rtype: Token
        """
        return self._underlying_asset

    @underlying_asset.setter
    def underlying_asset(self, underlying_asset):
        """Sets the underlying_asset of this FormattedReserveData.


        :param underlying_asset: The underlying_asset of this FormattedReserveData.  # noqa: E501
        :type: Token
        """
        if self.local_vars_configuration.client_side_validation and underlying_asset is None:  # noqa: E501
            raise ValueError("Invalid value for `underlying_asset`, must not be `None`")  # noqa: E501

        self._underlying_asset = underlying_asset

    @property
    def z_token_address(self):
        """Gets the z_token_address of this FormattedReserveData.  # noqa: E501

        Address of the associated zToken contract in hexadecimal format.  # noqa: E501

        :return: The z_token_address of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._z_token_address

    @z_token_address.setter
    def z_token_address(self, z_token_address):
        """Sets the z_token_address of this FormattedReserveData.

        Address of the associated zToken contract in hexadecimal format.  # noqa: E501

        :param z_token_address: The z_token_address of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and z_token_address is None:  # noqa: E501
            raise ValueError("Invalid value for `z_token_address`, must not be `None`")  # noqa: E501

        self._z_token_address = z_token_address

    @property
    def variable_debt_token_address(self):
        """Gets the variable_debt_token_address of this FormattedReserveData.  # noqa: E501

        Address of the associated variable debt token contract in hexadecimal format.  # noqa: E501

        :return: The variable_debt_token_address of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._variable_debt_token_address

    @variable_debt_token_address.setter
    def variable_debt_token_address(self, variable_debt_token_address):
        """Sets the variable_debt_token_address of this FormattedReserveData.

        Address of the associated variable debt token contract in hexadecimal format.  # noqa: E501

        :param variable_debt_token_address: The variable_debt_token_address of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and variable_debt_token_address is None:  # noqa: E501
            raise ValueError("Invalid value for `variable_debt_token_address`, must not be `None`")  # noqa: E501

        self._variable_debt_token_address = variable_debt_token_address

    @property
    def borrowing_enabled(self):
        """Gets the borrowing_enabled of this FormattedReserveData.  # noqa: E501


        :return: The borrowing_enabled of this FormattedReserveData.  # noqa: E501
        :rtype: bool
        """
        return self._borrowing_enabled

    @borrowing_enabled.setter
    def borrowing_enabled(self, borrowing_enabled):
        """Sets the borrowing_enabled of this FormattedReserveData.


        :param borrowing_enabled: The borrowing_enabled of this FormattedReserveData.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and borrowing_enabled is None:  # noqa: E501
            raise ValueError("Invalid value for `borrowing_enabled`, must not be `None`")  # noqa: E501

        self._borrowing_enabled = borrowing_enabled

    @property
    def is_active(self):
        """Gets the is_active of this FormattedReserveData.  # noqa: E501


        :return: The is_active of this FormattedReserveData.  # noqa: E501
        :rtype: bool
        """
        return self._is_active

    @is_active.setter
    def is_active(self, is_active):
        """Sets the is_active of this FormattedReserveData.


        :param is_active: The is_active of this FormattedReserveData.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and is_active is None:  # noqa: E501
            raise ValueError("Invalid value for `is_active`, must not be `None`")  # noqa: E501

        self._is_active = is_active

    @property
    def is_frozen(self):
        """Gets the is_frozen of this FormattedReserveData.  # noqa: E501


        :return: The is_frozen of this FormattedReserveData.  # noqa: E501
        :rtype: bool
        """
        return self._is_frozen

    @is_frozen.setter
    def is_frozen(self, is_frozen):
        """Sets the is_frozen of this FormattedReserveData.


        :param is_frozen: The is_frozen of this FormattedReserveData.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and is_frozen is None:  # noqa: E501
            raise ValueError("Invalid value for `is_frozen`, must not be `None`")  # noqa: E501

        self._is_frozen = is_frozen

    @property
    def usage_as_collateral_enabled(self):
        """Gets the usage_as_collateral_enabled of this FormattedReserveData.  # noqa: E501


        :return: The usage_as_collateral_enabled of this FormattedReserveData.  # noqa: E501
        :rtype: bool
        """
        return self._usage_as_collateral_enabled

    @usage_as_collateral_enabled.setter
    def usage_as_collateral_enabled(self, usage_as_collateral_enabled):
        """Sets the usage_as_collateral_enabled of this FormattedReserveData.


        :param usage_as_collateral_enabled: The usage_as_collateral_enabled of this FormattedReserveData.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and usage_as_collateral_enabled is None:  # noqa: E501
            raise ValueError("Invalid value for `usage_as_collateral_enabled`, must not be `None`")  # noqa: E501

        self._usage_as_collateral_enabled = usage_as_collateral_enabled

    @property
    def reserve_factor(self):
        """Gets the reserve_factor of this FormattedReserveData.  # noqa: E501


        :return: The reserve_factor of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._reserve_factor

    @reserve_factor.setter
    def reserve_factor(self, reserve_factor):
        """Sets the reserve_factor of this FormattedReserveData.


        :param reserve_factor: The reserve_factor of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and reserve_factor is None:  # noqa: E501
            raise ValueError("Invalid value for `reserve_factor`, must not be `None`")  # noqa: E501

        self._reserve_factor = reserve_factor

    @property
    def base_lt_vas_collateral(self):
        """Gets the base_lt_vas_collateral of this FormattedReserveData.  # noqa: E501


        :return: The base_lt_vas_collateral of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._base_lt_vas_collateral

    @base_lt_vas_collateral.setter
    def base_lt_vas_collateral(self, base_lt_vas_collateral):
        """Sets the base_lt_vas_collateral of this FormattedReserveData.


        :param base_lt_vas_collateral: The base_lt_vas_collateral of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and base_lt_vas_collateral is None:  # noqa: E501
            raise ValueError("Invalid value for `base_lt_vas_collateral`, must not be `None`")  # noqa: E501

        self._base_lt_vas_collateral = base_lt_vas_collateral

    @property
    def reserve_liquidation_threshold(self):
        """Gets the reserve_liquidation_threshold of this FormattedReserveData.  # noqa: E501


        :return: The reserve_liquidation_threshold of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._reserve_liquidation_threshold

    @reserve_liquidation_threshold.setter
    def reserve_liquidation_threshold(self, reserve_liquidation_threshold):
        """Sets the reserve_liquidation_threshold of this FormattedReserveData.


        :param reserve_liquidation_threshold: The reserve_liquidation_threshold of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and reserve_liquidation_threshold is None:  # noqa: E501
            raise ValueError("Invalid value for `reserve_liquidation_threshold`, must not be `None`")  # noqa: E501

        self._reserve_liquidation_threshold = reserve_liquidation_threshold

    @property
    def reserve_liquidation_bonus(self):
        """Gets the reserve_liquidation_bonus of this FormattedReserveData.  # noqa: E501


        :return: The reserve_liquidation_bonus of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._reserve_liquidation_bonus

    @reserve_liquidation_bonus.setter
    def reserve_liquidation_bonus(self, reserve_liquidation_bonus):
        """Sets the reserve_liquidation_bonus of this FormattedReserveData.


        :param reserve_liquidation_bonus: The reserve_liquidation_bonus of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and reserve_liquidation_bonus is None:  # noqa: E501
            raise ValueError("Invalid value for `reserve_liquidation_bonus`, must not be `None`")  # noqa: E501

        self._reserve_liquidation_bonus = reserve_liquidation_bonus

    @property
    def utilization_rate(self):
        """Gets the utilization_rate of this FormattedReserveData.  # noqa: E501


        :return: The utilization_rate of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._utilization_rate

    @utilization_rate.setter
    def utilization_rate(self, utilization_rate):
        """Sets the utilization_rate of this FormattedReserveData.


        :param utilization_rate: The utilization_rate of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and utilization_rate is None:  # noqa: E501
            raise ValueError("Invalid value for `utilization_rate`, must not be `None`")  # noqa: E501

        self._utilization_rate = utilization_rate

    @property
    def total_debt(self):
        """Gets the total_debt of this FormattedReserveData.  # noqa: E501


        :return: The total_debt of this FormattedReserveData.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._total_debt

    @total_debt.setter
    def total_debt(self, total_debt):
        """Sets the total_debt of this FormattedReserveData.


        :param total_debt: The total_debt of this FormattedReserveData.  # noqa: E501
        :type: dict(str, str)
        """
        if self.local_vars_configuration.client_side_validation and total_debt is None:  # noqa: E501
            raise ValueError("Invalid value for `total_debt`, must not be `None`")  # noqa: E501

        self._total_debt = total_debt

    @property
    def total_liquidity(self):
        """Gets the total_liquidity of this FormattedReserveData.  # noqa: E501


        :return: The total_liquidity of this FormattedReserveData.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._total_liquidity

    @total_liquidity.setter
    def total_liquidity(self, total_liquidity):
        """Sets the total_liquidity of this FormattedReserveData.


        :param total_liquidity: The total_liquidity of this FormattedReserveData.  # noqa: E501
        :type: dict(str, str)
        """
        if self.local_vars_configuration.client_side_validation and total_liquidity is None:  # noqa: E501
            raise ValueError("Invalid value for `total_liquidity`, must not be `None`")  # noqa: E501

        self._total_liquidity = total_liquidity

    @property
    def available_liquidity(self):
        """Gets the available_liquidity of this FormattedReserveData.  # noqa: E501


        :return: The available_liquidity of this FormattedReserveData.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._available_liquidity

    @available_liquidity.setter
    def available_liquidity(self, available_liquidity):
        """Sets the available_liquidity of this FormattedReserveData.


        :param available_liquidity: The available_liquidity of this FormattedReserveData.  # noqa: E501
        :type: dict(str, str)
        """
        if self.local_vars_configuration.client_side_validation and available_liquidity is None:  # noqa: E501
            raise ValueError("Invalid value for `available_liquidity`, must not be `None`")  # noqa: E501

        self._available_liquidity = available_liquidity

    @property
    def supply_apy(self):
        """Gets the supply_apy of this FormattedReserveData.  # noqa: E501


        :return: The supply_apy of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._supply_apy

    @supply_apy.setter
    def supply_apy(self, supply_apy):
        """Sets the supply_apy of this FormattedReserveData.


        :param supply_apy: The supply_apy of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and supply_apy is None:  # noqa: E501
            raise ValueError("Invalid value for `supply_apy`, must not be `None`")  # noqa: E501

        self._supply_apy = supply_apy

    @property
    def supply_apr(self):
        """Gets the supply_apr of this FormattedReserveData.  # noqa: E501


        :return: The supply_apr of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._supply_apr

    @supply_apr.setter
    def supply_apr(self, supply_apr):
        """Sets the supply_apr of this FormattedReserveData.


        :param supply_apr: The supply_apr of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and supply_apr is None:  # noqa: E501
            raise ValueError("Invalid value for `supply_apr`, must not be `None`")  # noqa: E501

        self._supply_apr = supply_apr

    @property
    def variable_borrow_apy(self):
        """Gets the variable_borrow_apy of this FormattedReserveData.  # noqa: E501


        :return: The variable_borrow_apy of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._variable_borrow_apy

    @variable_borrow_apy.setter
    def variable_borrow_apy(self, variable_borrow_apy):
        """Sets the variable_borrow_apy of this FormattedReserveData.


        :param variable_borrow_apy: The variable_borrow_apy of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and variable_borrow_apy is None:  # noqa: E501
            raise ValueError("Invalid value for `variable_borrow_apy`, must not be `None`")  # noqa: E501

        self._variable_borrow_apy = variable_borrow_apy

    @property
    def variable_borrow_apr(self):
        """Gets the variable_borrow_apr of this FormattedReserveData.  # noqa: E501


        :return: The variable_borrow_apr of this FormattedReserveData.  # noqa: E501
        :rtype: str
        """
        return self._variable_borrow_apr

    @variable_borrow_apr.setter
    def variable_borrow_apr(self, variable_borrow_apr):
        """Sets the variable_borrow_apr of this FormattedReserveData.


        :param variable_borrow_apr: The variable_borrow_apr of this FormattedReserveData.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and variable_borrow_apr is None:  # noqa: E501
            raise ValueError("Invalid value for `variable_borrow_apr`, must not be `None`")  # noqa: E501

        self._variable_borrow_apr = variable_borrow_apr

    @property
    def price(self):
        """Gets the price of this FormattedReserveData.  # noqa: E501


        :return: The price of this FormattedReserveData.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._price

    @price.setter
    def price(self, price):
        """Sets the price of this FormattedReserveData.


        :param price: The price of this FormattedReserveData.  # noqa: E501
        :type: dict(str, str)
        """
        if self.local_vars_configuration.client_side_validation and price is None:  # noqa: E501
            raise ValueError("Invalid value for `price`, must not be `None`")  # noqa: E501

        self._price = price

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, FormattedReserveData):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, FormattedReserveData):
            return True

        return self.to_dict() != other.to_dict()
