# 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 CreditGrantRecordV2(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 = {
        'amount_usd': 'float',
        'effective_date_start': 'date',
        'effective_date_end': 'date'
    }

    attribute_map = {
        'amount_usd': 'amount_usd',
        'effective_date_start': 'effective_date_start',
        'effective_date_end': 'effective_date_end'
    }

    def __init__(self, amount_usd=None, effective_date_start=None, effective_date_end=None, local_vars_configuration=None):  # noqa: E501
        """CreditGrantRecordV2 - 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._amount_usd = None
        self._effective_date_start = None
        self._effective_date_end = None
        self.discriminator = None

        self.amount_usd = amount_usd
        self.effective_date_start = effective_date_start
        self.effective_date_end = effective_date_end

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

        Amount of USD available to use from the credit.  # noqa: E501

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

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

        Amount of USD available to use from the credit.  # noqa: E501

        :param amount_usd: The amount_usd of this CreditGrantRecordV2.  # 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 effective_date_start(self):
        """Gets the effective_date_start of this CreditGrantRecordV2.  # noqa: E501

        UTC date the credit can first be used (inclusive).  # noqa: E501

        :return: The effective_date_start of this CreditGrantRecordV2.  # noqa: E501
        :rtype: date
        """
        return self._effective_date_start

    @effective_date_start.setter
    def effective_date_start(self, effective_date_start):
        """Sets the effective_date_start of this CreditGrantRecordV2.

        UTC date the credit can first be used (inclusive).  # noqa: E501

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

        self._effective_date_start = effective_date_start

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

        UTC date the credit can last be used (inclusive).  # noqa: E501

        :return: The effective_date_end of this CreditGrantRecordV2.  # noqa: E501
        :rtype: date
        """
        return self._effective_date_end

    @effective_date_end.setter
    def effective_date_end(self, effective_date_end):
        """Sets the effective_date_end of this CreditGrantRecordV2.

        UTC date the credit can last be used (inclusive).  # noqa: E501

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

        self._effective_date_end = effective_date_end

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

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