# coding: utf-8

"""
Copyright 2016 SmartBear Software

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    Ref: https://github.com/swagger-api/swagger-codegen
"""

from datetime import datetime
from datetime import date
from pprint import pformat
from six import iteritems
import re
import json

from ..utils import sanitize_for_serialization

# type hinting support
from typing import TYPE_CHECKING
from typing import List
from typing import Dict

if TYPE_CHECKING:
    from . import KnowledgeGuestSessionApp

class KnowledgeDocumentGuestSearchRequest(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self) -> None:
        """
        KnowledgeDocumentGuestSearchRequest - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'query': 'str',
            'page_size': 'int',
            'page_number': 'int',
            'search_id': 'str',
            'total': 'int',
            'page_count': 'int',
            'query_type': 'str',
            'session_id': 'str',
            'include_draft_documents': 'bool',
            'app': 'KnowledgeGuestSessionApp'
        }

        self.attribute_map = {
            'query': 'query',
            'page_size': 'pageSize',
            'page_number': 'pageNumber',
            'search_id': 'searchId',
            'total': 'total',
            'page_count': 'pageCount',
            'query_type': 'queryType',
            'session_id': 'sessionId',
            'include_draft_documents': 'includeDraftDocuments',
            'app': 'app'
        }

        self._query = None
        self._page_size = None
        self._page_number = None
        self._search_id = None
        self._total = None
        self._page_count = None
        self._query_type = None
        self._session_id = None
        self._include_draft_documents = None
        self._app = None

    @property
    def query(self) -> str:
        """
        Gets the query of this KnowledgeDocumentGuestSearchRequest.
        Query to search content in the knowledge base. Maximum of 30 records per query can be fetched.

        :return: The query of this KnowledgeDocumentGuestSearchRequest.
        :rtype: str
        """
        return self._query

    @query.setter
    def query(self, query: str) -> None:
        """
        Sets the query of this KnowledgeDocumentGuestSearchRequest.
        Query to search content in the knowledge base. Maximum of 30 records per query can be fetched.

        :param query: The query of this KnowledgeDocumentGuestSearchRequest.
        :type: str
        """
        
        if len(query) > 2147483647:
            raise ValueError("Invalid value for `query`, length must be less than `2147483647`")

        if len(query) < 3:
            raise ValueError("Invalid value for `query`, length must be greater than or equal to `3`")


        self._query = query

    @property
    def page_size(self) -> int:
        """
        Gets the page_size of this KnowledgeDocumentGuestSearchRequest.
        Page size of the returned results.

        :return: The page_size of this KnowledgeDocumentGuestSearchRequest.
        :rtype: int
        """
        return self._page_size

    @page_size.setter
    def page_size(self, page_size: int) -> None:
        """
        Sets the page_size of this KnowledgeDocumentGuestSearchRequest.
        Page size of the returned results.

        :param page_size: The page_size of this KnowledgeDocumentGuestSearchRequest.
        :type: int
        """
        

        self._page_size = page_size

    @property
    def page_number(self) -> int:
        """
        Gets the page_number of this KnowledgeDocumentGuestSearchRequest.
        Page number of the returned results.

        :return: The page_number of this KnowledgeDocumentGuestSearchRequest.
        :rtype: int
        """
        return self._page_number

    @page_number.setter
    def page_number(self, page_number: int) -> None:
        """
        Sets the page_number of this KnowledgeDocumentGuestSearchRequest.
        Page number of the returned results.

        :param page_number: The page_number of this KnowledgeDocumentGuestSearchRequest.
        :type: int
        """
        

        self._page_number = page_number

    @property
    def search_id(self) -> str:
        """
        Gets the search_id of this KnowledgeDocumentGuestSearchRequest.
        The globally unique identifier for the search.

        :return: The search_id of this KnowledgeDocumentGuestSearchRequest.
        :rtype: str
        """
        return self._search_id

    @search_id.setter
    def search_id(self, search_id: str) -> None:
        """
        Sets the search_id of this KnowledgeDocumentGuestSearchRequest.
        The globally unique identifier for the search.

        :param search_id: The search_id of this KnowledgeDocumentGuestSearchRequest.
        :type: str
        """
        

        self._search_id = search_id

    @property
    def total(self) -> int:
        """
        Gets the total of this KnowledgeDocumentGuestSearchRequest.
        The total number of documents matching the query.

        :return: The total of this KnowledgeDocumentGuestSearchRequest.
        :rtype: int
        """
        return self._total

    @total.setter
    def total(self, total: int) -> None:
        """
        Sets the total of this KnowledgeDocumentGuestSearchRequest.
        The total number of documents matching the query.

        :param total: The total of this KnowledgeDocumentGuestSearchRequest.
        :type: int
        """
        

        self._total = total

    @property
    def page_count(self) -> int:
        """
        Gets the page_count of this KnowledgeDocumentGuestSearchRequest.
        Number of pages returned in the result calculated according to the pageSize and the total

        :return: The page_count of this KnowledgeDocumentGuestSearchRequest.
        :rtype: int
        """
        return self._page_count

    @page_count.setter
    def page_count(self, page_count: int) -> None:
        """
        Sets the page_count of this KnowledgeDocumentGuestSearchRequest.
        Number of pages returned in the result calculated according to the pageSize and the total

        :param page_count: The page_count of this KnowledgeDocumentGuestSearchRequest.
        :type: int
        """
        

        self._page_count = page_count

    @property
    def query_type(self) -> str:
        """
        Gets the query_type of this KnowledgeDocumentGuestSearchRequest.
        The type of the query that initiates the search.

        :return: The query_type of this KnowledgeDocumentGuestSearchRequest.
        :rtype: str
        """
        return self._query_type

    @query_type.setter
    def query_type(self, query_type: str) -> None:
        """
        Sets the query_type of this KnowledgeDocumentGuestSearchRequest.
        The type of the query that initiates the search.

        :param query_type: The query_type of this KnowledgeDocumentGuestSearchRequest.
        :type: str
        """
        allowed_values = ["AutoSearch", "ManualSearch", "Suggestion"]
        if query_type.lower() not in map(str.lower, allowed_values):
            # print("Invalid value for query_type -> " + query_type)
            self._query_type = "outdated_sdk_version"
        else:
            self._query_type = query_type

    @property
    def session_id(self) -> str:
        """
        Gets the session_id of this KnowledgeDocumentGuestSearchRequest.
        Session ID of the search.

        :return: The session_id of this KnowledgeDocumentGuestSearchRequest.
        :rtype: str
        """
        return self._session_id

    @session_id.setter
    def session_id(self, session_id: str) -> None:
        """
        Sets the session_id of this KnowledgeDocumentGuestSearchRequest.
        Session ID of the search.

        :param session_id: The session_id of this KnowledgeDocumentGuestSearchRequest.
        :type: str
        """
        

        self._session_id = session_id

    @property
    def include_draft_documents(self) -> bool:
        """
        Gets the include_draft_documents of this KnowledgeDocumentGuestSearchRequest.
        Indicates whether the search results would also include draft documents.

        :return: The include_draft_documents of this KnowledgeDocumentGuestSearchRequest.
        :rtype: bool
        """
        return self._include_draft_documents

    @include_draft_documents.setter
    def include_draft_documents(self, include_draft_documents: bool) -> None:
        """
        Sets the include_draft_documents of this KnowledgeDocumentGuestSearchRequest.
        Indicates whether the search results would also include draft documents.

        :param include_draft_documents: The include_draft_documents of this KnowledgeDocumentGuestSearchRequest.
        :type: bool
        """
        

        self._include_draft_documents = include_draft_documents

    @property
    def app(self) -> 'KnowledgeGuestSessionApp':
        """
        Gets the app of this KnowledgeDocumentGuestSearchRequest.
        The app where the session is started.

        :return: The app of this KnowledgeDocumentGuestSearchRequest.
        :rtype: KnowledgeGuestSessionApp
        """
        return self._app

    @app.setter
    def app(self, app: 'KnowledgeGuestSessionApp') -> None:
        """
        Sets the app of this KnowledgeDocumentGuestSearchRequest.
        The app where the session is started.

        :param app: The app of this KnowledgeDocumentGuestSearchRequest.
        :type: KnowledgeGuestSessionApp
        """
        

        self._app = app

    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_json(self):
        """
        Returns the model as raw JSON
        """
        return json.dumps(sanitize_for_serialization(self.to_dict()))

    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
        """
        return self.__dict__ == other.__dict__

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

