# 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 ProductTypeVersion(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 = {
        'version': 'str',
        'latest': 'bool',
        'release_candidate': 'bool',
    }

    attribute_map = {
        'version': 'version',
        'latest': 'latest',
        'release_candidate': 'releaseCandidate',
    }

    def __init__(self, version=None, latest=None, release_candidate=None, _configuration=None):  # noqa: E501
        """ProductTypeVersion - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._version = None
        self._latest = None
        self._release_candidate = None
        self.discriminator = None

        self.version = version
        self.latest = latest
        if release_candidate is not None:
            self.release_candidate = release_candidate

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

        Version identifier.  # noqa: E501

        :return: The version of this ProductTypeVersion.  # noqa: E501
        :rtype: str
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this ProductTypeVersion.

        Version identifier.  # noqa: E501

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

        self._version = version

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

        When true, the version indicated by the version identifier is the latest available for the Amazon product type.  # noqa: E501

        :return: The latest of this ProductTypeVersion.  # noqa: E501
        :rtype: bool
        """
        return self._latest

    @latest.setter
    def latest(self, latest):
        """Sets the latest of this ProductTypeVersion.

        When true, the version indicated by the version identifier is the latest available for the Amazon product type.  # noqa: E501

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

        self._latest = latest

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

        When true, the version indicated by the version identifier is the prerelease (release candidate) for the Amazon product type.  # noqa: E501

        :return: The release_candidate of this ProductTypeVersion.  # noqa: E501
        :rtype: bool
        """
        return self._release_candidate

    @release_candidate.setter
    def release_candidate(self, release_candidate):
        """Sets the release_candidate of this ProductTypeVersion.

        When true, the version indicated by the version identifier is the prerelease (release candidate) for the Amazon product type.  # noqa: E501

        :param release_candidate: The release_candidate of this ProductTypeVersion.  # noqa: E501
        :type: bool
        """

        self._release_candidate = release_candidate

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

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