# 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 pprint import pformat
from six import iteritems


class FlowSearchRequest(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        FlowSearchRequest - 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 = {
            'search_phrase': 'str',
            'page_number': 'int',
            'page_size': 'int',
            'search_fields': 'list[str]',
            'facet_requests': 'list[FacetRequest]',
            'sort': 'list[SortField]',
            'filters': 'list[FilterItem]'
        }

        self.attribute_map = {
            'search_phrase': 'searchPhrase',
            'page_number': 'pageNumber',
            'page_size': 'pageSize',
            'search_fields': 'searchFields',
            'facet_requests': 'facetRequests',
            'sort': 'sort',
            'filters': 'filters'
        }

        self._search_phrase = None
        self._page_number = None
        self._page_size = None
        self._search_fields = None
        self._facet_requests = None
        self._sort = None
        self._filters = None

    @property
    def search_phrase(self):
        """
        Gets the search_phrase of this FlowSearchRequest.
        The search text to look for

        :return: The search_phrase of this FlowSearchRequest.
        :rtype: str
        """
        return self._search_phrase

    @search_phrase.setter
    def search_phrase(self, search_phrase):
        """
        Sets the search_phrase of this FlowSearchRequest.
        The search text to look for

        :param search_phrase: The search_phrase of this FlowSearchRequest.
        :type: str
        """
        self._search_phrase = search_phrase

    @property
    def page_number(self):
        """
        Gets the page_number of this FlowSearchRequest.
        The pageNumber to get results from (EG If there are 100 results with a pageSize of 10 and pageNumber is 3 then 10 results will be returned starting with index #31

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

    @page_number.setter
    def page_number(self, page_number):
        """
        Sets the page_number of this FlowSearchRequest.
        The pageNumber to get results from (EG If there are 100 results with a pageSize of 10 and pageNumber is 3 then 10 results will be returned starting with index #31

        :param page_number: The page_number of this FlowSearchRequest.
        :type: int
        """
        self._page_number = page_number

    @property
    def page_size(self):
        """
        Gets the page_size of this FlowSearchRequest.
        Number of entries to return/calculate per page.

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

    @page_size.setter
    def page_size(self, page_size):
        """
        Sets the page_size of this FlowSearchRequest.
        Number of entries to return/calculate per page.

        :param page_size: The page_size of this FlowSearchRequest.
        :type: int
        """
        self._page_size = page_size

    @property
    def search_fields(self):
        """
        Gets the search_fields of this FlowSearchRequest.
        The fields to limit the searchPhrase search to

        :return: The search_fields of this FlowSearchRequest.
        :rtype: list[str]
        """
        return self._search_fields

    @search_fields.setter
    def search_fields(self, search_fields):
        """
        Sets the search_fields of this FlowSearchRequest.
        The fields to limit the searchPhrase search to

        :param search_fields: The search_fields of this FlowSearchRequest.
        :type: list[str]
        """
        self._search_fields = search_fields

    @property
    def facet_requests(self):
        """
        Gets the facet_requests of this FlowSearchRequest.
        List of facet requests to generate summary views from the search result set (if any)

        :return: The facet_requests of this FlowSearchRequest.
        :rtype: list[FacetRequest]
        """
        return self._facet_requests

    @facet_requests.setter
    def facet_requests(self, facet_requests):
        """
        Sets the facet_requests of this FlowSearchRequest.
        List of facet requests to generate summary views from the search result set (if any)

        :param facet_requests: The facet_requests of this FlowSearchRequest.
        :type: list[FacetRequest]
        """
        self._facet_requests = facet_requests

    @property
    def sort(self):
        """
        Gets the sort of this FlowSearchRequest.
        sort the results on a field(s)

        :return: The sort of this FlowSearchRequest.
        :rtype: list[SortField]
        """
        return self._sort

    @sort.setter
    def sort(self, sort):
        """
        Sets the sort of this FlowSearchRequest.
        sort the results on a field(s)

        :param sort: The sort of this FlowSearchRequest.
        :type: list[SortField]
        """
        self._sort = sort

    @property
    def filters(self):
        """
        Gets the filters of this FlowSearchRequest.
        You can also restrict the search to particular field values and ranges

        :return: The filters of this FlowSearchRequest.
        :rtype: list[FilterItem]
        """
        return self._filters

    @filters.setter
    def filters(self, filters):
        """
        Sets the filters of this FlowSearchRequest.
        You can also restrict the search to particular field values and ranges

        :param filters: The filters of this FlowSearchRequest.
        :type: list[FilterItem]
        """
        self._filters = filters

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

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

