# coding: utf-8

"""
    Zarban Wallet API

    API for Zarban wallet 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.wallet.openapi_client.configuration import Configuration


class LoansResponse(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',
        'user_id': 'int',
        'liquidation_price': 'Currency',
        'collateral': 'Currency',
        'collateralization_ratio': 'str',
        'loan_to_value': 'str',
        'debt': 'Currency',
        'principal': 'Currency',
        'scaled_debt': 'Currency',
        'plan': 'LoanPlan',
        'state': 'dict(str, str)',
        'updated_collateral_token_balance': 'Currency',
        'updated_debt_token_balance': 'Currency',
        'terms_and_conditions': 'BulletContent'
    }

    attribute_map = {
        'id': 'id',
        'user_id': 'userId',
        'liquidation_price': 'liquidationPrice',
        'collateral': 'collateral',
        'collateralization_ratio': 'collateralizationRatio',
        'loan_to_value': 'loanToValue',
        'debt': 'debt',
        'principal': 'principal',
        'scaled_debt': 'scaledDebt',
        'plan': 'plan',
        'state': 'state',
        'updated_collateral_token_balance': 'updatedCollateralTokenBalance',
        'updated_debt_token_balance': 'updatedDebtTokenBalance',
        'terms_and_conditions': 'termsAndConditions'
    }

    def __init__(self, id=None, user_id=None, liquidation_price=None, collateral=None, collateralization_ratio=None, loan_to_value=None, debt=None, principal=None, scaled_debt=None, plan=None, state=None, updated_collateral_token_balance=None, updated_debt_token_balance=None, terms_and_conditions=None, local_vars_configuration=None):  # noqa: E501
        """LoansResponse - 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._user_id = None
        self._liquidation_price = None
        self._collateral = None
        self._collateralization_ratio = None
        self._loan_to_value = None
        self._debt = None
        self._principal = None
        self._scaled_debt = None
        self._plan = None
        self._state = None
        self._updated_collateral_token_balance = None
        self._updated_debt_token_balance = None
        self._terms_and_conditions = None
        self.discriminator = None

        if id is not None:
            self.id = id
        self.user_id = user_id
        self.liquidation_price = liquidation_price
        self.collateral = collateral
        self.collateralization_ratio = collateralization_ratio
        self.loan_to_value = loan_to_value
        self.debt = debt
        self.principal = principal
        self.scaled_debt = scaled_debt
        self.plan = plan
        self.state = state
        if updated_collateral_token_balance is not None:
            self.updated_collateral_token_balance = updated_collateral_token_balance
        if updated_debt_token_balance is not None:
            self.updated_debt_token_balance = updated_debt_token_balance
        if terms_and_conditions is not None:
            self.terms_and_conditions = terms_and_conditions

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

        Identifier for the vault.  # noqa: E501

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

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

        Identifier for the vault.  # noqa: E501

        :param id: The id of this LoansResponse.  # noqa: E501
        :type: str
        """

        self._id = id

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

        Identifier for the user.  # noqa: E501

        :return: The user_id of this LoansResponse.  # noqa: E501
        :rtype: int
        """
        return self._user_id

    @user_id.setter
    def user_id(self, user_id):
        """Sets the user_id of this LoansResponse.

        Identifier for the user.  # noqa: E501

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

        self._user_id = user_id

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


        :return: The liquidation_price of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._liquidation_price

    @liquidation_price.setter
    def liquidation_price(self, liquidation_price):
        """Sets the liquidation_price of this LoansResponse.


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

        self._liquidation_price = liquidation_price

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


        :return: The collateral of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._collateral

    @collateral.setter
    def collateral(self, collateral):
        """Sets the collateral of this LoansResponse.


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

        self._collateral = collateral

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

        The collateralization ratio of the vault.  # noqa: E501

        :return: The collateralization_ratio of this LoansResponse.  # noqa: E501
        :rtype: str
        """
        return self._collateralization_ratio

    @collateralization_ratio.setter
    def collateralization_ratio(self, collateralization_ratio):
        """Sets the collateralization_ratio of this LoansResponse.

        The collateralization ratio of the vault.  # noqa: E501

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

        self._collateralization_ratio = collateralization_ratio

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

        The loan to value of the vault.  # noqa: E501

        :return: The loan_to_value of this LoansResponse.  # noqa: E501
        :rtype: str
        """
        return self._loan_to_value

    @loan_to_value.setter
    def loan_to_value(self, loan_to_value):
        """Sets the loan_to_value of this LoansResponse.

        The loan to value of the vault.  # noqa: E501

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

        self._loan_to_value = loan_to_value

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


        :return: The debt of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._debt

    @debt.setter
    def debt(self, debt):
        """Sets the debt of this LoansResponse.


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

        self._debt = debt

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


        :return: The principal of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._principal

    @principal.setter
    def principal(self, principal):
        """Sets the principal of this LoansResponse.


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

        self._principal = principal

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


        :return: The scaled_debt of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._scaled_debt

    @scaled_debt.setter
    def scaled_debt(self, scaled_debt):
        """Sets the scaled_debt of this LoansResponse.


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

        self._scaled_debt = scaled_debt

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


        :return: The plan of this LoansResponse.  # noqa: E501
        :rtype: LoanPlan
        """
        return self._plan

    @plan.setter
    def plan(self, plan):
        """Sets the plan of this LoansResponse.


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

        self._plan = plan

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


        :return: The state of this LoansResponse.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this LoansResponse.


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

        self._state = state

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


        :return: The updated_collateral_token_balance of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._updated_collateral_token_balance

    @updated_collateral_token_balance.setter
    def updated_collateral_token_balance(self, updated_collateral_token_balance):
        """Sets the updated_collateral_token_balance of this LoansResponse.


        :param updated_collateral_token_balance: The updated_collateral_token_balance of this LoansResponse.  # noqa: E501
        :type: Currency
        """

        self._updated_collateral_token_balance = updated_collateral_token_balance

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


        :return: The updated_debt_token_balance of this LoansResponse.  # noqa: E501
        :rtype: Currency
        """
        return self._updated_debt_token_balance

    @updated_debt_token_balance.setter
    def updated_debt_token_balance(self, updated_debt_token_balance):
        """Sets the updated_debt_token_balance of this LoansResponse.


        :param updated_debt_token_balance: The updated_debt_token_balance of this LoansResponse.  # noqa: E501
        :type: Currency
        """

        self._updated_debt_token_balance = updated_debt_token_balance

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


        :return: The terms_and_conditions of this LoansResponse.  # noqa: E501
        :rtype: BulletContent
        """
        return self._terms_and_conditions

    @terms_and_conditions.setter
    def terms_and_conditions(self, terms_and_conditions):
        """Sets the terms_and_conditions of this LoansResponse.


        :param terms_and_conditions: The terms_and_conditions of this LoansResponse.  # noqa: E501
        :type: BulletContent
        """

        self._terms_and_conditions = terms_and_conditions

    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, LoansResponse):
            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, LoansResponse):
            return True

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