# 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 CatalogProductSet(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, name=None, product_ids_any=None, product_ids_all=None, quantity_exact=None, quantity_min=None, quantity_max=None, all_products=None):
        """
        CatalogProductSet - 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 = {
            'name': 'str',
            'product_ids_any': 'list[str]',
            'product_ids_all': 'list[str]',
            'quantity_exact': 'int',
            'quantity_min': 'int',
            'quantity_max': 'int',
            'all_products': 'bool'
        }

        self.attribute_map = {
            'name': 'name',
            'product_ids_any': 'product_ids_any',
            'product_ids_all': 'product_ids_all',
            'quantity_exact': 'quantity_exact',
            'quantity_min': 'quantity_min',
            'quantity_max': 'quantity_max',
            'all_products': 'all_products'
        }

        self._name = name
        self._product_ids_any = product_ids_any
        self._product_ids_all = product_ids_all
        self._quantity_exact = quantity_exact
        self._quantity_min = quantity_min
        self._quantity_max = quantity_max
        self._all_products = all_products

    @property
    def name(self):
        """
        Gets the name of this CatalogProductSet.
         User-defined name for the product set. For example, \"Clearance Items\" or \"Winter Sale Items\".

        :return: The name of this CatalogProductSet.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this CatalogProductSet.
         User-defined name for the product set. For example, \"Clearance Items\" or \"Winter Sale Items\".

        :param name: The name of this CatalogProductSet.
        :type: str
        """

        self._name = name

    @property
    def product_ids_any(self):
        """
        Gets the product_ids_any of this CatalogProductSet.
        Unique IDs for any [CatalogObjects](#type-catalogobject)s to include in this product set. Any number of these catalog objects can be in an order for a pricing rule to apply.  This can be used with `product_ids_all` in a parent [CatalogProductSet](#type-catalogproductset) to match groups of products for a bulk discount, such as a discount for an entree and side combo.  Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.  Max: 500 catalog object IDs.

        :return: The product_ids_any of this CatalogProductSet.
        :rtype: list[str]
        """
        return self._product_ids_any

    @product_ids_any.setter
    def product_ids_any(self, product_ids_any):
        """
        Sets the product_ids_any of this CatalogProductSet.
        Unique IDs for any [CatalogObjects](#type-catalogobject)s to include in this product set. Any number of these catalog objects can be in an order for a pricing rule to apply.  This can be used with `product_ids_all` in a parent [CatalogProductSet](#type-catalogproductset) to match groups of products for a bulk discount, such as a discount for an entree and side combo.  Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.  Max: 500 catalog object IDs.

        :param product_ids_any: The product_ids_any of this CatalogProductSet.
        :type: list[str]
        """

        self._product_ids_any = product_ids_any

    @property
    def product_ids_all(self):
        """
        Gets the product_ids_all of this CatalogProductSet.
        Unique IDs for [CatalogObjects](#type-catalogobject) to include in this product set. All objects in this set must be included in an order for a pricing rule to apply.  Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.  Max: 500 catalog object IDs.

        :return: The product_ids_all of this CatalogProductSet.
        :rtype: list[str]
        """
        return self._product_ids_all

    @product_ids_all.setter
    def product_ids_all(self, product_ids_all):
        """
        Sets the product_ids_all of this CatalogProductSet.
        Unique IDs for [CatalogObjects](#type-catalogobject) to include in this product set. All objects in this set must be included in an order for a pricing rule to apply.  Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.  Max: 500 catalog object IDs.

        :param product_ids_all: The product_ids_all of this CatalogProductSet.
        :type: list[str]
        """

        self._product_ids_all = product_ids_all

    @property
    def quantity_exact(self):
        """
        Gets the quantity_exact of this CatalogProductSet.
        If set, there must be exactly this many items from `products_any` or `products_all` in the cart for the discount to apply.  Cannot be combined with either `quantity_min` or `quantity_max`.

        :return: The quantity_exact of this CatalogProductSet.
        :rtype: int
        """
        return self._quantity_exact

    @quantity_exact.setter
    def quantity_exact(self, quantity_exact):
        """
        Sets the quantity_exact of this CatalogProductSet.
        If set, there must be exactly this many items from `products_any` or `products_all` in the cart for the discount to apply.  Cannot be combined with either `quantity_min` or `quantity_max`.

        :param quantity_exact: The quantity_exact of this CatalogProductSet.
        :type: int
        """

        self._quantity_exact = quantity_exact

    @property
    def quantity_min(self):
        """
        Gets the quantity_min of this CatalogProductSet.
        If set, there must be at least this many items from `products_any` or `products_all` in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified.

        :return: The quantity_min of this CatalogProductSet.
        :rtype: int
        """
        return self._quantity_min

    @quantity_min.setter
    def quantity_min(self, quantity_min):
        """
        Sets the quantity_min of this CatalogProductSet.
        If set, there must be at least this many items from `products_any` or `products_all` in a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if `quantity_exact`, `quantity_min` and `quantity_max` are all unspecified.

        :param quantity_min: The quantity_min of this CatalogProductSet.
        :type: int
        """

        self._quantity_min = quantity_min

    @property
    def quantity_max(self):
        """
        Gets the quantity_max of this CatalogProductSet.
        If set, the pricing rule will apply to a maximum of this many items from `products_any` or `products_all`.

        :return: The quantity_max of this CatalogProductSet.
        :rtype: int
        """
        return self._quantity_max

    @quantity_max.setter
    def quantity_max(self, quantity_max):
        """
        Sets the quantity_max of this CatalogProductSet.
        If set, the pricing rule will apply to a maximum of this many items from `products_any` or `products_all`.

        :param quantity_max: The quantity_max of this CatalogProductSet.
        :type: int
        """

        self._quantity_max = quantity_max

    @property
    def all_products(self):
        """
        Gets the all_products of this CatalogProductSet.
        If set to `true`, the product set will include every item in the catalog.  Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.

        :return: The all_products of this CatalogProductSet.
        :rtype: bool
        """
        return self._all_products

    @all_products.setter
    def all_products(self, all_products):
        """
        Sets the all_products of this CatalogProductSet.
        If set to `true`, the product set will include every item in the catalog.  Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.

        :param all_products: The all_products of this CatalogProductSet.
        :type: bool
        """

        self._all_products = all_products

    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
