# coding: utf-8

"""
    Selling Partner API for Listings Items

    The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).

    The version of the OpenAPI document: 2021-08-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',
        'items': 'List[Item]',
    }

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

    def __init__(self, number_of_results=None, pagination=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._items = None
        self.discriminator = None

        self.number_of_results = number_of_results
        if pagination is not None:
            self.pagination = pagination
        self.items = items

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

        The total number of selling partner listings items found for the search criteria (only results up to the page count limit is returned per request regardless of the number found).  Note: The maximum number of items (SKUs) that can be returned and paged through is 1000.  # 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.

        The total number of selling partner listings items found for the search criteria (only results up to the page count limit is returned per request regardless of the number found).  Note: The maximum number of items (SKUs) that can be returned and paged through is 1000.  # 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
        """

        self._pagination = pagination

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

        A list of listings items.  # 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 listings items.  # 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()
