# coding: utf-8

"""
    PirlPay API

    The PirlPay API for automated payment processing  # noqa: E501

    OpenAPI spec version: v1
    Contact: support@pirl.io
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class ProductTransaction(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 = {
        'id': 'str',
        'product': 'str',
        'quantity': 'int',
        'unit_price': 'float'
    }

    attribute_map = {
        'id': 'id',
        'product': 'product',
        'quantity': 'quantity',
        'unit_price': 'unit_price'
    }

    def __init__(self, id=None, product=None, quantity=None, unit_price=None):  # noqa: E501
        """ProductTransaction - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._product = None
        self._quantity = None
        self._unit_price = None
        self.discriminator = None
        if id is not None:
            self.id = id
        if product is not None:
            self.product = product
        self.quantity = quantity
        self.unit_price = unit_price

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


        :return: The id of this ProductTransaction.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this ProductTransaction.


        :param id: The id of this ProductTransaction.  # noqa: E501
        :type: str
        """

        self._id = id

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

        the product that were billed  # noqa: E501

        :return: The product of this ProductTransaction.  # noqa: E501
        :rtype: str
        """
        return self._product

    @product.setter
    def product(self, product):
        """Sets the product of this ProductTransaction.

        the product that were billed  # noqa: E501

        :param product: The product of this ProductTransaction.  # noqa: E501
        :type: str
        """

        self._product = product

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


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

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


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

        the unit price in FIAT for the product  # noqa: E501

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

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

        the unit price in FIAT for the product  # noqa: E501

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

        self._unit_price = unit_price

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

        return self.__dict__ == other.__dict__

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