# coding: utf-8

"""
    Spotii Billing API

    API for Billing  # noqa: E501

    OpenAPI spec version: v1.0
    Contact: hello@nuclearo.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class Invoice(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',
        'items': 'list[InvoiceItem]',
        'balance': 'str',
        'invoice_number': 'str',
        'object_id': 'str',
        'currency': 'str',
        'status': 'str',
        'type': 'str',
        'created_at': 'datetime',
        'target_at': 'datetime',
        'account': 'str',
        'object_type': 'int'
    }

    attribute_map = {
        'invoice_id': 'invoice_id',
        'items': 'items',
        'balance': 'balance',
        'invoice_number': 'invoice_number',
        'object_id': 'object_id',
        'currency': 'currency',
        'status': 'status',
        'type': 'type',
        'created_at': 'created_at',
        'target_at': 'target_at',
        'account': 'account',
        'object_type': 'object_type'
    }

    def __init__(self, invoice_id=None, items=None, balance=None, invoice_number=None, object_id=None, currency=None, status=None, type=None, created_at=None, target_at=None, account=None, object_type=None):  # noqa: E501
        """Invoice - a model defined in Swagger"""  # noqa: E501
        self._invoice_id = None
        self._items = None
        self._balance = None
        self._invoice_number = None
        self._object_id = None
        self._currency = None
        self._status = None
        self._type = None
        self._created_at = None
        self._target_at = None
        self._account = None
        self._object_type = None
        self.discriminator = None
        if invoice_id is not None:
            self.invoice_id = invoice_id
        if items is not None:
            self.items = items
        if balance is not None:
            self.balance = balance
        self.invoice_number = invoice_number
        if object_id is not None:
            self.object_id = object_id
        self.currency = currency
        self.status = status
        self.type = type
        if created_at is not None:
            self.created_at = created_at
        self.target_at = target_at
        self.account = account
        if object_type is not None:
            self.object_type = object_type

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


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

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


        :param invoice_id: The invoice_id of this Invoice.  # noqa: E501
        :type: str
        """

        self._invoice_id = invoice_id

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


        :return: The items of this Invoice.  # noqa: E501
        :rtype: list[InvoiceItem]
        """
        return self._items

    @items.setter
    def items(self, items):
        """Sets the items of this Invoice.


        :param items: The items of this Invoice.  # noqa: E501
        :type: list[InvoiceItem]
        """

        self._items = items

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


        :return: The balance of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._balance

    @balance.setter
    def balance(self, balance):
        """Sets the balance of this Invoice.


        :param balance: The balance of this Invoice.  # noqa: E501
        :type: str
        """

        self._balance = balance

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


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

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


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


        :return: The object_id of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._object_id

    @object_id.setter
    def object_id(self, object_id):
        """Sets the object_id of this Invoice.


        :param object_id: The object_id of this Invoice.  # noqa: E501
        :type: str
        """

        self._object_id = object_id

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


        :return: The currency of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._currency

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


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

        self._currency = currency

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


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

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


        :param status: The status of this Invoice.  # noqa: E501
        :type: str
        """
        if status is None:
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501
        allowed_values = ["DAFT", "COMMITTED", "VOID"]  # 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 type(self):
        """Gets the type of this Invoice.  # noqa: E501


        :return: The type of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this Invoice.


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

        self._type = type

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


        :return: The created_at of this Invoice.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Invoice.


        :param created_at: The created_at of this Invoice.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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


        :return: The target_at of this Invoice.  # noqa: E501
        :rtype: datetime
        """
        return self._target_at

    @target_at.setter
    def target_at(self, target_at):
        """Sets the target_at of this Invoice.


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

        self._target_at = target_at

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


        :return: The account of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._account

    @account.setter
    def account(self, account):
        """Sets the account of this Invoice.


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

        self._account = account

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


        :return: The object_type of this Invoice.  # noqa: E501
        :rtype: int
        """
        return self._object_type

    @object_type.setter
    def object_type(self, object_type):
        """Sets the object_type of this Invoice.


        :param object_type: The object_type of this Invoice.  # noqa: E501
        :type: int
        """

        self._object_type = object_type

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

        return self.__dict__ == other.__dict__

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