# coding: utf-8

"""
    VeeRoute.UD

    VeeRoute.UD API  # noqa: E501

    The version of the OpenAPI document: 2.8.161005
    Contact: support@veeroute.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from vrt_ud.configuration import Configuration


class MerchandiseLine(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'goods_name': 'str',
        'goods_unit_name': 'str',
        'goods_unit_price': 'float',
        'goods_amount': 'int',
        'goods_value': 'float',
        'vat_rate': 'str',
        'barcode': 'str',
        'fact_time': 'datetime'
    }

    attribute_map = {
        'goods_name': 'goods_name',
        'goods_unit_name': 'goods_unit_name',
        'goods_unit_price': 'goods_unit_price',
        'goods_amount': 'goods_amount',
        'goods_value': 'goods_value',
        'vat_rate': 'vat_rate',
        'barcode': 'barcode',
        'fact_time': 'fact_time'
    }

    def __init__(self, goods_name=None, goods_unit_name=None, goods_unit_price=None, goods_amount=None, goods_value=None, vat_rate='VAT0000', barcode=None, fact_time=None, local_vars_configuration=None):  # noqa: E501
        """MerchandiseLine - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._goods_name = None
        self._goods_unit_name = None
        self._goods_unit_price = None
        self._goods_amount = None
        self._goods_value = None
        self._vat_rate = None
        self._barcode = None
        self._fact_time = None
        self.discriminator = None

        self.goods_name = goods_name
        if goods_unit_name is not None:
            self.goods_unit_name = goods_unit_name
        self.goods_unit_price = goods_unit_price
        self.goods_amount = goods_amount
        if goods_value is not None:
            self.goods_value = goods_value
        self.vat_rate = vat_rate
        if barcode is not None:
            self.barcode = barcode
        if fact_time is not None:
            self.fact_time = fact_time

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

        Product name.  # noqa: E501

        :return: The goods_name of this MerchandiseLine.  # noqa: E501
        :rtype: str
        """
        return self._goods_name

    @goods_name.setter
    def goods_name(self, goods_name):
        """Sets the goods_name of this MerchandiseLine.

        Product name.  # noqa: E501

        :param goods_name: The goods_name of this MerchandiseLine.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and goods_name is None:  # noqa: E501
            raise ValueError("Invalid value for `goods_name`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                goods_name is not None and len(goods_name) > 1000):
            raise ValueError("Invalid value for `goods_name`, length must be less than or equal to `1000`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                goods_name is not None and len(goods_name) < 1):
            raise ValueError("Invalid value for `goods_name`, length must be greater than or equal to `1`")  # noqa: E501

        self._goods_name = goods_name

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

        Product unit name.  # noqa: E501

        :return: The goods_unit_name of this MerchandiseLine.  # noqa: E501
        :rtype: str
        """
        return self._goods_unit_name

    @goods_unit_name.setter
    def goods_unit_name(self, goods_unit_name):
        """Sets the goods_unit_name of this MerchandiseLine.

        Product unit name.  # noqa: E501

        :param goods_unit_name: The goods_unit_name of this MerchandiseLine.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                goods_unit_name is not None and len(goods_unit_name) > 1000):
            raise ValueError("Invalid value for `goods_unit_name`, length must be less than or equal to `1000`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                goods_unit_name is not None and len(goods_unit_name) < 1):
            raise ValueError("Invalid value for `goods_unit_name`, length must be greater than or equal to `1`")  # noqa: E501

        self._goods_unit_name = goods_unit_name

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

        Unit price.  # noqa: E501

        :return: The goods_unit_price of this MerchandiseLine.  # noqa: E501
        :rtype: float
        """
        return self._goods_unit_price

    @goods_unit_price.setter
    def goods_unit_price(self, goods_unit_price):
        """Sets the goods_unit_price of this MerchandiseLine.

        Unit price.  # noqa: E501

        :param goods_unit_price: The goods_unit_price of this MerchandiseLine.  # noqa: E501
        :type: float
        """
        if self.local_vars_configuration.client_side_validation and goods_unit_price is None:  # noqa: E501
            raise ValueError("Invalid value for `goods_unit_price`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                goods_unit_price is not None and goods_unit_price < 0):  # noqa: E501
            raise ValueError("Invalid value for `goods_unit_price`, must be a value greater than or equal to `0`")  # noqa: E501

        self._goods_unit_price = goods_unit_price

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

        Product amount.  # noqa: E501

        :return: The goods_amount of this MerchandiseLine.  # noqa: E501
        :rtype: int
        """
        return self._goods_amount

    @goods_amount.setter
    def goods_amount(self, goods_amount):
        """Sets the goods_amount of this MerchandiseLine.

        Product amount.  # noqa: E501

        :param goods_amount: The goods_amount of this MerchandiseLine.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and goods_amount is None:  # noqa: E501
            raise ValueError("Invalid value for `goods_amount`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                goods_amount is not None and goods_amount > 10000):  # noqa: E501
            raise ValueError("Invalid value for `goods_amount`, must be a value less than or equal to `10000`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                goods_amount is not None and goods_amount < 1):  # noqa: E501
            raise ValueError("Invalid value for `goods_amount`, must be a value greater than or equal to `1`")  # noqa: E501

        self._goods_amount = goods_amount

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

        Product value.  # noqa: E501

        :return: The goods_value of this MerchandiseLine.  # noqa: E501
        :rtype: float
        """
        return self._goods_value

    @goods_value.setter
    def goods_value(self, goods_value):
        """Sets the goods_value of this MerchandiseLine.

        Product value.  # noqa: E501

        :param goods_value: The goods_value of this MerchandiseLine.  # noqa: E501
        :type: float
        """
        if (self.local_vars_configuration.client_side_validation and
                goods_value is not None and goods_value < 0):  # noqa: E501
            raise ValueError("Invalid value for `goods_value`, must be a value greater than or equal to `0`")  # noqa: E501

        self._goods_value = goods_value

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

        Tax.  # noqa: E501

        :return: The vat_rate of this MerchandiseLine.  # noqa: E501
        :rtype: str
        """
        return self._vat_rate

    @vat_rate.setter
    def vat_rate(self, vat_rate):
        """Sets the vat_rate of this MerchandiseLine.

        Tax.  # noqa: E501

        :param vat_rate: The vat_rate of this MerchandiseLine.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and vat_rate is None:  # noqa: E501
            raise ValueError("Invalid value for `vat_rate`, must not be `None`")  # noqa: E501
        allowed_values = ["", "VAT0000", "VAT1000", "VAT1800", "VAT2000"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and vat_rate not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `vat_rate` ({0}), must be one of {1}"  # noqa: E501
                .format(vat_rate, allowed_values)
            )

        self._vat_rate = vat_rate

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

        Barcode.  # noqa: E501

        :return: The barcode of this MerchandiseLine.  # noqa: E501
        :rtype: str
        """
        return self._barcode

    @barcode.setter
    def barcode(self, barcode):
        """Sets the barcode of this MerchandiseLine.

        Barcode.  # noqa: E501

        :param barcode: The barcode of this MerchandiseLine.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                barcode is not None and len(barcode) > 1000):
            raise ValueError("Invalid value for `barcode`, length must be less than or equal to `1000`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                barcode is not None and len(barcode) < 1):
            raise ValueError("Invalid value for `barcode`, length must be greater than or equal to `1`")  # noqa: E501

        self._barcode = barcode

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

        Fact time in the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format.  # noqa: E501

        :return: The fact_time of this MerchandiseLine.  # noqa: E501
        :rtype: datetime
        """
        return self._fact_time

    @fact_time.setter
    def fact_time(self, fact_time):
        """Sets the fact_time of this MerchandiseLine.

        Fact time in the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format.  # noqa: E501

        :param fact_time: The fact_time of this MerchandiseLine.  # noqa: E501
        :type: datetime
        """

        self._fact_time = fact_time

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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

        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, MerchandiseLine):
            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, MerchandiseLine):
            return True

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