# coding: utf-8

"""
    Selling Partner API for Product Type Definitions

    The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).

    The version of the OpenAPI document: 2020-09-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 ProductTypeDefinition(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 = {
        'meta_schema': 'SchemaLink',
        'var_schema': 'SchemaLink',
        'requirements': 'str',
        'requirements_enforced': 'str',
        'property_groups': 'Dict[str, PropertyGroup]',
        'locale': 'str',
        'marketplace_ids': 'List[str]',
        'product_type': 'str',
        'display_name': 'str',
        'product_type_version': 'ProductTypeVersion',
    }

    attribute_map = {
        'meta_schema': 'metaSchema',
        'var_schema': 'schema',
        'requirements': 'requirements',
        'requirements_enforced': 'requirementsEnforced',
        'property_groups': 'propertyGroups',
        'locale': 'locale',
        'marketplace_ids': 'marketplaceIds',
        'product_type': 'productType',
        'display_name': 'displayName',
        'product_type_version': 'productTypeVersion',
    }

    def __init__(self, meta_schema=None, var_schema=None, requirements=None, requirements_enforced=None, property_groups=None, locale=None, marketplace_ids=None, product_type=None, display_name=None, product_type_version=None, _configuration=None):  # noqa: E501
        """ProductTypeDefinition - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._meta_schema = None
        self._var_schema = None
        self._requirements = None
        self._requirements_enforced = None
        self._property_groups = None
        self._locale = None
        self._marketplace_ids = None
        self._product_type = None
        self._display_name = None
        self._product_type_version = None
        self.discriminator = None

        if meta_schema is not None:
            self.meta_schema = meta_schema
        self.var_schema = var_schema
        self.requirements = requirements
        self.requirements_enforced = requirements_enforced
        self.property_groups = property_groups
        self.locale = locale
        self.marketplace_ids = marketplace_ids
        self.product_type = product_type
        self.display_name = display_name
        self.product_type_version = product_type_version

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


        :return: The meta_schema of this ProductTypeDefinition.  # noqa: E501
        :rtype: SchemaLink
        """
        return self._meta_schema

    @meta_schema.setter
    def meta_schema(self, meta_schema):
        """Sets the meta_schema of this ProductTypeDefinition.


        :param meta_schema: The meta_schema of this ProductTypeDefinition.  # noqa: E501
        :type: SchemaLink
        """

        self._meta_schema = meta_schema

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


        :return: The var_schema of this ProductTypeDefinition.  # noqa: E501
        :rtype: SchemaLink
        """
        return self._var_schema

    @var_schema.setter
    def var_schema(self, var_schema):
        """Sets the var_schema of this ProductTypeDefinition.


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

        self._var_schema = var_schema

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

        Name of the requirements set represented in this product type definition.  # noqa: E501

        :return: The requirements of this ProductTypeDefinition.  # noqa: E501
        :rtype: str
        """
        return self._requirements

    @requirements.setter
    def requirements(self, requirements):
        """Sets the requirements of this ProductTypeDefinition.

        Name of the requirements set represented in this product type definition.  # noqa: E501

        :param requirements: The requirements of this ProductTypeDefinition.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and requirements is None:
            raise ValueError("Invalid value for `requirements`, must not be `None`")  # noqa: E501
        allowed_values = ["LISTING", "LISTING_PRODUCT_ONLY", "LISTING_OFFER_ONLY"]  # noqa: E501
        if (self._configuration.client_side_validation and
                requirements not in allowed_values):
            raise ValueError(
                "Invalid value for `requirements` ({0}), must be one of {1}"  # noqa: E501
                .format(requirements, allowed_values)
            )

        self._requirements = requirements

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

        Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates).  # noqa: E501

        :return: The requirements_enforced of this ProductTypeDefinition.  # noqa: E501
        :rtype: str
        """
        return self._requirements_enforced

    @requirements_enforced.setter
    def requirements_enforced(self, requirements_enforced):
        """Sets the requirements_enforced of this ProductTypeDefinition.

        Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates).  # noqa: E501

        :param requirements_enforced: The requirements_enforced of this ProductTypeDefinition.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and requirements_enforced is None:
            raise ValueError("Invalid value for `requirements_enforced`, must not be `None`")  # noqa: E501
        allowed_values = ["ENFORCED", "NOT_ENFORCED"]  # noqa: E501
        if (self._configuration.client_side_validation and
                requirements_enforced not in allowed_values):
            raise ValueError(
                "Invalid value for `requirements_enforced` ({0}), must be one of {1}"  # noqa: E501
                .format(requirements_enforced, allowed_values)
            )

        self._requirements_enforced = requirements_enforced

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

        Mapping of property group names to property groups. Property groups represent logical groupings of schema properties that can be used for display or informational purposes.  # noqa: E501

        :return: The property_groups of this ProductTypeDefinition.  # noqa: E501
        :rtype: Dict[str, PropertyGroup]
        """
        return self._property_groups

    @property_groups.setter
    def property_groups(self, property_groups):
        """Sets the property_groups of this ProductTypeDefinition.

        Mapping of property group names to property groups. Property groups represent logical groupings of schema properties that can be used for display or informational purposes.  # noqa: E501

        :param property_groups: The property_groups of this ProductTypeDefinition.  # noqa: E501
        :type: Dict[str, PropertyGroup]
        """
        if self._configuration.client_side_validation and property_groups is None:
            raise ValueError("Invalid value for `property_groups`, must not be `None`")  # noqa: E501

        self._property_groups = property_groups

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

        Locale of the display elements contained in the product type definition.  # noqa: E501

        :return: The locale of this ProductTypeDefinition.  # noqa: E501
        :rtype: str
        """
        return self._locale

    @locale.setter
    def locale(self, locale):
        """Sets the locale of this ProductTypeDefinition.

        Locale of the display elements contained in the product type definition.  # noqa: E501

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

        self._locale = locale

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

        Amazon marketplace identifiers for which the product type definition is applicable.  # noqa: E501

        :return: The marketplace_ids of this ProductTypeDefinition.  # noqa: E501
        :rtype: List[str]
        """
        return self._marketplace_ids

    @marketplace_ids.setter
    def marketplace_ids(self, marketplace_ids):
        """Sets the marketplace_ids of this ProductTypeDefinition.

        Amazon marketplace identifiers for which the product type definition is applicable.  # noqa: E501

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

        self._marketplace_ids = marketplace_ids

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

        The name of the Amazon product type that this product type definition applies to.  # noqa: E501

        :return: The product_type of this ProductTypeDefinition.  # noqa: E501
        :rtype: str
        """
        return self._product_type

    @product_type.setter
    def product_type(self, product_type):
        """Sets the product_type of this ProductTypeDefinition.

        The name of the Amazon product type that this product type definition applies to.  # noqa: E501

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

        self._product_type = product_type

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

        Human-readable and localized description of the Amazon product type.  # noqa: E501

        :return: The display_name of this ProductTypeDefinition.  # noqa: E501
        :rtype: str
        """
        return self._display_name

    @display_name.setter
    def display_name(self, display_name):
        """Sets the display_name of this ProductTypeDefinition.

        Human-readable and localized description of the Amazon product type.  # noqa: E501

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

        self._display_name = display_name

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


        :return: The product_type_version of this ProductTypeDefinition.  # noqa: E501
        :rtype: ProductTypeVersion
        """
        return self._product_type_version

    @product_type_version.setter
    def product_type_version(self, product_type_version):
        """Sets the product_type_version of this ProductTypeDefinition.


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

        self._product_type_version = product_type_version

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

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