"""
    Pinterest REST API

    Pinterest's REST API  # noqa: E501

    The version of the OpenAPI document: 5.3.0
    Contact: pinterest-api@pinterest.com
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from pinterestsdk.model_utils import (  # noqa: F401
    ApiTypeError,
    ModelComposed,
    ModelNormal,
    ModelSimple,
    cached_property,
    change_keys_js_to_python,
    convert_js_args_to_python_args,
    date,
    datetime,
    file_type,
    none_type,
    validate_get_composed_info,
    OpenApiModel
)
from pinterestsdk.exceptions import ApiAttributeError


def lazy_import():
    from pinterestsdk.model.availability_filter import AvailabilityFilter
    from pinterestsdk.model.brand_filter import BrandFilter
    from pinterestsdk.model.catalogs_product_group_currency_criteria import CatalogsProductGroupCurrencyCriteria
    from pinterestsdk.model.catalogs_product_group_multiple_string_criteria import CatalogsProductGroupMultipleStringCriteria
    from pinterestsdk.model.catalogs_product_group_multiple_string_list_criteria import CatalogsProductGroupMultipleStringListCriteria
    from pinterestsdk.model.catalogs_product_group_pricing_criteria import CatalogsProductGroupPricingCriteria
    from pinterestsdk.model.condition_filter import ConditionFilter
    from pinterestsdk.model.currency_filter import CurrencyFilter
    from pinterestsdk.model.custom_label0_filter import CustomLabel0Filter
    from pinterestsdk.model.custom_label1_filter import CustomLabel1Filter
    from pinterestsdk.model.custom_label2_filter import CustomLabel2Filter
    from pinterestsdk.model.custom_label3_filter import CustomLabel3Filter
    from pinterestsdk.model.custom_label4_filter import CustomLabel4Filter
    from pinterestsdk.model.gender_filter import GenderFilter
    from pinterestsdk.model.google_product_category0_filter import GoogleProductCategory0Filter
    from pinterestsdk.model.google_product_category1_filter import GoogleProductCategory1Filter
    from pinterestsdk.model.google_product_category2_filter import GoogleProductCategory2Filter
    from pinterestsdk.model.google_product_category3_filter import GoogleProductCategory3Filter
    from pinterestsdk.model.google_product_category4_filter import GoogleProductCategory4Filter
    from pinterestsdk.model.google_product_category5_filter import GoogleProductCategory5Filter
    from pinterestsdk.model.google_product_category6_filter import GoogleProductCategory6Filter
    from pinterestsdk.model.item_group_id_filter import ItemGroupIdFilter
    from pinterestsdk.model.item_id_filter import ItemIdFilter
    from pinterestsdk.model.max_price_filter import MaxPriceFilter
    from pinterestsdk.model.min_price_filter import MinPriceFilter
    from pinterestsdk.model.product_type0_filter import ProductType0Filter
    from pinterestsdk.model.product_type1_filter import ProductType1Filter
    from pinterestsdk.model.product_type2_filter import ProductType2Filter
    from pinterestsdk.model.product_type3_filter import ProductType3Filter
    from pinterestsdk.model.product_type4_filter import ProductType4Filter
    globals()['AvailabilityFilter'] = AvailabilityFilter
    globals()['BrandFilter'] = BrandFilter
    globals()['CatalogsProductGroupCurrencyCriteria'] = CatalogsProductGroupCurrencyCriteria
    globals()['CatalogsProductGroupMultipleStringCriteria'] = CatalogsProductGroupMultipleStringCriteria
    globals()['CatalogsProductGroupMultipleStringListCriteria'] = CatalogsProductGroupMultipleStringListCriteria
    globals()['CatalogsProductGroupPricingCriteria'] = CatalogsProductGroupPricingCriteria
    globals()['ConditionFilter'] = ConditionFilter
    globals()['CurrencyFilter'] = CurrencyFilter
    globals()['CustomLabel0Filter'] = CustomLabel0Filter
    globals()['CustomLabel1Filter'] = CustomLabel1Filter
    globals()['CustomLabel2Filter'] = CustomLabel2Filter
    globals()['CustomLabel3Filter'] = CustomLabel3Filter
    globals()['CustomLabel4Filter'] = CustomLabel4Filter
    globals()['GenderFilter'] = GenderFilter
    globals()['GoogleProductCategory0Filter'] = GoogleProductCategory0Filter
    globals()['GoogleProductCategory1Filter'] = GoogleProductCategory1Filter
    globals()['GoogleProductCategory2Filter'] = GoogleProductCategory2Filter
    globals()['GoogleProductCategory3Filter'] = GoogleProductCategory3Filter
    globals()['GoogleProductCategory4Filter'] = GoogleProductCategory4Filter
    globals()['GoogleProductCategory5Filter'] = GoogleProductCategory5Filter
    globals()['GoogleProductCategory6Filter'] = GoogleProductCategory6Filter
    globals()['ItemGroupIdFilter'] = ItemGroupIdFilter
    globals()['ItemIdFilter'] = ItemIdFilter
    globals()['MaxPriceFilter'] = MaxPriceFilter
    globals()['MinPriceFilter'] = MinPriceFilter
    globals()['ProductType0Filter'] = ProductType0Filter
    globals()['ProductType1Filter'] = ProductType1Filter
    globals()['ProductType2Filter'] = ProductType2Filter
    globals()['ProductType3Filter'] = ProductType3Filter
    globals()['ProductType4Filter'] = ProductType4Filter


class CatalogsProductGroupFilterKeys(ModelComposed):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.

    Attributes:
      allowed_values (dict): The key is the tuple path to the attribute
          and the for var_name this is (var_name,). The value is a dict
          with a capitalized key describing the allowed value and an allowed
          value. These dicts store the allowed enum values.
      attribute_map (dict): The key is attribute name
          and the value is json key in definition.
      discriminator_value_class_map (dict): A dict to go from the discriminator
          variable value to the discriminator class name.
      validations (dict): The key is the tuple path to the attribute
          and the for var_name this is (var_name,). The value is a dict
          that stores validations for max_length, min_length, max_items,
          min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
          inclusive_minimum, and regex.
      additional_properties_type (tuple): A tuple of classes accepted
          as additional properties values.
    """

    allowed_values = {
    }

    validations = {
    }

    @cached_property
    def additional_properties_type():
        """
        This must be a method because a model may have properties that are
        of type self, this must run after the class is loaded
        """
        lazy_import()
        return (bool, date, datetime, dict, float, int, list, str, none_type,)  # noqa: E501

    _nullable = False

    @cached_property
    def openapi_types():
        """
        This must be a method because a model may have properties that are
        of type self, this must run after the class is loaded

        Returns
            openapi_types (dict): The key is attribute name
                and the value is attribute type.
        """
        lazy_import()
        return {
            'min_price': (CatalogsProductGroupPricingCriteria,),  # noqa: E501
            'max_price': (CatalogsProductGroupPricingCriteria,),  # noqa: E501
            'currency': (CatalogsProductGroupCurrencyCriteria,),  # noqa: E501
            'item_id': (CatalogsProductGroupCurrencyCriteria,),  # noqa: E501
            'availability': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'brand': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'condition': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'custom_label_0': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'custom_label_1': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'custom_label_2': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'custom_label_3': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'custom_label_4': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'item_group_id': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'gender': (CatalogsProductGroupMultipleStringCriteria,),  # noqa: E501
            'product_type_4': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'product_type_3': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'product_type_2': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'product_type_1': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'product_type_0': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_6': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_5': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_4': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_3': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_2': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_1': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
            'google_product_category_0': (CatalogsProductGroupMultipleStringListCriteria,),  # noqa: E501
        }

    @cached_property
    def discriminator():
        return None


    attribute_map = {
        'min_price': 'MIN_PRICE',  # noqa: E501
        'max_price': 'MAX_PRICE',  # noqa: E501
        'currency': 'CURRENCY',  # noqa: E501
        'item_id': 'ITEM_ID',  # noqa: E501
        'availability': 'AVAILABILITY',  # noqa: E501
        'brand': 'BRAND',  # noqa: E501
        'condition': 'CONDITION',  # noqa: E501
        'custom_label_0': 'CUSTOM_LABEL_0',  # noqa: E501
        'custom_label_1': 'CUSTOM_LABEL_1',  # noqa: E501
        'custom_label_2': 'CUSTOM_LABEL_2',  # noqa: E501
        'custom_label_3': 'CUSTOM_LABEL_3',  # noqa: E501
        'custom_label_4': 'CUSTOM_LABEL_4',  # noqa: E501
        'item_group_id': 'ITEM_GROUP_ID',  # noqa: E501
        'gender': 'GENDER',  # noqa: E501
        'product_type_4': 'PRODUCT_TYPE_4',  # noqa: E501
        'product_type_3': 'PRODUCT_TYPE_3',  # noqa: E501
        'product_type_2': 'PRODUCT_TYPE_2',  # noqa: E501
        'product_type_1': 'PRODUCT_TYPE_1',  # noqa: E501
        'product_type_0': 'PRODUCT_TYPE_0',  # noqa: E501
        'google_product_category_6': 'GOOGLE_PRODUCT_CATEGORY_6',  # noqa: E501
        'google_product_category_5': 'GOOGLE_PRODUCT_CATEGORY_5',  # noqa: E501
        'google_product_category_4': 'GOOGLE_PRODUCT_CATEGORY_4',  # noqa: E501
        'google_product_category_3': 'GOOGLE_PRODUCT_CATEGORY_3',  # noqa: E501
        'google_product_category_2': 'GOOGLE_PRODUCT_CATEGORY_2',  # noqa: E501
        'google_product_category_1': 'GOOGLE_PRODUCT_CATEGORY_1',  # noqa: E501
        'google_product_category_0': 'GOOGLE_PRODUCT_CATEGORY_0',  # noqa: E501
    }

    read_only_vars = {
    }

    @classmethod
    @convert_js_args_to_python_args
    def _from_openapi_data(cls, *args, **kwargs):  # noqa: E501
        """CatalogsProductGroupFilterKeys - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            min_price (CatalogsProductGroupPricingCriteria): [optional]  # noqa: E501
            max_price (CatalogsProductGroupPricingCriteria): [optional]  # noqa: E501
            currency (CatalogsProductGroupCurrencyCriteria): [optional]  # noqa: E501
            item_id (CatalogsProductGroupCurrencyCriteria): [optional]  # noqa: E501
            availability (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            brand (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            condition (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_0 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_1 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_2 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_3 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_4 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            item_group_id (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            gender (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            product_type_4 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_3 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_2 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_1 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_0 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_6 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_5 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_4 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_3 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_2 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_1 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_0 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            raise ApiTypeError(
                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                    args,
                    self.__class__.__name__,
                ),
                path_to_item=_path_to_item,
                valid_classes=(self.__class__,),
            )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(
            constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)

        return self

    required_properties = set([
        '_data_store',
        '_check_type',
        '_spec_property_naming',
        '_path_to_item',
        '_configuration',
        '_visited_composed_classes',
        '_composed_instances',
        '_var_name_to_model_instances',
        '_additional_properties_model_instances',
    ])

    @convert_js_args_to_python_args
    def __init__(self, *args, **kwargs):  # noqa: E501
        """CatalogsProductGroupFilterKeys - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            min_price (CatalogsProductGroupPricingCriteria): [optional]  # noqa: E501
            max_price (CatalogsProductGroupPricingCriteria): [optional]  # noqa: E501
            currency (CatalogsProductGroupCurrencyCriteria): [optional]  # noqa: E501
            item_id (CatalogsProductGroupCurrencyCriteria): [optional]  # noqa: E501
            availability (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            brand (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            condition (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_0 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_1 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_2 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_3 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            custom_label_4 (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            item_group_id (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            gender (CatalogsProductGroupMultipleStringCriteria): [optional]  # noqa: E501
            product_type_4 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_3 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_2 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_1 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            product_type_0 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_6 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_5 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_4 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_3 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_2 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_1 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
            google_product_category_0 (CatalogsProductGroupMultipleStringListCriteria): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        if args:
            raise ApiTypeError(
                "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                    args,
                    self.__class__.__name__,
                ),
                path_to_item=_path_to_item,
                valid_classes=(self.__class__,),
            )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(
            constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
            if var_name in self.read_only_vars:
                raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
                                     f"class with read only attributes.")

    @cached_property
    def _composed_schemas():
        # we need this here to make our import statements work
        # we must store _composed_schemas in here so the code is only run
        # when we invoke this method. If we kept this at the class
        # level we would get an error because the class level
        # code would be run when this module is imported, and these composed
        # classes don't exist yet because their module has not finished
        # loading
        lazy_import()
        return {
          'anyOf': [
              AvailabilityFilter,
              BrandFilter,
              ConditionFilter,
              CurrencyFilter,
              CustomLabel0Filter,
              CustomLabel1Filter,
              CustomLabel2Filter,
              CustomLabel3Filter,
              CustomLabel4Filter,
              GenderFilter,
              GoogleProductCategory0Filter,
              GoogleProductCategory1Filter,
              GoogleProductCategory2Filter,
              GoogleProductCategory3Filter,
              GoogleProductCategory4Filter,
              GoogleProductCategory5Filter,
              GoogleProductCategory6Filter,
              ItemGroupIdFilter,
              ItemIdFilter,
              MaxPriceFilter,
              MinPriceFilter,
              ProductType0Filter,
              ProductType1Filter,
              ProductType2Filter,
              ProductType3Filter,
              ProductType4Filter,
          ],
          'allOf': [
          ],
          'oneOf': [
          ],
        }
