# 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 InvoicePayment(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 = {
        'invoice_id': 'str',
        'invoice_number': 'str',
        'customer': 'LightweightCustomerSerializerForInvoice',
        'amount': 'float',
        'currency': 'PricingUnit',
        'payment_date': 'datetime',
        'source': 'str'
    }

    attribute_map = {
        'invoice_id': 'invoice_id',
        'invoice_number': 'invoice_number',
        'customer': 'customer',
        'amount': 'amount',
        'currency': 'currency',
        'payment_date': 'payment_date',
        'source': 'source'
    }

    def __init__(self, invoice_id=None, invoice_number=None, customer=None, amount=None, currency=None, payment_date=None, source=None):  # noqa: E501
        """InvoicePayment - a model defined in Swagger"""  # noqa: E501
        self._invoice_id = None
        self._invoice_number = None
        self._customer = None
        self._amount = None
        self._currency = None
        self._payment_date = None
        self._source = None
        self.discriminator = None
        self.invoice_id = invoice_id
        self.invoice_number = invoice_number
        self.customer = customer
        self.amount = amount
        self.currency = currency
        self.payment_date = payment_date
        self.source = source

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


        :return: The invoice_id of this InvoicePayment.  # noqa: E501
        :rtype: str
        """
        return self._invoice_id

    @invoice_id.setter
    def invoice_id(self, invoice_id):
        """Sets the invoice_id of this InvoicePayment.


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

        self._invoice_id = invoice_id

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


        :return: The invoice_number of this InvoicePayment.  # noqa: E501
        :rtype: str
        """
        return self._invoice_number

    @invoice_number.setter
    def invoice_number(self, invoice_number):
        """Sets the invoice_number of this InvoicePayment.


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

        self._invoice_number = invoice_number

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


        :return: The customer of this InvoicePayment.  # noqa: E501
        :rtype: LightweightCustomerSerializerForInvoice
        """
        return self._customer

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


        :param customer: The customer of this InvoicePayment.  # noqa: E501
        :type: LightweightCustomerSerializerForInvoice
        """
        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 InvoicePayment.  # noqa: E501


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

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


        :param amount: The amount of this InvoicePayment.  # 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 currency(self):
        """Gets the currency of this InvoicePayment.  # noqa: E501


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

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


        :param currency: The currency of this InvoicePayment.  # 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 payment_date(self):
        """Gets the payment_date of this InvoicePayment.  # noqa: E501


        :return: The payment_date of this InvoicePayment.  # noqa: E501
        :rtype: datetime
        """
        return self._payment_date

    @payment_date.setter
    def payment_date(self, payment_date):
        """Sets the payment_date of this InvoicePayment.


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

        self._payment_date = payment_date

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

        * `stripe` - stripe * `braintree` - braintree * `lotus_out_of_band` - lotus_out_of_band  # noqa: E501

        :return: The source of this InvoicePayment.  # noqa: E501
        :rtype: str
        """
        return self._source

    @source.setter
    def source(self, source):
        """Sets the source of this InvoicePayment.

        * `stripe` - stripe * `braintree` - braintree * `lotus_out_of_band` - lotus_out_of_band  # noqa: E501

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

        self._source = source

    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(InvoicePayment, 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, InvoicePayment):
            return False

        return self.__dict__ == other.__dict__

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