# coding: utf-8

"""
    Python client for GIG based clouds (pc4g)

    RESTful api client to a GIG based cloud.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from pc4g.configuration import Configuration


class InvoiceLine(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 = {
        'description': 'str',
        'quantity': 'float',
        'total_ex': 'float',
        'total_incl': 'float',
        'unit': 'str',
        'unit_price': 'float',
        'vat': 'float'
    }

    attribute_map = {
        'description': 'description',
        'quantity': 'quantity',
        'total_ex': 'total_ex',
        'total_incl': 'total_incl',
        'unit': 'unit',
        'unit_price': 'unit_price',
        'vat': 'vat'
    }

    def __init__(self, description=None, quantity=None, total_ex=None, total_incl=None, unit=None, unit_price=None, vat=None, _configuration=None):  # noqa: E501
        """InvoiceLine - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._description = None
        self._quantity = None
        self._total_ex = None
        self._total_incl = None
        self._unit = None
        self._unit_price = None
        self._vat = None
        self.discriminator = None

        if description is not None:
            self.description = description
        if quantity is not None:
            self.quantity = quantity
        if total_ex is not None:
            self.total_ex = total_ex
        if total_incl is not None:
            self.total_incl = total_incl
        if unit is not None:
            self.unit = unit
        if unit_price is not None:
            self.unit_price = unit_price
        if vat is not None:
            self.vat = vat

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

        Invoice Line description  # noqa: E501

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

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

        Invoice Line description  # noqa: E501

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

        self._description = description

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

        Consumed quantity  # noqa: E501

        :return: The quantity of this InvoiceLine.  # noqa: E501
        :rtype: float
        """
        return self._quantity

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

        Consumed quantity  # noqa: E501

        :param quantity: The quantity of this InvoiceLine.  # noqa: E501
        :type: float
        """

        self._quantity = quantity

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

        Total initial price  # noqa: E501

        :return: The total_ex of this InvoiceLine.  # noqa: E501
        :rtype: float
        """
        return self._total_ex

    @total_ex.setter
    def total_ex(self, total_ex):
        """Sets the total_ex of this InvoiceLine.

        Total initial price  # noqa: E501

        :param total_ex: The total_ex of this InvoiceLine.  # noqa: E501
        :type: float
        """

        self._total_ex = total_ex

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

        Total final price  # noqa: E501

        :return: The total_incl of this InvoiceLine.  # noqa: E501
        :rtype: float
        """
        return self._total_incl

    @total_incl.setter
    def total_incl(self, total_incl):
        """Sets the total_incl of this InvoiceLine.

        Total final price  # noqa: E501

        :param total_incl: The total_incl of this InvoiceLine.  # noqa: E501
        :type: float
        """

        self._total_incl = total_incl

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


        :return: The unit of this InvoiceLine.  # noqa: E501
        :rtype: str
        """
        return self._unit

    @unit.setter
    def unit(self, unit):
        """Sets the unit of this InvoiceLine.


        :param unit: The unit of this InvoiceLine.  # noqa: E501
        :type: str
        """
        allowed_values = ["ou", "mu", "vcu", "su", "nu", "wu", "tu", "piu"]  # noqa: E501
        if (self._configuration.client_side_validation and
                unit not in allowed_values):
            raise ValueError(
                "Invalid value for `unit` ({0}), must be one of {1}"  # noqa: E501
                .format(unit, allowed_values)
            )

        self._unit = unit

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

        Unit price  # noqa: E501

        :return: The unit_price of this InvoiceLine.  # noqa: E501
        :rtype: float
        """
        return self._unit_price

    @unit_price.setter
    def unit_price(self, unit_price):
        """Sets the unit_price of this InvoiceLine.

        Unit price  # noqa: E501

        :param unit_price: The unit_price of this InvoiceLine.  # noqa: E501
        :type: float
        """

        self._unit_price = unit_price

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

        VAT amount  # noqa: E501

        :return: The vat of this InvoiceLine.  # noqa: E501
        :rtype: float
        """
        return self._vat

    @vat.setter
    def vat(self, vat):
        """Sets the vat of this InvoiceLine.

        VAT amount  # noqa: E501

        :param vat: The vat of this InvoiceLine.  # noqa: E501
        :type: float
        """

        self._vat = vat

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

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
