# coding: utf-8

"""
    CMS Contribution API

    The CMS Contribution API allows access and modification of Lumapps contents.   # noqa: E501

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

import pprint
import re  # noqa: F401

import six

from .base_block import BaseBlock  # noqa: F401,E501


class BlockVotes(BaseBlock):
    """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 = {
        "resource_type": "str",
        "resource_id": "str",
        "up_votes": "int",
        "down_votes": "int",
        "user_vote": "str",
    }
    if hasattr(BaseBlock, "swagger_types"):
        swagger_types.update(BaseBlock.swagger_types)

    attribute_map = {
        "resource_type": "resourceType",
        "resource_id": "resourceId",
        "up_votes": "upVotes",
        "down_votes": "downVotes",
        "user_vote": "userVote",
    }
    if hasattr(BaseBlock, "attribute_map"):
        attribute_map.update(BaseBlock.attribute_map)

    def __init__(
        self,
        resource_type=None,
        resource_id=None,
        up_votes=None,
        down_votes=None,
        user_vote=None,
        *args,
        **kwargs
    ):  # noqa: E501
        """BlockVotes - a model defined in Swagger"""  # noqa: E501
        self._resource_type = None
        self._resource_id = None
        self._up_votes = None
        self._down_votes = None
        self._user_vote = None
        self.discriminator = None
        self.resource_type = resource_type
        self.resource_id = resource_id
        self.up_votes = up_votes
        self.down_votes = down_votes
        self.user_vote = user_vote
        BaseBlock.__init__(self, *args, **kwargs)

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

        The type of the associated resource.  # noqa: E501

        :return: The resource_type of this BlockVotes.  # noqa: E501
        :rtype: str
        """
        return self._resource_type

    @resource_type.setter
    def resource_type(self, resource_type):
        """Sets the resource_type of this BlockVotes.

        The type of the associated resource.  # noqa: E501

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

        self._resource_type = resource_type

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

        The id of the associated resource.  # noqa: E501

        :return: The resource_id of this BlockVotes.  # noqa: E501
        :rtype: str
        """
        return self._resource_id

    @resource_id.setter
    def resource_id(self, resource_id):
        """Sets the resource_id of this BlockVotes.

        The id of the associated resource.  # noqa: E501

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

        self._resource_id = resource_id

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

        The number of upvotes for the associated resource.  # noqa: E501

        :return: The up_votes of this BlockVotes.  # noqa: E501
        :rtype: int
        """
        return self._up_votes

    @up_votes.setter
    def up_votes(self, up_votes):
        """Sets the up_votes of this BlockVotes.

        The number of upvotes for the associated resource.  # noqa: E501

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

        self._up_votes = up_votes

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

        The number of downvotes for the associated resource.  # noqa: E501

        :return: The down_votes of this BlockVotes.  # noqa: E501
        :rtype: int
        """
        return self._down_votes

    @down_votes.setter
    def down_votes(self, down_votes):
        """Sets the down_votes of this BlockVotes.

        The number of downvotes for the associated resource.  # noqa: E501

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

        self._down_votes = down_votes

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

        The user vote for the associated resource.  # noqa: E501

        :return: The user_vote of this BlockVotes.  # noqa: E501
        :rtype: str
        """
        return self._user_vote

    @user_vote.setter
    def user_vote(self, user_vote):
        """Sets the user_vote of this BlockVotes.

        The user vote for the associated resource.  # noqa: E501

        :param user_vote: The user_vote of this BlockVotes.  # noqa: E501
        :type: str
        """
        if user_vote is None:
            raise ValueError(
                "Invalid value for `user_vote`, must not be `None`"
            )  # noqa: E501
        allowed_values = ["NONE", "UP", "DOWN"]  # noqa: E501
        if user_vote not in allowed_values:
            raise ValueError(
                "Invalid value for `user_vote` ({0}), must be one of {1}".format(  # noqa: E501
                    user_vote, allowed_values
                )
            )

        self._user_vote = user_vote

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

        return self.__dict__ == other.__dict__

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