# coding: utf-8

"""
Copyright 2017 Square, Inc.

    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.
"""


from pprint import pformat
from six import iteritems
import re


class SearchCatalogObjectsRequest(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, cursor=None, object_types=None, include_deleted_objects=None, include_related_objects=None, begin_time=None, query=None, limit=None):
        """
        SearchCatalogObjectsRequest - 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 = {
            'cursor': 'str',
            'object_types': 'list[str]',
            'include_deleted_objects': 'bool',
            'include_related_objects': 'bool',
            'begin_time': 'str',
            'query': 'CatalogQuery',
            'limit': 'int'
        }

        self.attribute_map = {
            'cursor': 'cursor',
            'object_types': 'object_types',
            'include_deleted_objects': 'include_deleted_objects',
            'include_related_objects': 'include_related_objects',
            'begin_time': 'begin_time',
            'query': 'query',
            'limit': 'limit'
        }

        self._cursor = cursor
        self._object_types = object_types
        self._include_deleted_objects = include_deleted_objects
        self._include_related_objects = include_related_objects
        self._begin_time = begin_time
        self._query = query
        self._limit = limit

    @property
    def cursor(self):
        """
        Gets the cursor of this SearchCatalogObjectsRequest.
        The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information.

        :return: The cursor of this SearchCatalogObjectsRequest.
        :rtype: str
        """
        return self._cursor

    @cursor.setter
    def cursor(self, cursor):
        """
        Sets the cursor of this SearchCatalogObjectsRequest.
        The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information.

        :param cursor: The cursor of this SearchCatalogObjectsRequest.
        :type: str
        """

        self._cursor = cursor

    @property
    def object_types(self):
        """
        Gets the object_types of this SearchCatalogObjectsRequest.
        The desired set of object types to appear in the search results. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. See [CatalogObjectType](#type-catalogobjecttype) for possible values

        :return: The object_types of this SearchCatalogObjectsRequest.
        :rtype: list[str]
        """
        return self._object_types

    @object_types.setter
    def object_types(self, object_types):
        """
        Sets the object_types of this SearchCatalogObjectsRequest.
        The desired set of object types to appear in the search results. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. See [CatalogObjectType](#type-catalogobjecttype) for possible values

        :param object_types: The object_types of this SearchCatalogObjectsRequest.
        :type: list[str]
        """

        self._object_types = object_types

    @property
    def include_deleted_objects(self):
        """
        Gets the include_deleted_objects of this SearchCatalogObjectsRequest.
        If `true`, deleted objects will be included in the results. Deleted objects will have their `is_deleted` field set to `true`.

        :return: The include_deleted_objects of this SearchCatalogObjectsRequest.
        :rtype: bool
        """
        return self._include_deleted_objects

    @include_deleted_objects.setter
    def include_deleted_objects(self, include_deleted_objects):
        """
        Sets the include_deleted_objects of this SearchCatalogObjectsRequest.
        If `true`, deleted objects will be included in the results. Deleted objects will have their `is_deleted` field set to `true`.

        :param include_deleted_objects: The include_deleted_objects of this SearchCatalogObjectsRequest.
        :type: bool
        """

        self._include_deleted_objects = include_deleted_objects

    @property
    def include_related_objects(self):
        """
        Gets the include_related_objects of this SearchCatalogObjectsRequest.
        If `true`, the response will include additional objects that are related to the requested object, as follows:  If a [CatalogItem](#type-catalogitem) is returned in the object field of the response, its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, [CatalogImage](#type-catalogimage)s and [CatalogModifierList](#type-catalogmodifierlist)s will be included in the `related_objects` field of the response.  If a [CatalogItemVariation](#type-catalogitemvariation) is returned in the object field of the response, its parent [CatalogItem](#type-catalogitem) will be included in the `related_objects` field of the response.

        :return: The include_related_objects of this SearchCatalogObjectsRequest.
        :rtype: bool
        """
        return self._include_related_objects

    @include_related_objects.setter
    def include_related_objects(self, include_related_objects):
        """
        Sets the include_related_objects of this SearchCatalogObjectsRequest.
        If `true`, the response will include additional objects that are related to the requested object, as follows:  If a [CatalogItem](#type-catalogitem) is returned in the object field of the response, its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, [CatalogImage](#type-catalogimage)s and [CatalogModifierList](#type-catalogmodifierlist)s will be included in the `related_objects` field of the response.  If a [CatalogItemVariation](#type-catalogitemvariation) is returned in the object field of the response, its parent [CatalogItem](#type-catalogitem) will be included in the `related_objects` field of the response.

        :param include_related_objects: The include_related_objects of this SearchCatalogObjectsRequest.
        :type: bool
        """

        self._include_related_objects = include_related_objects

    @property
    def begin_time(self):
        """
        Gets the begin_time of this SearchCatalogObjectsRequest.
        Return objects modified after this [timestamp](#workingwithdates), in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". The timestamp is exclusive - objects with a timestamp equal to `begin_time` will not be included in the response.

        :return: The begin_time of this SearchCatalogObjectsRequest.
        :rtype: str
        """
        return self._begin_time

    @begin_time.setter
    def begin_time(self, begin_time):
        """
        Sets the begin_time of this SearchCatalogObjectsRequest.
        Return objects modified after this [timestamp](#workingwithdates), in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". The timestamp is exclusive - objects with a timestamp equal to `begin_time` will not be included in the response.

        :param begin_time: The begin_time of this SearchCatalogObjectsRequest.
        :type: str
        """

        self._begin_time = begin_time

    @property
    def query(self):
        """
        Gets the query of this SearchCatalogObjectsRequest.
        A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned.

        :return: The query of this SearchCatalogObjectsRequest.
        :rtype: CatalogQuery
        """
        return self._query

    @query.setter
    def query(self, query):
        """
        Sets the query of this SearchCatalogObjectsRequest.
        A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned.

        :param query: The query of this SearchCatalogObjectsRequest.
        :type: CatalogQuery
        """

        self._query = query

    @property
    def limit(self):
        """
        Gets the limit of this SearchCatalogObjectsRequest.
        A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored.

        :return: The limit of this SearchCatalogObjectsRequest.
        :rtype: int
        """
        return self._limit

    @limit.setter
    def limit(self, limit):
        """
        Sets the limit of this SearchCatalogObjectsRequest.
        A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored.

        :param limit: The limit of this SearchCatalogObjectsRequest.
        :type: int
        """

        self._limit = limit

    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
