# 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 InvoiceItem(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_item_id': 'str',
        'name': 'str',
        'description': 'str',
        'amount': 'str',
        'currency': 'str',
        'quantity': 'int',
        'created_at': 'datetime'
    }

    attribute_map = {
        'invoice_item_id': 'invoice_item_id',
        'name': 'name',
        'description': 'description',
        'amount': 'amount',
        'currency': 'currency',
        'quantity': 'quantity',
        'created_at': 'created_at'
    }

    def __init__(self, invoice_item_id=None, name=None, description=None, amount=None, currency=None, quantity=None, created_at=None):  # noqa: E501
        """InvoiceItem - a model defined in Swagger"""  # noqa: E501
        self._invoice_item_id = None
        self._name = None
        self._description = None
        self._amount = None
        self._currency = None
        self._quantity = None
        self._created_at = None
        self.discriminator = None
        if invoice_item_id is not None:
            self.invoice_item_id = invoice_item_id
        self.name = name
        if description is not None:
            self.description = description
        self.amount = amount
        self.currency = currency
        self.quantity = quantity
        if created_at is not None:
            self.created_at = created_at

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


        :return: The invoice_item_id of this InvoiceItem.  # noqa: E501
        :rtype: str
        """
        return self._invoice_item_id

    @invoice_item_id.setter
    def invoice_item_id(self, invoice_item_id):
        """Sets the invoice_item_id of this InvoiceItem.


        :param invoice_item_id: The invoice_item_id of this InvoiceItem.  # noqa: E501
        :type: str
        """

        self._invoice_item_id = invoice_item_id

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


        :return: The name of this InvoiceItem.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this InvoiceItem.


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

        self._name = name

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


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

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


        :param description: The description of this InvoiceItem.  # noqa: E501
        :type: str
        """

        self._description = description

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


        :return: The amount of this InvoiceItem.  # noqa: E501
        :rtype: str
        """
        return self._amount

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


        :param amount: The amount of this InvoiceItem.  # noqa: E501
        :type: str
        """
        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 InvoiceItem.  # noqa: E501


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

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


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


        :return: The quantity of this InvoiceItem.  # noqa: E501
        :rtype: int
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this InvoiceItem.


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

        self._quantity = quantity

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


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

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


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

        self._created_at = created_at

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

        return self.__dict__ == other.__dict__

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