# 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 CommitLedgerRecordV2(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 = {
        'ledger_record_type': 'CreditType',
        'amount_usd': 'float',
        'timestamp': 'datetime',
        'commit_ledger_item_type': 'CommitLedgerItemType'
    }

    attribute_map = {
        'ledger_record_type': 'ledger_record_type',
        'amount_usd': 'amount_usd',
        'timestamp': 'timestamp',
        'commit_ledger_item_type': 'commit_ledger_item_type'
    }

    def __init__(self, ledger_record_type=None, amount_usd=None, timestamp=None, commit_ledger_item_type=None, local_vars_configuration=None):  # noqa: E501
        """CommitLedgerRecordV2 - 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._ledger_record_type = None
        self._amount_usd = None
        self._timestamp = None
        self._commit_ledger_item_type = None
        self.discriminator = None

        if ledger_record_type is not None:
            self.ledger_record_type = ledger_record_type
        self.amount_usd = amount_usd
        self.timestamp = timestamp
        self.commit_ledger_item_type = commit_ledger_item_type

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


        :return: The ledger_record_type of this CommitLedgerRecordV2.  # noqa: E501
        :rtype: CreditType
        """
        return self._ledger_record_type

    @ledger_record_type.setter
    def ledger_record_type(self, ledger_record_type):
        """Sets the ledger_record_type of this CommitLedgerRecordV2.


        :param ledger_record_type: The ledger_record_type of this CommitLedgerRecordV2.  # noqa: E501
        :type: CreditType
        """

        self._ledger_record_type = ledger_record_type

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

        Amount of USD added or removed from the credit.  # noqa: E501

        :return: The amount_usd of this CommitLedgerRecordV2.  # noqa: E501
        :rtype: float
        """
        return self._amount_usd

    @amount_usd.setter
    def amount_usd(self, amount_usd):
        """Sets the amount_usd of this CommitLedgerRecordV2.

        Amount of USD added or removed from the credit.  # noqa: E501

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

        self._amount_usd = amount_usd

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

        UTC timestamp of when the record occurred.  # noqa: E501

        :return: The timestamp of this CommitLedgerRecordV2.  # noqa: E501
        :rtype: datetime
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this CommitLedgerRecordV2.

        UTC timestamp of when the record occurred.  # noqa: E501

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

        self._timestamp = timestamp

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

        Type of commit ledger item.  # noqa: E501

        :return: The commit_ledger_item_type of this CommitLedgerRecordV2.  # noqa: E501
        :rtype: CommitLedgerItemType
        """
        return self._commit_ledger_item_type

    @commit_ledger_item_type.setter
    def commit_ledger_item_type(self, commit_ledger_item_type):
        """Sets the commit_ledger_item_type of this CommitLedgerRecordV2.

        Type of commit ledger item.  # noqa: E501

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

        self._commit_ledger_item_type = commit_ledger_item_type

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

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