# coding: utf-8

"""
    Selling Partner API for Catalog Items

    Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog.  For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).

    The version of the OpenAPI document: 2022-04-01
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class ItemSearchResults(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 = {
        'number_of_results': 'int',
        'pagination': 'Pagination',
        'refinements': 'Refinements',
        'items': 'List[Item]',
    }

    attribute_map = {
        'number_of_results': 'numberOfResults',
        'pagination': 'pagination',
        'refinements': 'refinements',
        'items': 'items',
    }

    def __init__(self, number_of_results=None, pagination=None, refinements=None, items=None, _configuration=None):  # noqa: E501
        """ItemSearchResults - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._number_of_results = None
        self._pagination = None
        self._refinements = None
        self._items = None
        self.discriminator = None

        self.number_of_results = number_of_results
        self.pagination = pagination
        self.refinements = refinements
        self.items = items

    @property
    def number_of_results(self):
        """Gets the number_of_results of this ItemSearchResults.  # noqa: E501

        For searches that are based on `identifiers`, `numberOfResults` is the total number of Amazon catalog items found. For searches that are based on `keywords`, `numberOfResults` is the estimated total number of Amazon catalog items that are matched by the search query. Only results up to the page count limit are returned per request regardless of the number found.  **Note:** The maximum number of items (ASINs) that can be returned and paged through is 1,000.  # noqa: E501

        :return: The number_of_results of this ItemSearchResults.  # noqa: E501
        :rtype: int
        """
        return self._number_of_results

    @number_of_results.setter
    def number_of_results(self, number_of_results):
        """Sets the number_of_results of this ItemSearchResults.

        For searches that are based on `identifiers`, `numberOfResults` is the total number of Amazon catalog items found. For searches that are based on `keywords`, `numberOfResults` is the estimated total number of Amazon catalog items that are matched by the search query. Only results up to the page count limit are returned per request regardless of the number found.  **Note:** The maximum number of items (ASINs) that can be returned and paged through is 1,000.  # noqa: E501

        :param number_of_results: The number_of_results of this ItemSearchResults.  # noqa: E501
        :type: int
        """
        if self._configuration.client_side_validation and number_of_results is None:
            raise ValueError("Invalid value for `number_of_results`, must not be `None`")  # noqa: E501

        self._number_of_results = number_of_results

    @property
    def pagination(self):
        """Gets the pagination of this ItemSearchResults.  # noqa: E501


        :return: The pagination of this ItemSearchResults.  # noqa: E501
        :rtype: Pagination
        """
        return self._pagination

    @pagination.setter
    def pagination(self, pagination):
        """Sets the pagination of this ItemSearchResults.


        :param pagination: The pagination of this ItemSearchResults.  # noqa: E501
        :type: Pagination
        """
        if self._configuration.client_side_validation and pagination is None:
            raise ValueError("Invalid value for `pagination`, must not be `None`")  # noqa: E501

        self._pagination = pagination

    @property
    def refinements(self):
        """Gets the refinements of this ItemSearchResults.  # noqa: E501


        :return: The refinements of this ItemSearchResults.  # noqa: E501
        :rtype: Refinements
        """
        return self._refinements

    @refinements.setter
    def refinements(self, refinements):
        """Sets the refinements of this ItemSearchResults.


        :param refinements: The refinements of this ItemSearchResults.  # noqa: E501
        :type: Refinements
        """
        if self._configuration.client_side_validation and refinements is None:
            raise ValueError("Invalid value for `refinements`, must not be `None`")  # noqa: E501

        self._refinements = refinements

    @property
    def items(self):
        """Gets the items of this ItemSearchResults.  # noqa: E501

        A list of items from the Amazon catalog.  # noqa: E501

        :return: The items of this ItemSearchResults.  # noqa: E501
        :rtype: List[Item]
        """
        return self._items

    @items.setter
    def items(self, items):
        """Sets the items of this ItemSearchResults.

        A list of items from the Amazon catalog.  # noqa: E501

        :param items: The items of this ItemSearchResults.  # noqa: E501
        :type: List[Item]
        """
        if self._configuration.client_side_validation and items is None:
            raise ValueError("Invalid value for `items`, must not be `None`")  # noqa: E501

        self._items = items

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

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