# coding: utf-8

"""
    Literature Graph Service

    Fetch paper and author data from the Semantic Scholar corpus

    OpenAPI spec version: 1.0

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import six

from s2cholar.configuration import Configuration


class Citation(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 = {
        'contexts': 'object',
        'intents': 'object',
        'is_influential': 'bool',
        'citing_paper': 'CitationCitingPaper'
    }

    attribute_map = {
        'contexts': 'contexts',
        'intents': 'intents',
        'is_influential': 'isInfluential',
        'citing_paper': 'citingPaper'
    }

    def __init__(self, contexts=None, intents=None, is_influential=None, citing_paper=None, _configuration=None):
        """Citation - a model defined in Swagger"""
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._contexts = None
        self._intents = None
        self._is_influential = None
        self._citing_paper = None
        self.discriminator = None

        if contexts is not None:
            self.contexts = contexts
        if intents is not None:
            self.intents = intents
        if is_influential is not None:
            self.is_influential = is_influential
        self.citing_paper = citing_paper

    @property
    def contexts(self):
        """Gets the contexts of this Citation.

        List of contexts

        Returns
            object: The contexts of this Citation.
        """
        return self._contexts

    @contexts.setter
    def contexts(self, contexts):
        """Sets the contexts of this Citation.

        List of contexts

        Params
            contexts (object): The contexts of this Citation.
        """

        self._contexts = contexts

    @property
    def intents(self):
        """Gets the intents of this Citation.

        List of intents

        Returns
            object: The intents of this Citation.
        """
        return self._intents

    @intents.setter
    def intents(self, intents):
        """Sets the intents of this Citation.

        List of intents

        Params
            intents (object): The intents of this Citation.
        """

        self._intents = intents

    @property
    def is_influential(self):
        """Gets the is_influential of this Citation.

        https://www.semanticscholar.org/faq#influential-citations

        Returns
            bool: The is_influential of this Citation.
        """
        return self._is_influential

    @is_influential.setter
    def is_influential(self, is_influential):
        """Sets the is_influential of this Citation.

        https://www.semanticscholar.org/faq#influential-citations

        Params
            is_influential (bool): The is_influential of this Citation.
        """

        self._is_influential = is_influential

    @property
    def citing_paper(self):
        """Gets the citing_paper of this Citation.

        Returns:
            CitationCitingPaper: The citing_paper of this Citation.
        """
        return self._citing_paper

    @citing_paper.setter
    def citing_paper(self, citing_paper):
        """Sets the citing_paper of this Citation.

        Params
            citing_paper (CitationCitingPaper): The citing_paper of this
                Citation.
        """
        if self._configuration.client_side_validation and citing_paper is None:
            raise ValueError(
                "Invalid value for `citing_paper`, must not be `None`"
            )

        self._citing_paper = citing_paper

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

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