# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class CreditsV2(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 = {
        'in_use_credits': 'list[CreditRecordCreditV2]',
        'pending_credits': 'list[CreditRecordCreditV2]',
        'expired_credits': 'list[CreditRecordCreditV2]',
        'in_use_commits': 'list[CreditRecordCommitV2]',
        'pending_commits': 'list[CreditRecordCommitV2]',
        'expired_commits': 'list[CreditRecordCommitV2]',
        'current_balance_usd': 'float',
        'amount_spent_usd': 'float',
        'total_granted_usd': 'float'
    }

    attribute_map = {
        'in_use_credits': 'in_use_credits',
        'pending_credits': 'pending_credits',
        'expired_credits': 'expired_credits',
        'in_use_commits': 'in_use_commits',
        'pending_commits': 'pending_commits',
        'expired_commits': 'expired_commits',
        'current_balance_usd': 'current_balance_usd',
        'amount_spent_usd': 'amount_spent_usd',
        'total_granted_usd': 'total_granted_usd'
    }

    def __init__(self, in_use_credits=None, pending_credits=None, expired_credits=None, in_use_commits=None, pending_commits=None, expired_commits=None, current_balance_usd=None, amount_spent_usd=None, total_granted_usd=None, local_vars_configuration=None):  # noqa: E501
        """CreditsV2 - 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._in_use_credits = None
        self._pending_credits = None
        self._expired_credits = None
        self._in_use_commits = None
        self._pending_commits = None
        self._expired_commits = None
        self._current_balance_usd = None
        self._amount_spent_usd = None
        self._total_granted_usd = None
        self.discriminator = None

        self.in_use_credits = in_use_credits
        self.pending_credits = pending_credits
        self.expired_credits = expired_credits
        self.in_use_commits = in_use_commits
        self.pending_commits = pending_commits
        self.expired_commits = expired_commits
        self.current_balance_usd = current_balance_usd
        self.amount_spent_usd = amount_spent_usd
        self.total_granted_usd = total_granted_usd

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

        List of in-use credits.  # noqa: E501

        :return: The in_use_credits of this CreditsV2.  # noqa: E501
        :rtype: list[CreditRecordCreditV2]
        """
        return self._in_use_credits

    @in_use_credits.setter
    def in_use_credits(self, in_use_credits):
        """Sets the in_use_credits of this CreditsV2.

        List of in-use credits.  # noqa: E501

        :param in_use_credits: The in_use_credits of this CreditsV2.  # noqa: E501
        :type: list[CreditRecordCreditV2]
        """
        if self.local_vars_configuration.client_side_validation and in_use_credits is None:  # noqa: E501
            raise ValueError("Invalid value for `in_use_credits`, must not be `None`")  # noqa: E501

        self._in_use_credits = in_use_credits

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

        List of pending credits.  # noqa: E501

        :return: The pending_credits of this CreditsV2.  # noqa: E501
        :rtype: list[CreditRecordCreditV2]
        """
        return self._pending_credits

    @pending_credits.setter
    def pending_credits(self, pending_credits):
        """Sets the pending_credits of this CreditsV2.

        List of pending credits.  # noqa: E501

        :param pending_credits: The pending_credits of this CreditsV2.  # noqa: E501
        :type: list[CreditRecordCreditV2]
        """
        if self.local_vars_configuration.client_side_validation and pending_credits is None:  # noqa: E501
            raise ValueError("Invalid value for `pending_credits`, must not be `None`")  # noqa: E501

        self._pending_credits = pending_credits

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

        List of expired credits.  # noqa: E501

        :return: The expired_credits of this CreditsV2.  # noqa: E501
        :rtype: list[CreditRecordCreditV2]
        """
        return self._expired_credits

    @expired_credits.setter
    def expired_credits(self, expired_credits):
        """Sets the expired_credits of this CreditsV2.

        List of expired credits.  # noqa: E501

        :param expired_credits: The expired_credits of this CreditsV2.  # noqa: E501
        :type: list[CreditRecordCreditV2]
        """
        if self.local_vars_configuration.client_side_validation and expired_credits is None:  # noqa: E501
            raise ValueError("Invalid value for `expired_credits`, must not be `None`")  # noqa: E501

        self._expired_credits = expired_credits

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

        List of in-use commits.  # noqa: E501

        :return: The in_use_commits of this CreditsV2.  # noqa: E501
        :rtype: list[CreditRecordCommitV2]
        """
        return self._in_use_commits

    @in_use_commits.setter
    def in_use_commits(self, in_use_commits):
        """Sets the in_use_commits of this CreditsV2.

        List of in-use commits.  # noqa: E501

        :param in_use_commits: The in_use_commits of this CreditsV2.  # noqa: E501
        :type: list[CreditRecordCommitV2]
        """
        if self.local_vars_configuration.client_side_validation and in_use_commits is None:  # noqa: E501
            raise ValueError("Invalid value for `in_use_commits`, must not be `None`")  # noqa: E501

        self._in_use_commits = in_use_commits

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

        List of pending commits.  # noqa: E501

        :return: The pending_commits of this CreditsV2.  # noqa: E501
        :rtype: list[CreditRecordCommitV2]
        """
        return self._pending_commits

    @pending_commits.setter
    def pending_commits(self, pending_commits):
        """Sets the pending_commits of this CreditsV2.

        List of pending commits.  # noqa: E501

        :param pending_commits: The pending_commits of this CreditsV2.  # noqa: E501
        :type: list[CreditRecordCommitV2]
        """
        if self.local_vars_configuration.client_side_validation and pending_commits is None:  # noqa: E501
            raise ValueError("Invalid value for `pending_commits`, must not be `None`")  # noqa: E501

        self._pending_commits = pending_commits

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

        List of expired commits.  # noqa: E501

        :return: The expired_commits of this CreditsV2.  # noqa: E501
        :rtype: list[CreditRecordCommitV2]
        """
        return self._expired_commits

    @expired_commits.setter
    def expired_commits(self, expired_commits):
        """Sets the expired_commits of this CreditsV2.

        List of expired commits.  # noqa: E501

        :param expired_commits: The expired_commits of this CreditsV2.  # noqa: E501
        :type: list[CreditRecordCommitV2]
        """
        if self.local_vars_configuration.client_side_validation and expired_commits is None:  # noqa: E501
            raise ValueError("Invalid value for `expired_commits`, must not be `None`")  # noqa: E501

        self._expired_commits = expired_commits

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

        Summary of current balance of all credits and commits.  # noqa: E501

        :return: The current_balance_usd of this CreditsV2.  # noqa: E501
        :rtype: float
        """
        return self._current_balance_usd

    @current_balance_usd.setter
    def current_balance_usd(self, current_balance_usd):
        """Sets the current_balance_usd of this CreditsV2.

        Summary of current balance of all credits and commits.  # noqa: E501

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

        self._current_balance_usd = current_balance_usd

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

        Summary of total amount spent across all credits and commits.  # noqa: E501

        :return: The amount_spent_usd of this CreditsV2.  # noqa: E501
        :rtype: float
        """
        return self._amount_spent_usd

    @amount_spent_usd.setter
    def amount_spent_usd(self, amount_spent_usd):
        """Sets the amount_spent_usd of this CreditsV2.

        Summary of total amount spent across all credits and commits.  # noqa: E501

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

        self._amount_spent_usd = amount_spent_usd

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

        Summary of total granted across all credits and commits.  # noqa: E501

        :return: The total_granted_usd of this CreditsV2.  # noqa: E501
        :rtype: float
        """
        return self._total_granted_usd

    @total_granted_usd.setter
    def total_granted_usd(self, total_granted_usd):
        """Sets the total_granted_usd of this CreditsV2.

        Summary of total granted across all credits and commits.  # noqa: E501

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

        self._total_granted_usd = total_granted_usd

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

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