# 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 InvoiceDetail(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',
        'external_payment_obj_id': 'str',
        'line_items': 'list[InvoiceLineItem]',
        'amount': 'float',
        'due_date': 'datetime',
        'end_date': 'date',
        'external_payment_obj_status': 'str',
        'seller': 'Seller',
        'invoice_number': 'str',
        'issue_date': 'datetime',
        'external_payment_obj_url': 'str',
        'crm_provider': 'str',
        'payment_status': 'str',
        'crm_provider_url': 'str',
        'customer': 'LightweightCustomerSerializerForInvoice',
        'crm_provider_id': 'str',
        'start_date': 'date',
        'invoice_pdf': 'str',
        'cost_due': 'float',
        'external_payment_obj_type': 'str',
        'currency': 'PricingUnit'
    }

    attribute_map = {
        'invoice_id': 'invoice_id',
        'external_payment_obj_id': 'external_payment_obj_id',
        'line_items': 'line_items',
        'amount': 'amount',
        'due_date': 'due_date',
        'end_date': 'end_date',
        'external_payment_obj_status': 'external_payment_obj_status',
        'seller': 'seller',
        'invoice_number': 'invoice_number',
        'issue_date': 'issue_date',
        'external_payment_obj_url': 'external_payment_obj_url',
        'crm_provider': 'crm_provider',
        'payment_status': 'payment_status',
        'crm_provider_url': 'crm_provider_url',
        'customer': 'customer',
        'crm_provider_id': 'crm_provider_id',
        'start_date': 'start_date',
        'invoice_pdf': 'invoice_pdf',
        'cost_due': 'cost_due',
        'external_payment_obj_type': 'external_payment_obj_type',
        'currency': 'currency'
    }

    def __init__(self, invoice_id=None, external_payment_obj_id=None, line_items=None, amount=None, due_date=None, end_date=None, external_payment_obj_status=None, seller=None, invoice_number=None, issue_date=None, external_payment_obj_url=None, crm_provider=None, payment_status=None, crm_provider_url=None, customer=None, crm_provider_id=None, start_date=None, invoice_pdf=None, cost_due=None, external_payment_obj_type=None, currency=None):  # noqa: E501
        """InvoiceDetail - a model defined in Swagger"""  # noqa: E501
        self._invoice_id = None
        self._external_payment_obj_id = None
        self._line_items = None
        self._amount = None
        self._due_date = None
        self._end_date = None
        self._external_payment_obj_status = None
        self._seller = None
        self._invoice_number = None
        self._issue_date = None
        self._external_payment_obj_url = None
        self._crm_provider = None
        self._payment_status = None
        self._crm_provider_url = None
        self._customer = None
        self._crm_provider_id = None
        self._start_date = None
        self._invoice_pdf = None
        self._cost_due = None
        self._external_payment_obj_type = None
        self._currency = None
        self.discriminator = None
        self.invoice_id = invoice_id
        self.external_payment_obj_id = external_payment_obj_id
        self.line_items = line_items
        self.amount = amount
        self.due_date = due_date
        self.end_date = end_date
        if external_payment_obj_status is not None:
            self.external_payment_obj_status = external_payment_obj_status
        self.seller = seller
        self.invoice_number = invoice_number
        self.issue_date = issue_date
        self.external_payment_obj_url = external_payment_obj_url
        self.crm_provider = crm_provider
        self.payment_status = payment_status
        self.crm_provider_url = crm_provider_url
        self.customer = customer
        self.crm_provider_id = crm_provider_id
        self.start_date = start_date
        self.invoice_pdf = invoice_pdf
        self.cost_due = cost_due
        self.external_payment_obj_type = external_payment_obj_type
        self.currency = currency

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


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

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


        :param invoice_id: The invoice_id of this InvoiceDetail.  # 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 external_payment_obj_id(self):
        """Gets the external_payment_obj_id of this InvoiceDetail.  # noqa: E501


        :return: The external_payment_obj_id of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._external_payment_obj_id

    @external_payment_obj_id.setter
    def external_payment_obj_id(self, external_payment_obj_id):
        """Sets the external_payment_obj_id of this InvoiceDetail.


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

        self._external_payment_obj_id = external_payment_obj_id

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


        :return: The line_items of this InvoiceDetail.  # noqa: E501
        :rtype: list[InvoiceLineItem]
        """
        return self._line_items

    @line_items.setter
    def line_items(self, line_items):
        """Sets the line_items of this InvoiceDetail.


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

        self._line_items = line_items

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


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

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


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


        :return: The due_date of this InvoiceDetail.  # noqa: E501
        :rtype: datetime
        """
        return self._due_date

    @due_date.setter
    def due_date(self, due_date):
        """Sets the due_date of this InvoiceDetail.


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

        self._due_date = due_date

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


        :return: The end_date of this InvoiceDetail.  # noqa: E501
        :rtype: date
        """
        return self._end_date

    @end_date.setter
    def end_date(self, end_date):
        """Sets the end_date of this InvoiceDetail.


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

        self._end_date = end_date

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


        :return: The external_payment_obj_status of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._external_payment_obj_status

    @external_payment_obj_status.setter
    def external_payment_obj_status(self, external_payment_obj_status):
        """Sets the external_payment_obj_status of this InvoiceDetail.


        :param external_payment_obj_status: The external_payment_obj_status of this InvoiceDetail.  # noqa: E501
        :type: str
        """

        self._external_payment_obj_status = external_payment_obj_status

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


        :return: The seller of this InvoiceDetail.  # noqa: E501
        :rtype: Seller
        """
        return self._seller

    @seller.setter
    def seller(self, seller):
        """Sets the seller of this InvoiceDetail.


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

        self._seller = seller

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


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

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


        :param invoice_number: The invoice_number of this InvoiceDetail.  # 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 issue_date(self):
        """Gets the issue_date of this InvoiceDetail.  # noqa: E501


        :return: The issue_date of this InvoiceDetail.  # noqa: E501
        :rtype: datetime
        """
        return self._issue_date

    @issue_date.setter
    def issue_date(self, issue_date):
        """Sets the issue_date of this InvoiceDetail.


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

        self._issue_date = issue_date

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


        :return: The external_payment_obj_url of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._external_payment_obj_url

    @external_payment_obj_url.setter
    def external_payment_obj_url(self, external_payment_obj_url):
        """Sets the external_payment_obj_url of this InvoiceDetail.


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

        self._external_payment_obj_url = external_payment_obj_url

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

        * `salesforce` - salesforce  # noqa: E501

        :return: The crm_provider of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._crm_provider

    @crm_provider.setter
    def crm_provider(self, crm_provider):
        """Sets the crm_provider of this InvoiceDetail.

        * `salesforce` - salesforce  # noqa: E501

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

        self._crm_provider = crm_provider

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

        * `draft` - draft * `voided` - voided * `paid` - paid * `unpaid` - unpaid  # noqa: E501

        :return: The payment_status of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._payment_status

    @payment_status.setter
    def payment_status(self, payment_status):
        """Sets the payment_status of this InvoiceDetail.

        * `draft` - draft * `voided` - voided * `paid` - paid * `unpaid` - unpaid  # noqa: E501

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

        self._payment_status = payment_status

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


        :return: The crm_provider_url of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._crm_provider_url

    @crm_provider_url.setter
    def crm_provider_url(self, crm_provider_url):
        """Sets the crm_provider_url of this InvoiceDetail.


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

        self._crm_provider_url = crm_provider_url

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


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

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


        :param customer: The customer of this InvoiceDetail.  # 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 crm_provider_id(self):
        """Gets the crm_provider_id of this InvoiceDetail.  # noqa: E501


        :return: The crm_provider_id of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._crm_provider_id

    @crm_provider_id.setter
    def crm_provider_id(self, crm_provider_id):
        """Sets the crm_provider_id of this InvoiceDetail.


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

        self._crm_provider_id = crm_provider_id

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


        :return: The start_date of this InvoiceDetail.  # noqa: E501
        :rtype: date
        """
        return self._start_date

    @start_date.setter
    def start_date(self, start_date):
        """Sets the start_date of this InvoiceDetail.


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

        self._start_date = start_date

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


        :return: The invoice_pdf of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._invoice_pdf

    @invoice_pdf.setter
    def invoice_pdf(self, invoice_pdf):
        """Sets the invoice_pdf of this InvoiceDetail.


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

        self._invoice_pdf = invoice_pdf

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


        :return: The cost_due of this InvoiceDetail.  # noqa: E501
        :rtype: float
        """
        return self._cost_due

    @cost_due.setter
    def cost_due(self, cost_due):
        """Sets the cost_due of this InvoiceDetail.


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

        self._cost_due = cost_due

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

        * `stripe` - Stripe * `braintree` - Braintree  # noqa: E501

        :return: The external_payment_obj_type of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._external_payment_obj_type

    @external_payment_obj_type.setter
    def external_payment_obj_type(self, external_payment_obj_type):
        """Sets the external_payment_obj_type of this InvoiceDetail.

        * `stripe` - Stripe * `braintree` - Braintree  # noqa: E501

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

        self._external_payment_obj_type = external_payment_obj_type

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


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

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


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

        self._currency = currency

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

        return self.__dict__ == other.__dict__

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