# coding: utf-8

"""
    Lotus API

    Lotus is an open-core pricing and billing engine. We enable API companies to automate and optimize their custom usage-based pricing for any metric.  # noqa: E501

    OpenAPI spec version: 0.9.3
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class CustomerBalanceAdjustment(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'credit_id': 'str',
        'customer': 'LightweightCustomer',
        'amount': 'float',
        'amount_remaining': 'float',
        'currency': 'PricingUnit',
        'description': 'str',
        'effective_at': 'datetime',
        'expires_at': 'datetime',
        'status': 'str',
        'amount_paid': 'float',
        'amount_paid_currency': 'AllOfCustomerBalanceAdjustmentAmountPaidCurrency',
        'drawdowns': 'list[CreditDrawdown]'
    }

    attribute_map = {
        'credit_id': 'credit_id',
        'customer': 'customer',
        'amount': 'amount',
        'amount_remaining': 'amount_remaining',
        'currency': 'currency',
        'description': 'description',
        'effective_at': 'effective_at',
        'expires_at': 'expires_at',
        'status': 'status',
        'amount_paid': 'amount_paid',
        'amount_paid_currency': 'amount_paid_currency',
        'drawdowns': 'drawdowns'
    }

    def __init__(self, credit_id=None, customer=None, amount=None, amount_remaining=None, currency=None, description=None, effective_at=None, expires_at=None, status=None, amount_paid=None, amount_paid_currency=None, drawdowns=None):  # noqa: E501
        """CustomerBalanceAdjustment - a model defined in Swagger"""  # noqa: E501
        self._credit_id = None
        self._customer = None
        self._amount = None
        self._amount_remaining = None
        self._currency = None
        self._description = None
        self._effective_at = None
        self._expires_at = None
        self._status = None
        self._amount_paid = None
        self._amount_paid_currency = None
        self._drawdowns = None
        self.discriminator = None
        self.credit_id = credit_id
        self.customer = customer
        self.amount = amount
        self.amount_remaining = amount_remaining
        self.currency = currency
        self.description = description
        self.effective_at = effective_at
        self.expires_at = expires_at
        self.status = status
        self.amount_paid = amount_paid
        self.amount_paid_currency = amount_paid_currency
        self.drawdowns = drawdowns

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


        :return: The credit_id of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: str
        """
        return self._credit_id

    @credit_id.setter
    def credit_id(self, credit_id):
        """Sets the credit_id of this CustomerBalanceAdjustment.


        :param credit_id: The credit_id of this CustomerBalanceAdjustment.  # noqa: E501
        :type: str
        """
        if credit_id is None:
            raise ValueError("Invalid value for `credit_id`, must not be `None`")  # noqa: E501

        self._credit_id = credit_id

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


        :return: The customer of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: LightweightCustomer
        """
        return self._customer

    @customer.setter
    def customer(self, customer):
        """Sets the customer of this CustomerBalanceAdjustment.


        :param customer: The customer of this CustomerBalanceAdjustment.  # noqa: E501
        :type: LightweightCustomer
        """
        if customer is None:
            raise ValueError("Invalid value for `customer`, must not be `None`")  # noqa: E501

        self._customer = customer

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


        :return: The amount of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: float
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this CustomerBalanceAdjustment.


        :param amount: The amount of this CustomerBalanceAdjustment.  # noqa: E501
        :type: float
        """
        if amount is None:
            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501

        self._amount = amount

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


        :return: The amount_remaining of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: float
        """
        return self._amount_remaining

    @amount_remaining.setter
    def amount_remaining(self, amount_remaining):
        """Sets the amount_remaining of this CustomerBalanceAdjustment.


        :param amount_remaining: The amount_remaining of this CustomerBalanceAdjustment.  # noqa: E501
        :type: float
        """
        if amount_remaining is None:
            raise ValueError("Invalid value for `amount_remaining`, must not be `None`")  # noqa: E501

        self._amount_remaining = amount_remaining

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


        :return: The currency of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: PricingUnit
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """Sets the currency of this CustomerBalanceAdjustment.


        :param currency: The currency of this CustomerBalanceAdjustment.  # noqa: E501
        :type: PricingUnit
        """
        if currency is None:
            raise ValueError("Invalid value for `currency`, must not be `None`")  # noqa: E501

        self._currency = currency

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


        :return: The description of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this CustomerBalanceAdjustment.


        :param description: The description of this CustomerBalanceAdjustment.  # noqa: E501
        :type: str
        """
        if description is None:
            raise ValueError("Invalid value for `description`, must not be `None`")  # noqa: E501

        self._description = description

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


        :return: The effective_at of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: datetime
        """
        return self._effective_at

    @effective_at.setter
    def effective_at(self, effective_at):
        """Sets the effective_at of this CustomerBalanceAdjustment.


        :param effective_at: The effective_at of this CustomerBalanceAdjustment.  # noqa: E501
        :type: datetime
        """
        if effective_at is None:
            raise ValueError("Invalid value for `effective_at`, must not be `None`")  # noqa: E501

        self._effective_at = effective_at

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


        :return: The expires_at of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: datetime
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at):
        """Sets the expires_at of this CustomerBalanceAdjustment.


        :param expires_at: The expires_at of this CustomerBalanceAdjustment.  # noqa: E501
        :type: datetime
        """
        if expires_at is None:
            raise ValueError("Invalid value for `expires_at`, must not be `None`")  # noqa: E501

        self._expires_at = expires_at

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

        * `active` - Active * `inactive` - Inactive  # noqa: E501

        :return: The status of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this CustomerBalanceAdjustment.

        * `active` - Active * `inactive` - Inactive  # noqa: E501

        :param status: The status of this CustomerBalanceAdjustment.  # noqa: E501
        :type: str
        """
        if status is None:
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501
        allowed_values = ["active", "inactive"]  # noqa: E501
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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


        :return: The amount_paid of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: float
        """
        return self._amount_paid

    @amount_paid.setter
    def amount_paid(self, amount_paid):
        """Sets the amount_paid of this CustomerBalanceAdjustment.


        :param amount_paid: The amount_paid of this CustomerBalanceAdjustment.  # noqa: E501
        :type: float
        """
        if amount_paid is None:
            raise ValueError("Invalid value for `amount_paid`, must not be `None`")  # noqa: E501

        self._amount_paid = amount_paid

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


        :return: The amount_paid_currency of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: AllOfCustomerBalanceAdjustmentAmountPaidCurrency
        """
        return self._amount_paid_currency

    @amount_paid_currency.setter
    def amount_paid_currency(self, amount_paid_currency):
        """Sets the amount_paid_currency of this CustomerBalanceAdjustment.


        :param amount_paid_currency: The amount_paid_currency of this CustomerBalanceAdjustment.  # noqa: E501
        :type: AllOfCustomerBalanceAdjustmentAmountPaidCurrency
        """
        if amount_paid_currency is None:
            raise ValueError("Invalid value for `amount_paid_currency`, must not be `None`")  # noqa: E501

        self._amount_paid_currency = amount_paid_currency

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


        :return: The drawdowns of this CustomerBalanceAdjustment.  # noqa: E501
        :rtype: list[CreditDrawdown]
        """
        return self._drawdowns

    @drawdowns.setter
    def drawdowns(self, drawdowns):
        """Sets the drawdowns of this CustomerBalanceAdjustment.


        :param drawdowns: The drawdowns of this CustomerBalanceAdjustment.  # noqa: E501
        :type: list[CreditDrawdown]
        """
        if drawdowns is None:
            raise ValueError("Invalid value for `drawdowns`, must not be `None`")  # noqa: E501

        self._drawdowns = drawdowns

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

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(CustomerBalanceAdjustment, dict):
            for key, value in self.items():
                result[key] = 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, CustomerBalanceAdjustment):
            return False

        return self.__dict__ == other.__dict__

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