# coding: utf-8

"""
    Allegro REST API

    https://developer.allegro.pl/about  # noqa: E501

    OpenAPI spec version: latest
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class PriceModification(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 = {
        'type': 'str',
        'price': 'PriceModificationFixedPrice',
        'value': 'PriceModificationValueChange',
        'percentage': 'str'
    }

    attribute_map = {
        'type': 'type',
        'price': 'price',
        'value': 'value',
        'percentage': 'percentage'
    }

    def __init__(self, type=None, price=None, value=None, percentage=None):  # noqa: E501
        """PriceModification - a model defined in OpenAPI"""  # noqa: E501

        self._type = None
        self._price = None
        self._value = None
        self._percentage = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if price is not None:
            self.price = price
        if value is not None:
            self.value = value
        if percentage is not None:
            self.percentage = percentage

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

        modification type  # noqa: E501

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

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

        modification type  # noqa: E501

        :param type: The type of this PriceModification.  # noqa: E501
        :type: str
        """
        allowed_values = ["FIXED_PRICE", "INCREASE_PRICE", "DECREASE_PRICE", "INCREASE_PERCENTAGE", "DECREASE_PERCENTAGE"]  # 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 price(self):
        """Gets the price of this PriceModification.  # noqa: E501


        :return: The price of this PriceModification.  # noqa: E501
        :rtype: PriceModificationFixedPrice
        """
        return self._price

    @price.setter
    def price(self, price):
        """Sets the price of this PriceModification.


        :param price: The price of this PriceModification.  # noqa: E501
        :type: PriceModificationFixedPrice
        """

        self._price = price

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


        :return: The value of this PriceModification.  # noqa: E501
        :rtype: PriceModificationValueChange
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this PriceModification.


        :param value: The value of this PriceModification.  # noqa: E501
        :type: PriceModificationValueChange
        """

        self._value = value

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

        Percentage change of offer buy now price, related to types: INCREASE_PERCENTAGE, DECREASE_PERCENTAGE  # noqa: E501

        :return: The percentage of this PriceModification.  # noqa: E501
        :rtype: str
        """
        return self._percentage

    @percentage.setter
    def percentage(self, percentage):
        """Sets the percentage of this PriceModification.

        Percentage change of offer buy now price, related to types: INCREASE_PERCENTAGE, DECREASE_PERCENTAGE  # noqa: E501

        :param percentage: The percentage of this PriceModification.  # noqa: E501
        :type: str
        """

        self._percentage = percentage

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

        return self.__dict__ == other.__dict__

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