# coding: utf-8

"""
    Allegro REST API

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

    The version of the OpenAPI document: 2020.03.10
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from allegro_api.configuration import Configuration


class UserRating(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 = {
        'answer': 'Answer',
        'buyer': 'User',
        'comment': 'str',
        'created_at': 'datetime',
        'excluded_from_average_rates': 'bool',
        'id': 'str',
        'order': 'Order',
        'rates': 'Rates',
        'recommended': 'bool',
        'removal': 'Removal'
    }

    attribute_map = {
        'answer': 'answer',
        'buyer': 'buyer',
        'comment': 'comment',
        'created_at': 'createdAt',
        'excluded_from_average_rates': 'excludedFromAverageRates',
        'id': 'id',
        'order': 'order',
        'rates': 'rates',
        'recommended': 'recommended',
        'removal': 'removal'
    }

    def __init__(self, answer=None, buyer=None, comment=None, created_at=None, excluded_from_average_rates=None, id=None, order=None, rates=None, recommended=None, removal=None, local_vars_configuration=None):  # noqa: E501
        """UserRating - 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._answer = None
        self._buyer = None
        self._comment = None
        self._created_at = None
        self._excluded_from_average_rates = None
        self._id = None
        self._order = None
        self._rates = None
        self._recommended = None
        self._removal = None
        self.discriminator = None

        if answer is not None:
            self.answer = answer
        self.buyer = buyer
        self.comment = comment
        self.created_at = created_at
        if excluded_from_average_rates is not None:
            self.excluded_from_average_rates = excluded_from_average_rates
        self.id = id
        if order is not None:
            self.order = order
        if rates is not None:
            self.rates = rates
        self.recommended = recommended
        if removal is not None:
            self.removal = removal

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


        :return: The answer of this UserRating.  # noqa: E501
        :rtype: Answer
        """
        return self._answer

    @answer.setter
    def answer(self, answer):
        """Sets the answer of this UserRating.


        :param answer: The answer of this UserRating.  # noqa: E501
        :type: Answer
        """

        self._answer = answer

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


        :return: The buyer of this UserRating.  # noqa: E501
        :rtype: User
        """
        return self._buyer

    @buyer.setter
    def buyer(self, buyer):
        """Sets the buyer of this UserRating.


        :param buyer: The buyer of this UserRating.  # noqa: E501
        :type: User
        """
        if self.local_vars_configuration.client_side_validation and buyer is None:  # noqa: E501
            raise ValueError("Invalid value for `buyer`, must not be `None`")  # noqa: E501

        self._buyer = buyer

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

        Buyer's text comment  # noqa: E501

        :return: The comment of this UserRating.  # noqa: E501
        :rtype: str
        """
        return self._comment

    @comment.setter
    def comment(self, comment):
        """Sets the comment of this UserRating.

        Buyer's text comment  # noqa: E501

        :param comment: The comment of this UserRating.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and comment is None:  # noqa: E501
            raise ValueError("Invalid value for `comment`, must not be `None`")  # noqa: E501

        self._comment = comment

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

        Creation datetime in ISO 8601 format  # noqa: E501

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

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

        Creation datetime in ISO 8601 format  # noqa: E501

        :param created_at: The created_at of this UserRating.  # noqa: E501
        :type: datetime
        """
        if self.local_vars_configuration.client_side_validation and created_at is None:  # noqa: E501
            raise ValueError("Invalid value for `created_at`, must not be `None`")  # noqa: E501

        self._created_at = created_at

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

        If true this rating was not included in calculating average user rates  # noqa: E501

        :return: The excluded_from_average_rates of this UserRating.  # noqa: E501
        :rtype: bool
        """
        return self._excluded_from_average_rates

    @excluded_from_average_rates.setter
    def excluded_from_average_rates(self, excluded_from_average_rates):
        """Sets the excluded_from_average_rates of this UserRating.

        If true this rating was not included in calculating average user rates  # noqa: E501

        :param excluded_from_average_rates: The excluded_from_average_rates of this UserRating.  # noqa: E501
        :type: bool
        """

        self._excluded_from_average_rates = excluded_from_average_rates

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

        Rating id  # noqa: E501

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

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

        Rating id  # noqa: E501

        :param id: The id of this UserRating.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and id is None:  # noqa: E501
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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


        :return: The order of this UserRating.  # noqa: E501
        :rtype: Order
        """
        return self._order

    @order.setter
    def order(self, order):
        """Sets the order of this UserRating.


        :param order: The order of this UserRating.  # noqa: E501
        :type: Order
        """

        self._order = order

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


        :return: The rates of this UserRating.  # noqa: E501
        :rtype: Rates
        """
        return self._rates

    @rates.setter
    def rates(self, rates):
        """Sets the rates of this UserRating.


        :param rates: The rates of this UserRating.  # noqa: E501
        :type: Rates
        """

        self._rates = rates

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

        Whether buyer recommends the order  # noqa: E501

        :return: The recommended of this UserRating.  # noqa: E501
        :rtype: bool
        """
        return self._recommended

    @recommended.setter
    def recommended(self, recommended):
        """Sets the recommended of this UserRating.

        Whether buyer recommends the order  # noqa: E501

        :param recommended: The recommended of this UserRating.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and recommended is None:  # noqa: E501
            raise ValueError("Invalid value for `recommended`, must not be `None`")  # noqa: E501

        self._recommended = recommended

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


        :return: The removal of this UserRating.  # noqa: E501
        :rtype: Removal
        """
        return self._removal

    @removal.setter
    def removal(self, removal):
        """Sets the removal of this UserRating.


        :param removal: The removal of this UserRating.  # noqa: E501
        :type: Removal
        """

        self._removal = removal

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

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