# coding: utf-8

"""
    ProWritingAid API V2

    Official ProWritingAid API Version 2

    OpenAPI spec version: v2
    Contact: hello@prowritingaid.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class ContextualThesaurusRequest(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 = {
        'context': 'str',
        'context_start': 'int',
        'context_end': 'int'
    }

    attribute_map = {
        'context': 'Context',
        'context_start': 'ContextStart',
        'context_end': 'ContextEnd'
    }

    def __init__(self, context=None, context_start=None, context_end=8):
        """
        ContextualThesaurusRequest - a model defined in Swagger
        """

        self._context = None
        self._context_start = None
        self._context_end = None

        self.context = context
        self.context_start = context_start
        self.context_end = context_end

    @property
    def context(self):
        """
        Gets the context of this ContextualThesaurusRequest.
        the word for the thesaurus call with surrounding context

        :return: The context of this ContextualThesaurusRequest.
        :rtype: str
        """
        return self._context

    @context.setter
    def context(self, context):
        """
        Sets the context of this ContextualThesaurusRequest.
        the word for the thesaurus call with surrounding context

        :param context: The context of this ContextualThesaurusRequest.
        :type: str
        """
        if context is None:
            raise ValueError("Invalid value for `context`, must not be `None`")

        self._context = context

    @property
    def context_start(self):
        """
        Gets the context_start of this ContextualThesaurusRequest.
        the start position of the word to get suggestions for. 0 based

        :return: The context_start of this ContextualThesaurusRequest.
        :rtype: int
        """
        return self._context_start

    @context_start.setter
    def context_start(self, context_start):
        """
        Sets the context_start of this ContextualThesaurusRequest.
        the start position of the word to get suggestions for. 0 based

        :param context_start: The context_start of this ContextualThesaurusRequest.
        :type: int
        """
        if context_start is None:
            raise ValueError("Invalid value for `context_start`, must not be `None`")

        self._context_start = context_start

    @property
    def context_end(self):
        """
        Gets the context_end of this ContextualThesaurusRequest.
        the end position of the word to get suggestions for. 0 based. Would be the same as the start pos for a 1 letter word

        :return: The context_end of this ContextualThesaurusRequest.
        :rtype: int
        """
        return self._context_end

    @context_end.setter
    def context_end(self, context_end):
        """
        Sets the context_end of this ContextualThesaurusRequest.
        the end position of the word to get suggestions for. 0 based. Would be the same as the start pos for a 1 letter word

        :param context_end: The context_end of this ContextualThesaurusRequest.
        :type: int
        """
        if context_end is None:
            raise ValueError("Invalid value for `context_end`, must not be `None`")

        self._context_end = context_end

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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, ContextualThesaurusRequest):
            return False

        return self.__dict__ == other.__dict__

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